fix(publish): warm up rustup + prepend cargo bin to PATH on macos-15-arm64#442
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes macOS publish failures caused by a broken /usr/local/bin/cargo shim winning in PATH on macos-15-arm64 by warming up rustup and ensuring the real cargo is used.
Changes:
- Add a non-Linux verification step that sets/warms rustup toolchain and adjusts
PATHordering. - Add debug logging (
which cargo,cargo --version) to make future PATH/toolchain regressions visible.
| if: matrix.os != 'ubuntu-latest' | ||
| run: | | ||
| rustup show active-toolchain || rustup default stable | ||
| echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> "$GITHUB_PATH" |
Comment on lines
+52
to
+57
| if: matrix.os != 'ubuntu-latest' | ||
| run: | | ||
| rustup show active-toolchain || rustup default stable | ||
| echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> "$GITHUB_PATH" | ||
| which cargo | ||
| cargo --version |
Comment on lines
+48
to
+50
| # `rustup show` warms up the rustup default and prepending | ||
| # CARGO_HOME/bin guarantees we hit the real cargo binary in | ||
| # subsequent steps. No-op on linux/windows. |
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: 304bbe1 | Previous: 0b5fe57 | Ratio |
|---|---|---|---|
git_changed_files/100 |
77491 ns/iter (± 400) |
||
git_changed_files/1000 |
634896 ns/iter (± 6014) |
This comment was automatically generated by workflow using github-action-benchmark.
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.
v4.7.5 Publish failed with
unexpected argument 'build' found / Usage: rustup-initon the macOS build steps. macos-15-arm64 ships with acargoshim at /usr/local/bin/cargo that delegates to rustup-init when no managed toolchain is set; the dtolnay action installs into ~/.cargo but PATH ordering can leave the broken shim winning. Fix: explicitrustup default stablewarmup + prepend /bin to GITHUB_PATH for non-Linux builds, plus a debugwhich cargo / cargo --versionto make this kind of regression visible in logs.