fix: change the way to decide whether there's a RUSTC_WORKSPACE_WRAPPER#2408
Open
BugenZhao wants to merge 2 commits intomozilla:mainfrom
Open
fix: change the way to decide whether there's a RUSTC_WORKSPACE_WRAPPER#2408BugenZhao wants to merge 2 commits intomozilla:mainfrom
RUSTC_WORKSPACE_WRAPPER#2408BugenZhao wants to merge 2 commits intomozilla:mainfrom
Conversation
Collaborator
|
please add tests to make sure we don't regress in the future |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2408 +/- ##
=======================================
Coverage 71.18% 71.18%
=======================================
Files 64 64
Lines 35592 35594 +2
=======================================
+ Hits 25335 25338 +3
+ Misses 10257 10256 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bb6ff20 to
d866e36
Compare
d866e36 to
6b96f06
Compare
…PER` Signed-off-by: Bugen Zhao <[email protected]>
6b96f06 to
23d093d
Compare
tottoto
pushed a commit
to tottoto/sccache
that referenced
this pull request
Feb 6, 2026
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.
#1280 added support for locating the
rustcbinary when there's a workspace wrapper set viaRUSTC_WORKSPACE_WRAPPER. A check on the existence of env varCARGOwas included as a guardrail against false positives.However, this doesn't seem to always work. In my reproduction at https://github.com/bugenzhao/sccache-wrapper-reproduce, it seems that the environment variable
CARGOis not set whencargoattempts to detect the compiler as its initial step:https://github.com/rust-lang/cargo/blob/2251525ae503fa196f6d7f9ce6d32eccb2d5f044/src/cargo/util/rustc.rs#L62-L66
As a result, we fail to decide the
maybe_rustc_executableand eventually run into the testing of C compiler:This PR attempts to fix this by directly checking whether
RUSTC_WORKSPACE_WRAPPERis set.