New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for downloading libgccjit.so
file
#124353
base: master
Are you sure you want to change the base?
Conversation
This PR modifies If appropriate, please update This PR modifies If appropriate, please update Some changes occurred in compiler/rustc_codegen_gcc |
pub(crate) fn detect_gccjit_sha() -> String { | ||
// FIXME: This is absolutely ugly. Please find another way to do that. | ||
let content = | ||
include_str!("../../../../ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that putting it into a version file would be better since it would mean that we'd need to copy this file in all Dockerfiles using gcc backend. However it's a possibility, maybe less bad than the current one. No preference on my side.
@@ -229,7 +232,7 @@ impl Config { | |||
tempfile.to_str().unwrap(), | |||
"--retry", | |||
"3", | |||
"-SRf", | |||
"-SRfL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new option -L
is because the current download link needs to follow a redirection for some reasons...
let lib_path = rustc_cache.join("libgccjit.so.0"); | ||
if !lib_path.exists() { | ||
let url = format!( | ||
"https://github.com/rust-lang/gcc/releases/download/master-{gcc_sha}/libgccjit.so", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I picked this one because I don't know if relying on github CI artifacts is better or worse. If someone from the infra team has guidance there or an opinion, it'd be very helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @rust-lang/infra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that this would be implemented in the same way we implemented LLVM: a component shipped with every commit built on master of rust-lang/rust and a download of that component. This looks like it's using a pretty different approach, I would prefer to keep things consistent if we can.
This comment has been minimized.
This comment has been minimized.
… build it yourself
6332003
to
c1d9382
Compare
Applied suggestions! |
I asked some more information about how to retrieve the CI artifacts on zulip. Until then, PR is blocked. |
It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler.
Should help with #124172.
r? @onur-ozkan