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 `x.py 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.