Skip to content

fix(ci): stop losing SIGINT in secret cancellation test - #162

Merged
TechDufus merged 3 commits into
mainfrom
farm/red-ci-mise-20261126
Nov 30, 2026
Merged

TechDufus merged 3 commits into
mainfrom
farm/red-ci-mise-20261126

Conversation

@TechDufus

@TechDufus TechDufus commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Fixes the red mise workflow on main: https://github.com/TechDufus/dotfiles/actions/runs/45429500769 (head 979b4f3).

There were two separate failures. Each one has its own commit:

  1. 1e059df fix(ci): stop losing SIGINT in secret cancellation test (arch job)
  2. 1c8dd24 fix(packages): install tlrc instead of removed tldr formula (macos job)

Why CI was red

macos job: the tldr Homebrew formula no longer exists

The first version of this PR got this wrong. It said the macos job was red only because no hosted runner picked it up, and that nothing in the repo could fix it. That was true for runs 45429500769 and 45428723914, where the job was cancelled before any steps ran. But every time the job did get a runner after 2026-10-24, it failed in "Dry-run macos": runs 41215733476 (10-31), 41563356536, 43917532207, and this PR's run 45908653683:

mise ERROR failed to fetch Homebrew formula 'tldr'
mise ERROR HTTP status client error (404 Not Found) for url (https://formulae.brew.sh/api/formula/tldr.json)

modules/packages/mise.macos.toml declares "brew:tldr". In homebrew-core, the formula was deprecated on 2024-10-24 and disabled on 2025-10-24 (because: :unmaintained, replacement_formula: "tlrc"). Commit a5c5d03a6a ("tldr: remove formula") deleted it on 2026-10-25. The last green macos run was 40115926708, on 2026-10-24. tldr isn't an alias or old name of any current formula, so mise's alias index can't resolve it, and mise bootstrap stops before installing anything. This would break a real macOS bootstrap too, not just CI.

arch job, step "Tests (omarchy)": a flaky test, not a code regression

test:zsh failed in modules/zsh/tests/test_secret_loading.sh, in the "cancellation preserves cache…" case:

ok fallback reads retain exact bytes and private refresh temporaries
subprocess.TimeoutExpired: Command '['/usr/sbin/zsh', '-dfc', 'source "$HOME/.config/zsh/vars.secret_functions.zsh"; secret --quiet']' timed out after 5 seconds
[test:zsh] ERROR task failed

The recipe in that case did print ready > "$OP_CONFIG_DIR/ready" and then sleep 15. The test sends SIGINT to the process group as soon as ready exists. Sometimes the signal arrives after zsh has forked the sleep child but before that child has exec'd. zsh's handler in the child drops the signal, exec sleep resets the disposition, and sleep runs the full 15 s. Both zsh shells sit in sigsuspend waiting for it, so communicate(timeout=5) fails.

Evidence:

  • The previous run, 45428723914 on 92d5647, used the same zsh-5.9.2-1 and passed this case. The only changes from 92d5647 to 979b4f3 are omp/codex config and README.
  • Looping only this case locally with zsh 5.9 (Debian) failed 8/100 and 4/60 times, always with the same TimeoutExpired. After a timeout, ps -g <pgid> showed both zsh -dfc … secret --quiet processes in sigsuspend and sleep 15 in hrtimer_nanosleep, so sleep had survived the SIGINT.

The loader is fine. The fixture wrote its readiness marker too early.

Fix

  • modules/packages/mise.macos.toml: "brew:tldr" → "brew:tlrc". Homebrew named tlrc, the official tldr-pages client, as the replacement. It is a bottled formula in homebrew-core, not deprecated, and it installs a tldr binary with man page and completions, so the command stays tldr. Nothing else in the repo refers to tldr.

  • README.md (migration notes): records the switch and the manual cleanup (brew uninstall tldr). An existing tldr keg is not removed automatically, and it ships the same bin/tldr. This follows the repo rule that retiring something comes with documented manual cleanup.

  • modules/zsh/tests/test_secret_loading.sh: the interrupted-refresh recipe now has the external child create the readiness marker just before it execs the long-running command:

    sh -c ': > "$1"; exec sleep 15' sh "$OP_CONFIG_DIR/ready"

    Once ready exists, the foreground child is a process with the default SIGINT disposition (sh, then sleep via exec), and both zsh shells are already waiting on it, so the SIGINT can't be lost. All assertions are unchanged: the test still requires a non-zero exit, an untouched cache, no staged files, and a released lock that lets a retry succeed.

No checks were skipped or weakened, and no workflow file changed.

Verification

All of this ran on Debian 13 (x86_64), zsh 5.9, Python 3.13, in isolated HOME/XDG directories with modules linked as ~/.config/mise/conf.d.

tldr → tlrc, using mise 2026.11.14 (the version in the failing macOS log):

  • formulae.brew.sh/api/formula/tldr.json → 404. tlrc.json → 200, deprecated: false, disabled: false.
  • MISE_ENV=macos mise bootstrap --dry-run --yes --force-dotfiles. Linux resolves the same macOS package list against Linuxbrew bottles:
    • before (1e059df): brew: failed to fetch Homebrew formula 'tldr': … 404
    • after: pour tlrc/1.13.1 (requested), and no tldr error.
    • Both runs still exit 1, for reasons I traced to this Linux host:
      • Cask karabiner-elements is "not available for this platform (x86_64_linux)". It's a macOS-only cask.
      • After the fix, hashicorp/tap/terraform fails too. Its published API returns 404, so mise evaluates Formula/terraform.rb with a Ruby ≥ 3. With no Ruby on PATH, mise says it needs one. With mise's own Ruby 3.4.13 on PATH, the evaluation fails with Permission denied (os error 13) inside mise's Landlock metadata sandbox, which is the Linux-only implementation. On macOS, mise uses its Seatbelt sandbox instead, and the macos-26-arm64 image has Ruby 3.4.13.
    • Before the fix, the terraform error didn't show up at all: the tldr failure stopped package resolution before that tap was evaluated. So tldr may have been hiding a second macOS failure. The last time this tap resolved on the macOS runner was run 40115926708 (build terraform/1.17.0 from source), with mise 2026.10.18. mise has changed brew/tap.rs 9 times since then, so that run doesn't prove 2026.11.14 behaves the same.
  • Every brew:/brew-cask: entry in modules/ (66) checked against formulae.brew.sh, excluding the 4 third-party tap formulae. Every cask and every other formula returned 200 and isn't deprecated or disabled, except three: tldr is missing; tmate is deprecated (see Risk); and python 404s by name but is an alias that mise resolves ('python' resolves to 'python@3.15', a warning, not an error).
  • The macOS "Tests" step hasn't run in CI since 10-24, because the dry-run failed first. As a partial check, MISE_ENV=macos mise run --jobs 1 'test:*' (all 9 tasks, including the macOS-only test:hammerspoon, using Lua 5.4.7 built locally) exited 0.

Secret cancellation test:

  • A stress harness that repeats only the interrupted-refresh case, built from this test's own setup: fails=8 of 100 before the fix, fails=0 of 300 after.
  • bash modules/zsh/tests/test_secret_loading.sh: all cases ok.
  • MISE_TASK_RUN_AUTO_INSTALL=false MISE_AUTO_ENV=true MISE_ENV=omarchy mise run --jobs 1 test:zsh exited 0.
  • On this PR's CI run 45908653683, the arch, apply and system-sudoers jobs passed.

Not verified locally:

  • A real macOS bootstrap or the macos job itself. Both need a macOS host. The checks above ran on Linux and are not proof for macOS.
  • tlrc replacing an already-installed tldr keg on a live Mac. I documented the cleanup instead.

Risk

Low. One package declaration changes on macOS, there's one README note, and one test fixture line changes.

  • Machines that already have the old tldr keg will have two formulae that both ship bin/tldr until someone runs brew uninstall tldr, as the README note says. [INFERENCE] Depending on how mise links kegs, that could cause a link conflict on the next bootstrap. I haven't observed this.
  • The macOS "Tests" step will run for the first time since 2026-10-24, over 37 commits that only CI on Linux has checked. It could expose a macOS-only failure the dry-run was hiding. The Linux emulation of that step passed.
  • hashicorp/tap/terraform hasn't been resolved on macOS with mise 2026.11.14 yet (see Verification). If tap evaluation fails there, the macos dry-run will stay red with a terraform error. That would be a separate failure that tldr was hiding, and this PR doesn't change it.
  • Coming soon: brew:tmate is deprecated as unmaintained, with disable_date: 2026-12-11 and no replacement named. [INFERENCE] Once it's disabled, it will probably fail the macOS dry-run the same way tldr did. I left it alone because it isn't failing today and picking a replacement is the owner's call.
  • If the macos job can't get a hosted runner, the workflow may still show as cancelled for that reason alone.

Opened as a draft by Beru's red-CI loop (omp on the Grok Bot box). Nothing merges without TechDufus.

TechDufus and others added 3 commits November 26, 2026 17:03
The interrupted-refresh case marked readiness from the zsh producer
before it forked `sleep 15`. A SIGINT landing between that fork and the
exec is dropped, so sleep ran its full 15s and the 5s communicate
timeout fired. Mark readiness from the exec'd child instead.
Homebrew disabled the unmaintained tldr formula on 2025-10-24 and removed it
from homebrew-core on 2026-10-25, naming tlrc (the official tldr client)
as its replacement. formulae.brew.sh now returns 404 for tldr, so
`mise bootstrap` on macOS fails before installing anything. tlrc still
installs a `tldr` binary, so the command name is unchanged.
…1126

# Conflicts:
#	README.md
#	modules/packages/mise.macos.toml
@TechDufus
TechDufus marked this pull request as ready for review November 30, 2026 18:29
@TechDufus
TechDufus merged commit 57501d8 into main Nov 30, 2026
5 checks passed
@TechDufus
TechDufus deleted the farm/red-ci-mise-20261126 branch November 30, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant