Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Csave-temps=on doesn't actually save anything #75275

Closed
infinity0 opened this issue Aug 8, 2020 · 5 comments · Fixed by #75315
Closed

-Csave-temps=on doesn't actually save anything #75275

infinity0 opened this issue Aug 8, 2020 · 5 comments · Fixed by #75315
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@infinity0
Copy link
Contributor

#42864 doesn't work. I need it to debug a linker failure, to re-run the linker command. But the tempdir isn't there even when I pass -Csave-temps=on.

@slo1 @Mark-Simulacrum

@infinity0
Copy link
Contributor Author

Work around:

$ cat binhack/x86_64-w64-mingw32-gcc
#!/bin/sh
/usr/bin/x86_64-w64-mingw32-gcc "$@"
x=$?
mkdir -p /tmp/savedrustc/
cp -a /tmp/rustc* /tmp/savedrustc/
exit $x

$ PATH=$PWD/binhack:$PATH sh test.sh
[..]

$ $ ls -gG /tmp/savedrustc/rustc34QKlf/
total 3388
-rw-r--r-- 1  233304 Aug  8 03:31 liballoc-62d18a8976d7c133.rlib
-rw-r--r-- 1  135158 Aug  8 03:31 libbacktrace-4ceb221c1451fd72.rlib
-rw-r--r-- 1  584318 Aug  8 03:31 libbacktrace_sys-5ac9ad0bd2943e4c.rlib
-rw-r--r-- 1    2150 Aug  8 03:31 libcfg_if-b787a80b1cca0552.rlib
-rw-r--r-- 1  484624 Aug  8 03:31 libcompiler_builtins-fa2917f0b54acfc4.rlib
-rw-r--r-- 1 1547472 Aug  8 03:31 libcore-bae6c7eaa8cff910.rlib
-rw-r--r-- 1   20156 Aug  8 03:31 libhashbrown-951231d947810b4e.rlib
-rw-r--r-- 1    9532 Aug  8 03:31 liblibc-3072b25f7851b3d1.rlib
-rw-r--r-- 1   38166 Aug  8 03:31 libpanic_unwind-9c93af3a21bf779f.rlib
-rw-r--r-- 1  182730 Aug  8 03:31 librustc_demangle-176970e988fbc465.rlib
-rw-r--r-- 1    2242 Aug  8 03:31 librustc_std_workspace_alloc-4397ecfaeb9d832e.rlib
-rw-r--r-- 1    2244 Aug  8 03:31 librustc_std_workspace_core-1b8ab73855770e4f.rlib
-rw-r--r-- 1    6702 Aug  8 03:31 libunwind-204b2abdb5f7ae9a.rlib
-rw-r--r-- 1  199457 Aug  8 03:31 list

@Mark-Simulacrum
Copy link
Member

Hm I am seeing the directory stick around at least, though on a trivial hello world file it is empty. I'm not sure yet if that's expected...

@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Aug 8, 2020
@infinity0
Copy link
Contributor Author

I also tried a hello-world example but when passing -Clink-arg=xxx to force a linker failure, didn't notice any "/tmp" paths in the command output, so assumed it didn't need temp files. You can probably trigger it by running RUSTFLAGS=-Clink-arg=xxx ./x.py build or something.

@infinity0
Copy link
Contributor Author

Ah, the problem possibly is that the directory is only saved when rustc doesn't fail.

@Mark-Simulacrum Mark-Simulacrum removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Aug 9, 2020
@Mark-Simulacrum
Copy link
Member

Hopefully this'll be fixed by #75315.

@bors bors closed this as completed in 992988b Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants