-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Description
In most places in the compiler temporary files are written to the output directory (using tempdir_in
). E.g.:
rust/compiler/rustc_metadata/src/fs.rs
Lines 48 to 50 in 15c4cce
let metadata_tmpdir = TempFileBuilder::new() | |
.prefix("rmeta") | |
.tempdir_in(out_filename.parent().unwrap_or_else(|| Path::new(""))) |
rust/compiler/rustc_codegen_ssa/src/back/archive.rs
Lines 504 to 506 in 15c4cce
let archive_tmpdir = TempFileBuilder::new() | |
.suffix(".temp-archive") | |
.tempdir_in(output.parent().unwrap_or_else(|| Path::new(""))) |
The one exception is compiler/rustc_codegen_ssa/src/back/link.rs
which writes to the OS temp directory (note the use of tempdir
instead of tempdir_in
):
rust/compiler/rustc_codegen_ssa/src/back/link.rs
Lines 103 to 105 in 15c4cce
let tmpdir = TempFileBuilder::new() | |
.prefix("rustc") | |
.tempdir() |
I don't think there is a good reason to maintain this inconsistency?
Note that this affects -C save-temps
where you have to go hunting for the relevant temp file (or redirect the platform-specific temp directory environment variable).