File fallback for an argument too long
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 748
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 21
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect sccache's rustc spawning path and compare it with Cargo's retry_with_argfile behavior. Reproduce the failure using an oversized --check-cfg argument that triggers E2BIG; done means sccache retries rustc with a temporary argument file and the compilation succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100