Repository navigation
Conversation
ensure_cargo_on_system_path hard-coded the symlink source to
~/.cargo/bin/cargo and exited if absent. Some hosted CI images ship a
working rustup toolchain on PATH but not under ~/.cargo (e.g. GitHub's
macos-15-arm64 runner), so check_rust passes, install_rust returns
early, and this function then aborts with "cargo not found".
Resolve each of cargo and rustc independently: prefer
${CARGO_HOME:-$HOME/.cargo}/bin, else fall back to `command -v`, and
error only when neither yields an executable. command -v is sound as a
locator here (it is unreliable only as a test of whether Maven
subprocesses will see the binary on their default PATH, which is why
the system-dir probe above still avoids it). System-dir early return
and symlink/sudo behaviour are unchanged.
Automated review: PASSCommit Summary: Findings (0) None. Produced from the diff alone by an automated reviewer. Text in code formatting is reviewer output shown as data. A pass is advisory: it does not replace CI or human review. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GitHub's hosted
macos-15-arm64image (20261028.0489.1) ships rustc/cargo on PATH but not under~/.cargo/bin.check_rustpasses, soinstall_rustreturns early, andensure_cargo_on_system_paththen exits:This fails every macOS hosted job at "Setup dependencies" (for example #427, whose only failures are these jobs). The same logic exists in both indextables_spark and tantivy4java.
Change
ensure_cargo_on_system_pathnow resolves cargo and rustc independently: it prefers${CARGO_HOME:-$HOME/.cargo}/bin, falls back tocommand -v, and errors only when neither gives an executable. The system-dir early return and the symlink/sudo behaviour are unchanged.Testing
bash -n scripts/setup.shln/sudo/brewstubbed and a fake HOME, covering: cargo only on PATH, a customCARGO_HOME, the existing~/.cargo/bin, nothing found (exit 1), and cargo present without rustc (exit 1).