mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #130383 - onur-ozkan:ignore-llvm-changes-on-ci-llvm-true, r=Mark-Simulacrum
check if it's rust-lang/rust CI job in `llvm::is_ci_llvm_modified` Changes `llvm::is_ci_llvm_modified` to only work on rust-lang/rust managed CI.
This commit is contained in:
commit
f39101a5f6
@ -242,7 +242,7 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
|
||||
|
||||
/// Returns true if we're running in CI with modified LLVM (and thus can't download it)
|
||||
pub(crate) fn is_ci_llvm_modified(config: &Config) -> bool {
|
||||
CiEnv::is_ci() && config.rust_info.is_managed_git_subrepository() && {
|
||||
CiEnv::is_rust_lang_managed_ci_job() && config.rust_info.is_managed_git_subrepository() && {
|
||||
// We assume we have access to git, so it's okay to unconditionally pass
|
||||
// `true` here.
|
||||
let llvm_sha = detect_llvm_sha(config, true);
|
||||
|
@ -343,6 +343,15 @@ pub struct Config {
|
||||
pub out: PathBuf,
|
||||
pub rust_info: channel::GitInfo,
|
||||
|
||||
pub cargo_info: channel::GitInfo,
|
||||
pub rust_analyzer_info: channel::GitInfo,
|
||||
pub clippy_info: channel::GitInfo,
|
||||
pub miri_info: channel::GitInfo,
|
||||
pub rustfmt_info: channel::GitInfo,
|
||||
pub enzyme_info: channel::GitInfo,
|
||||
pub in_tree_llvm_info: channel::GitInfo,
|
||||
pub in_tree_gcc_info: channel::GitInfo,
|
||||
|
||||
// These are either the stage0 downloaded binaries or the locally installed ones.
|
||||
pub initial_cargo: PathBuf,
|
||||
pub initial_rustc: PathBuf,
|
||||
@ -1796,6 +1805,19 @@ impl Config {
|
||||
config.omit_git_hash = omit_git_hash.unwrap_or(default);
|
||||
config.rust_info = GitInfo::new(config.omit_git_hash, &config.src);
|
||||
|
||||
config.cargo_info = GitInfo::new(config.omit_git_hash, &config.src.join("src/tools/cargo"));
|
||||
config.rust_analyzer_info =
|
||||
GitInfo::new(config.omit_git_hash, &config.src.join("src/tools/rust-analyzer"));
|
||||
config.clippy_info =
|
||||
GitInfo::new(config.omit_git_hash, &config.src.join("src/tools/clippy"));
|
||||
config.miri_info = GitInfo::new(config.omit_git_hash, &config.src.join("src/tools/miri"));
|
||||
config.rustfmt_info =
|
||||
GitInfo::new(config.omit_git_hash, &config.src.join("src/tools/rustfmt"));
|
||||
config.enzyme_info =
|
||||
GitInfo::new(config.omit_git_hash, &config.src.join("src/tools/enzyme"));
|
||||
config.in_tree_llvm_info = GitInfo::new(false, &config.src.join("src/llvm-project"));
|
||||
config.in_tree_gcc_info = GitInfo::new(false, &config.src.join("src/gcc"));
|
||||
|
||||
// We need to override `rust.channel` if it's manually specified when using the CI rustc.
|
||||
// This is because if the compiler uses a different channel than the one specified in config.toml,
|
||||
// tests may fail due to using a different channel than the one used by the compiler during tests.
|
||||
|
@ -305,18 +305,15 @@ impl Build {
|
||||
#[cfg(not(unix))]
|
||||
let is_sudo = false;
|
||||
|
||||
let omit_git_hash = config.omit_git_hash;
|
||||
let rust_info = GitInfo::new(omit_git_hash, &src);
|
||||
let cargo_info = GitInfo::new(omit_git_hash, &src.join("src/tools/cargo"));
|
||||
let rust_analyzer_info = GitInfo::new(omit_git_hash, &src.join("src/tools/rust-analyzer"));
|
||||
let clippy_info = GitInfo::new(omit_git_hash, &src.join("src/tools/clippy"));
|
||||
let miri_info = GitInfo::new(omit_git_hash, &src.join("src/tools/miri"));
|
||||
let rustfmt_info = GitInfo::new(omit_git_hash, &src.join("src/tools/rustfmt"));
|
||||
let enzyme_info = GitInfo::new(omit_git_hash, &src.join("src/tools/enzyme"));
|
||||
|
||||
// we always try to use git for LLVM builds
|
||||
let in_tree_llvm_info = GitInfo::new(false, &src.join("src/llvm-project"));
|
||||
let in_tree_gcc_info = GitInfo::new(false, &src.join("src/gcc"));
|
||||
let rust_info = config.rust_info.clone();
|
||||
let cargo_info = config.cargo_info.clone();
|
||||
let rust_analyzer_info = config.rust_analyzer_info.clone();
|
||||
let clippy_info = config.clippy_info.clone();
|
||||
let miri_info = config.miri_info.clone();
|
||||
let rustfmt_info = config.rustfmt_info.clone();
|
||||
let enzyme_info = config.enzyme_info.clone();
|
||||
let in_tree_llvm_info = config.in_tree_llvm_info.clone();
|
||||
let in_tree_gcc_info = config.in_tree_gcc_info.clone();
|
||||
|
||||
let initial_target_libdir_str = if config.dry_run() {
|
||||
"/dummy/lib/path/to/lib/".to_string()
|
||||
|
@ -19,6 +19,15 @@ impl CiEnv {
|
||||
pub fn is_ci() -> bool {
|
||||
Self::current() != CiEnv::None
|
||||
}
|
||||
|
||||
/// Checks if running in rust-lang/rust managed CI job.
|
||||
pub fn is_rust_lang_managed_ci_job() -> bool {
|
||||
Self::is_ci()
|
||||
// If both are present, we can assume it's an upstream CI job
|
||||
// as they are always set unconditionally.
|
||||
&& std::env::var_os("CI_JOB_NAME").is_some()
|
||||
&& std::env::var_os("TOOLSTATE_REPO").is_some()
|
||||
}
|
||||
}
|
||||
|
||||
pub mod gha {
|
||||
|
Loading…
Reference in New Issue
Block a user