Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

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

@rustbot
Copy link
Collaborator

rustbot commented Apr 24, 2024

This PR modifies config.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 24, 2024
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");
Copy link
Member Author

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",
Copy link
Member Author

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",
Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @rust-lang/infra

Copy link
Member

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.

@rust-log-analyzer

This comment has been minimized.

@onur-ozkan onur-ozkan added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2024
@GuillaumeGomez
Copy link
Member Author

Applied suggestions!

@GuillaumeGomez
Copy link
Member Author

I asked some more information about how to retrieve the CI artifacts on zulip. Until then, PR is blocked.

@GuillaumeGomez GuillaumeGomez added the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants