-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add support for downloading libgccjit.so
file
#124353
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ use build_helper::ci::CiEnv; | |
use build_helper::stage0_parser::VersionMetadata; | ||
use xz2::bufread::XzDecoder; | ||
|
||
use crate::utils::helpers::{check_run, exe, move_file, program_out_of_date}; | ||
use crate::utils::helpers::{check_run, detect_gccjit_sha, exe, move_file, program_out_of_date}; | ||
use crate::{core::build_steps::llvm::detect_llvm_sha, utils::helpers::hex_encode}; | ||
use crate::{t, Config}; | ||
|
||
|
@@ -229,7 +229,7 @@ impl Config { | |
tempfile.to_str().unwrap(), | ||
"--retry", | ||
"3", | ||
"-SRf", | ||
"-SRfL", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new option |
||
]); | ||
// Don't print progress in CI; the \r wrapping looks bad and downloads don't take long enough for progress to be useful. | ||
if CiEnv::is_ci() { | ||
|
@@ -742,6 +742,38 @@ download-rustc = false | |
let llvm_root = self.ci_llvm_root(); | ||
self.unpack(&tarball, &llvm_root, "rust-dev"); | ||
} | ||
|
||
pub(crate) fn maybe_download_gccjit(&self) { | ||
if !self.gcc_download_gccjit { | ||
return; | ||
} | ||
self.download_gccjit(&detect_gccjit_sha()); | ||
} | ||
|
||
fn download_gccjit(&self, gcc_sha: &str) { | ||
let help_on_error = "ERROR: failed to download libgccjit | ||
|
||
HELP: There could be two reasons behind this: | ||
1) The host triple is not supported for `download-gccjit`. | ||
2) Old builds get deleted after a certain time. | ||
"; | ||
if !self.build.triple.contains("linux") || !self.build.triple.contains("x86_64") { | ||
eprintln!("{help_on_error}"); | ||
return; | ||
} | ||
let rustc_cache = self.libgccjit_folder(gcc_sha); | ||
if !rustc_cache.exists() { | ||
t!(fs::create_dir_all(&rustc_cache)); | ||
} | ||
|
||
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 commentThe 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 commentThe 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 commentThe 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. |
||
); | ||
self.download_file(&url, &lib_path, help_on_error); | ||
} | ||
} | ||
} | ||
|
||
fn path_is_dylib(path: &Path) -> bool { | ||
|
Uh oh!
There was an error while loading. Please reload this page.