Skip to content

fix(rust): inherit RUSTC_WRAPPER in runProcess instead of forcing empty string - #89

Open
nbomberger wants to merge 1 commit into
Cammisuli:mainfrom
nbomberger:fix/inherit-rustc-wrapper
Open

fix(rust): inherit RUSTC_WRAPPER in runProcess instead of forcing empty string#89
nbomberger wants to merge 1 commit into
Cammisuli:mainfrom
nbomberger:fix/inherit-rustc-wrapper

Conversation

@nbomberger

Copy link
Copy Markdown

Summary

runProcess was passing RUSTC_WRAPPER: '' into execSync, which overrides any value from process.env and disables legitimate compiler wrappers (sccache, custom rustc shims, etc.) for every Cargo invocation started through the Nx plugin.

Change

Remove the RUSTC_WRAPPER override so spawned processes inherit the parent environment.

Context

Found by Nate Bomberger while integrating Nx + Rust + sccache at Smash / najabu — wrapper was effectively stripped on every Monodon-driven build. The same one-line fix is validated in our monorepo via pnpm patch against @monodon/rust.

Test plan

  • With RUSTC_WRAPPER=sccache in the environment, run a Monodon-backed nx Rust target and confirm the wrapper is used (e.g. sccache statistics).
  • Workspace nx run-many / CI still passes for this repo.

Note

If this line existed for a historical edge case, an alternative would be an opt-in env var to clear the wrapper; the default should preserve RUSTC_WRAPPER for users who set it intentionally.

Stop overriding RUSTC_WRAPPER with an empty string so Nx-spawned cargo
can use compiler wrappers (e.g. sccache) from the parent environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant