fix(rust): inherit RUSTC_WRAPPER in runProcess instead of forcing empty string - #89
Open
nbomberger wants to merge 1 commit into
Open
fix(rust): inherit RUSTC_WRAPPER in runProcess instead of forcing empty string#89nbomberger wants to merge 1 commit into
nbomberger wants to merge 1 commit into
Conversation
Stop overriding RUSTC_WRAPPER with an empty string so Nx-spawned cargo can use compiler wrappers (e.g. sccache) from the parent environment.
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.
Summary
runProcesswas passingRUSTC_WRAPPER: ''intoexecSync, which overrides any value fromprocess.envand disables legitimate compiler wrappers (sccache, customrustcshims, etc.) for every Cargo invocation started through the Nx plugin.Change
Remove the
RUSTC_WRAPPERoverride 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 patchagainst@monodon/rust.Test plan
RUSTC_WRAPPER=sccachein the environment, run a Monodon-backednxRust target and confirm the wrapper is used (e.g. sccache statistics).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_WRAPPERfor users who set it intentionally.