More principled tempdir usage by and between rustc, rustdoc and compiletest
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
"Specifically, it's somewhere here: https://github.com/rust-lang/rust/blob/cbfdf0b014cb04982a9cbeec1578001001167f6e/compiler/rustc_codegen_ssa/src/back/link.rs#L102-L107
"but yeah, in any case, we probably should override that, to point it under build/test/$test_suite_name/$test_suite_revisioned_compare_moded/__temp/
"(E.g. by setting TMP_DIR/TEMP/TMP or whatever the env vars were called)
"Can you open an E-needs-investigation issue?" ~ @jieyouxu https://discord.com/channels/273534239310479360/957720175619215380/1349912066772963469
Spotted in https://github.com/rust-lang/rust/pull/138157#issuecomment-2723020993, the bors job failed with
--- stderr -------------------------------
error: couldn't create a temp dir: Access is denied. (os error 5) at path "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcfzdxGW"
error: aborting due to 1 previous error
It would be nice if those stayed in the build/target directory, which is more likely to have a defender exclusion (and thus more likely to not have that access error). It would also be helpful to stay on the Dev Drive on Windows 11 if people have that set up, rather than use C: which typically has the most extra filesystem access costs (from filters and such).
And it'd just be nice not to have a bazillion of these left over after running tests a bunch :)
Contributor guide
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
Start at compiler/rustc_codegen_ssa/src/back/link.rs around lines 102-107, then inspect how rustc, rustdoc, and compiletest choose temporary directories. Compare the current temporary paths with the requested build/test/$test_suite_name/$test_suite_revisioned_compare_moded/__temp/ layout and the relevant Windows environment variables. Done means test-created temporary directories stay within the build or target tree and the affected test workflows still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, compilers, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100