Isolating an LLVM bug when bootstrapping

Hello everyone,
I'm maintaining a downstream LLVM fork for an odd CPU architecture. Upgrading rustc from 1.71 to 1.72 exposes a bug somewhere in the rustc-llvm megapipeline leading to a crash in the LLVM globalisel backend. I have to fix this bug, so I have to reduce the code that causes the crash, and go stare at an IR dump for somewhere between hours to days. However when I take the failing rustc command and run it in my terminal, even though the command includes CARGO_ prefixed env vars, the build fails since the bootstrap-related env vars are unset.

rustc shim: fatal: RUSTC_STAGE was not set
rustc shim: note: use ` build -vvv` to see all environment variables set by bootstrap

Is there a way to run this single rustc invocation without this issue? Adding placeholders for the bootstrap env vars lead to errors about non-existent files etc.

Update: a colleague has patched the bug, so it's no longer urgent, but I still want to do a root cause analysis, and might run into harder bugs some time later

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.