rust-lang / rustc_codegen_gcc

libgccjit AOT codegen for rustc
Apache License 2.0
905 stars 60 forks source link

Honor `$RUSTUP_HOME` #413

Closed NCGThompson closed 7 months ago

NCGThompson commented 7 months ago

build_system/src/test.rs generates a config.toml that contains a path directly to (what should be) the appropriate rustc binary. However, it incorrectly assumed rustup stores the rustc binaries in ~/.rustup. In actuality, rustup first checks the environment variable RUSTUP_HOME, and defaults to ~/.rustup if the variable is not set. Now build_system/src/test.rs uses the correct path.

If there is a more idiomatic way to encode this please let me know and I'll fix it.

NCGThompson commented 7 months ago

Disclaimer: Some of the ui tests failed, but I wasn't able to run those tests before I made this change. Still diagnosing those.

bjorn3 commented 7 months ago

Maybe running rustup which rustc and using the output would be better? That returns the ground truth as used by rustup.

NCGThompson commented 7 months ago

Maybe running rustup which rustc and using the output would be better? That returns the ground truth as used by rustup.

Almost done. Should I squash/undo, or should I keep the commit history?

antoyo commented 7 months ago

Thanks for your contribution!