Use response files when spawning rustc commands when needed - #2789
Open
ranger-ross wants to merge 1 commit into
Open
Use response files when spawning rustc commands when needed#2789ranger-ross wants to merge 1 commit into
ranger-ross wants to merge 1 commit into
Conversation
ranger-ross
commented
Aug 1, 2026
Comment on lines
+1128
to
+1138
| // On Windows there is a hard limit of ~32KB, so we cut off at 30KB to | ||
| // give some buffer just incase. | ||
| #[cfg(windows)] | ||
| let threshold: usize = 30 * 1024; | ||
| // On unix the limit is defined by ARG_MAX. If its not explicitly set we set it to 1MB | ||
| // which is fairly large but lower than the ~2MB that it defaults to on most systems. | ||
| #[cfg(unix)] | ||
| let threshold: usize = std::env::var("ARG_MAX") | ||
| .ok() | ||
| .and_then(|v| v.parse().ok()) | ||
| .unwrap_or(1024 * 1024); |
Contributor
Author
There was a problem hiding this comment.
Took these thresholds from rustc, see
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2789 +/- ##
==========================================
- Coverage 74.32% 74.31% -0.02%
==========================================
Files 72 72
Lines 40772 40821 +49
==========================================
+ Hits 30305 30336 +31
- Misses 10467 10485 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
CI failures should be unrelated to this change. |
ranger-ross
force-pushed
the
fix-arg-files
branch
from
August 3, 2026 17:38
c24a906 to
e02a9e9
Compare
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.
This is a follow up on #2782.
Unfortunately, I overlooked the fact that sccache modifies the args and does not pass the exact args to rustc that it receives.
This leads to the expanded args getting passed to rustc which blows up on windows when the command is large enough.
The solution is to have sccache create its own arg file (when needed) to pass the args to rustc.
fixes #2787
(I tested the repo in question and it fails without these changes and builds successfully with them)