You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: in a very particular set of circumstances, sccache might get an argument so long it can't be passed over the command line.
I've ran into a weird issue. There's an external dependency with 3K+ features, which cargo passes as a single --check-cfg argument to rustc. Linux per-argument limit is 32x PAGE_SIZE, 128kb on my machine. Well, that long argument happened to cross that line.
cargo has a retry_with_argfile fallback for that, writing a tempfile and passing it as rustc @tempfile when it faces E2BIG, but sccache doesn't. It would be really nice if it did.
The ask is for sccache to implement cargo's E2BIG -> @tmpfile retry when spawning rustc
If this error happens, shouldn't sccache just propagate the error in the same way rustc normally would, and then Cargo would retry it with an argfile? Sccache gained support for reading argfiles recently.
@Kobzol sccache expands argfiles and passes that down as a list of arguments. Would it be enough to use expanded args for cache key but pass down the original argfile?
That's a move in the right direction, but that PR sets the threshold on Linux to 1MB. Which makes sense for all args combined, but the issue in question is just one arg - and a single arg limit on Linux is 32 page sizes, ~128kb on most systems. Is it possible to lower the threshold to 128K (or even a little less)?
// I'll test this tomorrow morning and submit a PR if it works
Activity
Kobzol commentedon Aug 19, 2026
If this error happens, shouldn't sccache just propagate the error in the same way rustc normally would, and then Cargo would retry it with an argfile? Sccache gained support for reading argfiles recently.
user2589 commentedon Aug 19, 2026
@Kobzol sccache expands argfiles and passes that down as a list of arguments. Would it be enough to use expanded args for cache key but pass down the original argfile?
Kobzol commentedon Aug 20, 2026
I think so, #2789 implements that.
user2589 commentedon Aug 20, 2026
That's a move in the right direction, but that PR sets the threshold on Linux to 1MB. Which makes sense for all args combined, but the issue in question is just one arg - and a single arg limit on Linux is 32 page sizes, ~128kb on most systems. Is it possible to lower the threshold to 128K (or even a little less)?
// I'll test this tomorrow morning and submit a PR if it works
user2589 commentedon Aug 20, 2026
@Kobzol I tested that PR with a lower threshold and it fixes this issue. Left a comment there, looking forward for it to be merged and released