compiler-explorer: [BUG]: In rustc, LLVM-IR pane + `--emit llvm-ir` clash sporadically
Describe the bug
If you select any rustc compiler, open an LLVM-IR pane and add --emit llvm-ir to the compiler switches, after several re-builds one of two things can happen:
-
The IR pane will show ‘Failed to run compiler to get IR code’:
-
The compiler pane will show ‘<Compilation failed>’ and the output pane will show something like:
error: could not copy "/app/output.example.b75e7786252e4c9a-cgu.0.rcgu.ll" to "/app/output.s": No such file or directory (os error 2)
First mentioned in #6996.
Steps to reproduce
https://godbolt.org/z/cfPGsvTTc
Rebuild a few times
Expected behavior
Both panes should show good results. AFAICT this is what happens for clang.
Reproduction link
Not applicable
Screenshots
Not applicable
Operating System
No response
Browser version
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (14 by maintainers)
Commits related to this issue
- Potential fix for #7012 — committed to compiler-explorer/compiler-explorer by mattgodbolt 2 years ago
- Separate filenames for llvm IR in rust Rust compilers output to fixed-named intermediate files. When running a regular compiler with `--emit-llvm` _and_ an IR view on the same source, the outputs fig... — committed to compiler-explorer/compiler-explorer by mattgodbolt 2 years ago
- Separate filenames for llvm IR in rust (#7171) Rust compilers output to fixed-named intermediate files. When running a regular compiler with `--emit-llvm` _and_ an IR view on the same source, the o... — committed to compiler-explorer/compiler-explorer by mattgodbolt 2 years ago
- Separate filenames for llvm IR in rust (#7171) Rust compilers output to fixed-named intermediate files. When running a regular compiler with `--emit-llvm` _and_ an IR view on the same source, the o... — committed to faramozzayw/compiler-explorer by mattgodbolt 2 years ago
And thank you for making this really useful tool!
Thank you so much for your time and help in this @bjorn3!
Codegen shouldn’t be affected by
-Cextra-filename. The only place where it changes output should be in the crate metadata, which isn’t used anywhere by compiler explorer anyway. Using-Cextra-filenameseems like a good solution to me.So…interestingly: /app/output.example.b75e7786252e4c9a-cgu.0.rcgu.ll i wonder if rust uses the same internal temporary filename then copies it to the output then removes it and so two concurrent rust compilations that emit llvm will stomp each other