Skip to content
14 changes: 14 additions & 0 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ jobs:
with:
targets: ${{ matrix.target }}

- name: Verify cargo resolves to rustup proxy (macOS shim workaround)
if: runner.os == 'macOS'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Condition covers all macOS runners, not just macos-14

runner.os == 'macOS' also matches the macos-latest / aarch64-apple-darwin matrix entry, so the PATH fixup runs for the native ARM build too. This is harmless and arguably a safety net, but the step name ("macos-14 shim workaround") and the PR description ("specifically for macos-14") are slightly misleading. If the intent is to guard only the known-broken matrix entry you could use matrix.os == 'macos-14' instead. The same applies to publish.yml.

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 6680ffe — renamed the step to "macOS shim workaround" and updated the comment to note that the workaround intentionally applies to all macOS matrix entries. Issue #1136 also recorded an aarch64-apple-darwin occurrence (PR #1127 run), so keeping the broader runner.os == 'macOS' guard is the right call as a safety net rather than narrowing to matrix.os == 'macos-14'. The step/comment wording now matches that intent.

shell: bash
run: |
# macOS runners (most often `macos-14` ARM, but also observed on
# `macos-latest`/aarch64 builds — see #1136) intermittently expose
# a stale `cargo` on PATH that resolves to `rustup-init`, breaking
# `cargo metadata` invocations from napi-rs. Force the rustup
# proxy bin dir to the front of PATH and fail fast if cargo is
# unhealthy. Applied to all macOS matrix entries as a safety net.
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
"$HOME/.cargo/bin/cargo" --version
"$HOME/.cargo/bin/rustc" --version

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ jobs:
with:
targets: ${{ matrix.target }}

- name: Verify cargo resolves to rustup proxy (macOS shim workaround)
if: runner.os == 'macOS'
shell: bash
run: |
# macOS runners (most often `macos-14` ARM, but also observed on
# `macos-latest`/aarch64 builds — see #1136) intermittently expose
# a stale `cargo` on PATH that resolves to `rustup-init`, breaking
# `cargo metadata` invocations from napi-rs. Force the rustup
# proxy bin dir to the front of PATH and fail fast if cargo is
# unhealthy. Applied to all macOS matrix entries as a safety net.
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
"$HOME/.cargo/bin/cargo" --version
"$HOME/.cargo/bin/rustc" --version

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
Expand Down
Loading