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:

  1. The IR pane will show ‘Failed to run compiler to get IR code’: image

  2. 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) image

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

Most upvoted comments

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-filename seems 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