Find rustc next to a keg-only Homebrew rustup #2

Merged
stephen merged 1 commit from fix-keg-only-rustup into main 2026-11-06 00:56:38 +00:00
Owner

stabbur's macOS job failed in this action on the M5 runner (stabbur run #3):

scripts/setup.sh: line 66: rustc: command not found

That runner has Homebrew's rustup. Homebrew links only rustup into /opt/homebrew/bin; the rustc and cargo proxies sit next to the real binary in the Cellar. So command -v rustup succeeds, the sh.rustup.rs install is skipped, and ~/.cargo/bin (which this action adds to PATH) holds nothing. The toolchain installs, then nothing can run it.

Fix: if rustc is still missing after setup, resolve the rustup symlink and put its real directory on PATH and GITHUB_PATH. Runners where rustup came from sh.rustup.rs are unchanged, since rustc is already found.

tests/run.sh gets a case that models the keg layout (a relative symlink, no rustc on PATH). It fails on main and passes here.

After merge this needs a v1.0.2 tag and the v1 tag moved; stabbur pins v1.0.1.

stabbur's macOS job failed in this action on the M5 runner (stabbur run #3): ``` scripts/setup.sh: line 66: rustc: command not found ``` That runner has Homebrew's rustup. Homebrew links only `rustup` into `/opt/homebrew/bin`; the `rustc` and `cargo` proxies sit next to the real binary in the Cellar. So `command -v rustup` succeeds, the sh.rustup.rs install is skipped, and `~/.cargo/bin` (which this action adds to PATH) holds nothing. The toolchain installs, then nothing can run it. Fix: if `rustc` is still missing after setup, resolve the `rustup` symlink and put its real directory on PATH and `GITHUB_PATH`. Runners where rustup came from sh.rustup.rs are unchanged, since `rustc` is already found. `tests/run.sh` gets a case that models the keg layout (a relative symlink, no `rustc` on PATH). It fails on main and passes here. After merge this needs a `v1.0.2` tag and the `v1` tag moved; stabbur pins `v1.0.1`.
Find rustc next to a keg-only Homebrew rustup
All checks were successful
test / unit (pull_request) Successful in 5s
test / e2e (pull_request) Successful in 19s
65190e70e8
Homebrew links only rustup into /opt/homebrew/bin. The rustc and cargo
proxies sit beside the real binary, so a runner using Homebrew's rustup
installed the toolchain and then failed with 'rustc: command not found'.
When rustc is missing after setup, put the real rustup's directory on
PATH and GITHUB_PATH.
gerri left a comment

Automated Codex review (read-only) of head 65190e70e8.

  • Medium tests/run.sh:108: Invariant: the keg regression test must control whether rustc is available (standards 13 and 18). Its PATH includes /usr/bin and /bin, so a self-hosted Linux runner with distro-installed Rust finds /usr/bin/rustc. The fallback is skipped and the GITHUB_PATH assertion fails, even though the implementation works. This newly added test can therefore break CI on an ordinary supported runner configuration. Build an isolated PATH containing the required shell utilities but no host Rust executables, then assert that rustc is initially absent before invoking setup.

BLOCKING: 1

Reviewed head 65190e70e8 at 2026-11-06T00:56:55Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head 65190e70e8d5e60d737c2b6e5573dc975ba70d9f. - **Medium** `tests/run.sh:108`: Invariant: the keg regression test must control whether `rustc` is available (standards 13 and 18). Its PATH includes `/usr/bin` and `/bin`, so a self-hosted Linux runner with distro-installed Rust finds `/usr/bin/rustc`. The fallback is skipped and the `GITHUB_PATH` assertion fails, even though the implementation works. This newly added test can therefore break CI on an ordinary supported runner configuration. Build an isolated PATH containing the required shell utilities but no host Rust executables, then assert that `rustc` is initially absent before invoking setup. BLOCKING: 1 --- Reviewed head 65190e70e8d5e60d737c2b6e5573dc975ba70d9f at 2026-11-06T00:56:55Z by codex exec (read-only sandbox).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rasterstate/setup-rust-action!2
No description provided.