-
Notifications
You must be signed in to change notification settings - Fork 13k
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
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.
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. |
☔ The latest upstream changes (presumably #124883) made this pull request unmergeable. Please resolve the merge conflicts. |
c1d9382
to
fa6f805
Compare
This comment has been minimized.
This comment has been minimized.
… build it yourself
fa6f805
to
6af0a39
Compare
☔ The latest upstream changes (presumably #125515) made this pull request unmergeable. Please resolve the merge conflicts. |
[bootstrap] Add gcc to dist generation As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
[bootstrap] Add gcc to dist generation As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
[bootstrap] Add gcc to dist generation As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
…bzol [bootstrap] Add support for building gcc and libgccjit As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
…bzol [bootstrap] Add support for building gcc and libgccjit As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
…bzol [bootstrap] Add support for building gcc and libgccjit As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
We are taking a different direction: we are now building GCC artifacts in Rust's CI (since #125419), so we are planning to download them the same way we download LLVM's. Meaning this PR can be closed. |
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