Symptom
The Build Native workflow's Build x86_64-apple-darwin matrix job (runs on macos-14) intermittently fails during the Build native addon step with:
Internal Error: cargo metadata exited with code 1 and error message:
error: error: unexpected argument 'metadata' found
Usage: rustup-init[EXE] [OPTIONS]
This indicates the cargo binary is resolving to rustup-init rather than the real Cargo from the stable toolchain. The macos-14 runner image is now ARM-only (macos-14-arm64), so dtolnay/rust-toolchain@stable is installing the host toolchain (aarch64-apple-darwin) and adding the x86_64 target via --target x86_64-apple-darwin.
Where
.github/workflows/build-native.yml — matrix entry os: macos-14, target: x86_64-apple-darwin.
Recent occurrences
Likely fix
- Switch
os for the x86_64-apple-darwin matrix entry back to an Intel-only image (e.g. macos-13), or
- Use a single
macos-latest entry that natively matches the target arch, or
- Disambiguate
cargo on PATH after the toolchain step (e.g. echo "$CARGO_HOME/bin" >> $GITHUB_PATH explicitly before napi build).
Context
Surfaced while clearing PR #1128 to a clean CI state. The failure is unrelated to the PR's diff (it reproduces on a fresh re-run with no code changes).
Symptom
The
Build Nativeworkflow'sBuild x86_64-apple-darwinmatrix job (runs onmacos-14) intermittently fails during theBuild native addonstep with:This indicates the
cargobinary is resolving torustup-initrather than the real Cargo from the stable toolchain. The macos-14 runner image is now ARM-only (macos-14-arm64), sodtolnay/rust-toolchain@stableis installing the host toolchain (aarch64-apple-darwin) and adding the x86_64 target via--target x86_64-apple-darwin.Where
.github/workflows/build-native.yml— matrix entryos: macos-14, target: x86_64-apple-darwin.Recent occurrences
Likely fix
osfor thex86_64-apple-darwinmatrix entry back to an Intel-only image (e.g.macos-13), ormacos-latestentry that natively matches the target arch, orcargoon PATH after the toolchain step (e.g.echo "$CARGO_HOME/bin" >> $GITHUB_PATHexplicitly beforenapi build).Context
Surfaced while clearing PR #1128 to a clean CI state. The failure is unrelated to the PR's diff (it reproduces on a fresh re-run with no code changes).