Problem
The Native host build (macos-latest) job in .github/workflows/ci.yml consistently fails on the Build native addon step with:
Internal Error: cargo metadata exited with code 1 and error message:
error: error: unexpected argument 'metadata' found
This blocks merges on multiple open PRs (observed on #1128, #1119, etc.) without any code change being responsible.
Reproduction
Any push to a PR with native Rust changes triggers it. Examples:
Suspected cause
The macOS runner appears to resolve cargo to a binary that doesn't accept the metadata subcommand. Most likely culprit: the Install napi-rs CLI step installs a global napi binary, but somewhere in the path resolution a wrong cargo is picked up by Swatinem/rust-cache (which calls cargo metadata internally).
Suggested fix
Investigate PATH ordering on macOS runners; pin rust-cache and napi-rs versions; consider adding a debug step that runs which cargo && cargo --version before rust-cache.
Context
Filed during sweep of PR #1128. The PR itself has no Rust toolchain changes — the failure is environmental.
Problem
The
Native host build (macos-latest)job in.github/workflows/ci.ymlconsistently fails on theBuild native addonstep with:This blocks merges on multiple open PRs (observed on #1128, #1119, etc.) without any code change being responsible.
Reproduction
Any push to a PR with native Rust changes triggers it. Examples:
Suspected cause
The macOS runner appears to resolve
cargoto a binary that doesn't accept themetadatasubcommand. Most likely culprit: theInstall napi-rs CLIstep installs a globalnapibinary, but somewhere in the path resolution a wrongcargois picked up by Swatinem/rust-cache (which callscargo metadatainternally).Suggested fix
Investigate
PATHordering on macOS runners; pin rust-cache and napi-rs versions; consider adding a debug step that runswhich cargo && cargo --versionbefore rust-cache.Context
Filed during sweep of PR #1128. The PR itself has no Rust toolchain changes — the failure is environmental.