Don't ignore git for LLVM info
This commit is contained in:
parent
105692c3ad
commit
49b65e683d
3 changed files with 22 additions and 19 deletions
|
@ -11,7 +11,6 @@ use std::process::Command;
|
||||||
use build_helper::output;
|
use build_helper::output;
|
||||||
|
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::config::Config;
|
|
||||||
|
|
||||||
// The version number
|
// The version number
|
||||||
pub const CFG_RELEASE_NUM: &str = "1.35.0";
|
pub const CFG_RELEASE_NUM: &str = "1.35.0";
|
||||||
|
@ -27,20 +26,20 @@ struct Info {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GitInfo {
|
impl GitInfo {
|
||||||
pub fn new(config: &Config, dir: &Path) -> GitInfo {
|
pub fn new(ignore_git: bool, dir: &Path) -> GitInfo {
|
||||||
// See if this even begins to look like a git dir
|
// See if this even begins to look like a git dir
|
||||||
if config.ignore_git || !dir.join(".git").exists() {
|
if ignore_git || !dir.join(".git").exists() {
|
||||||
return GitInfo { inner: None }
|
return GitInfo { inner: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure git commands work
|
// Make sure git commands work
|
||||||
let out = Command::new("git")
|
match Command::new("git")
|
||||||
.arg("rev-parse")
|
.arg("rev-parse")
|
||||||
.current_dir(dir)
|
.current_dir(dir)
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to spawn git");
|
{
|
||||||
if !out.status.success() {
|
Ok(ref out) if out.status.success() => {}
|
||||||
return GitInfo { inner: None }
|
_ => return GitInfo { inner: None },
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ok, let's scrape some info
|
// Ok, let's scrape some info
|
||||||
|
|
|
@ -360,14 +360,18 @@ impl Build {
|
||||||
}
|
}
|
||||||
None => false,
|
None => false,
|
||||||
};
|
};
|
||||||
let rust_info = channel::GitInfo::new(&config, &src);
|
|
||||||
let cargo_info = channel::GitInfo::new(&config, &src.join("src/tools/cargo"));
|
let ignore_git = config.ignore_git;
|
||||||
let rls_info = channel::GitInfo::new(&config, &src.join("src/tools/rls"));
|
let rust_info = channel::GitInfo::new(ignore_git, &src);
|
||||||
let clippy_info = channel::GitInfo::new(&config, &src.join("src/tools/clippy"));
|
let cargo_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/cargo"));
|
||||||
let miri_info = channel::GitInfo::new(&config, &src.join("src/tools/miri"));
|
let rls_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/rls"));
|
||||||
let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt"));
|
let clippy_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/clippy"));
|
||||||
let in_tree_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-project"));
|
let miri_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/miri"));
|
||||||
let emscripten_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-emscripten"));
|
let rustfmt_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/rustfmt"));
|
||||||
|
|
||||||
|
// we always try to use git for LLVM builds
|
||||||
|
let in_tree_llvm_info = channel::GitInfo::new(false, &src.join("src/llvm-project"));
|
||||||
|
let emscripten_llvm_info = channel::GitInfo::new(false, &src.join("src/llvm-emscripten"));
|
||||||
|
|
||||||
let mut build = Build {
|
let mut build = Build {
|
||||||
initial_rustc: config.initial_rustc.clone(),
|
initial_rustc: config.initial_rustc.clone(),
|
||||||
|
|
|
@ -235,7 +235,7 @@ pub fn prepare_tool_cargo(
|
||||||
cargo.env("CFG_VERSION", builder.rust_version());
|
cargo.env("CFG_VERSION", builder.rust_version());
|
||||||
cargo.env("CFG_RELEASE_NUM", channel::CFG_RELEASE_NUM);
|
cargo.env("CFG_RELEASE_NUM", channel::CFG_RELEASE_NUM);
|
||||||
|
|
||||||
let info = GitInfo::new(&builder.config, &dir);
|
let info = GitInfo::new(builder.config.ignore_git, &dir);
|
||||||
if let Some(sha) = info.sha() {
|
if let Some(sha) = info.sha() {
|
||||||
cargo.env("CFG_COMMIT_HASH", sha);
|
cargo.env("CFG_COMMIT_HASH", sha);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue