mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
Auto merge of #40383 - ishitatsuyuki:easy-dist-analysis, r=alexcrichton
rustbuild: Make save-analysis an option This makes save-analysis an option independent from the release channel. The CI build scripts have been modified to enable the flag. *Merge with caution.* I haven't tested this, and this can cause nightly breakage.
This commit is contained in:
commit
0aeb9c1297
1
configure
vendored
1
configure
vendored
@ -445,6 +445,7 @@ opt dist-host-only 0 "only install bins for the host architecture"
|
|||||||
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
|
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
|
||||||
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
|
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
|
||||||
opt codegen-tests 1 "run the src/test/codegen tests"
|
opt codegen-tests 1 "run the src/test/codegen tests"
|
||||||
|
opt save-analysis 0 "save API analysis data"
|
||||||
opt option-checking 1 "complain about unrecognized options in this configure script"
|
opt option-checking 1 "complain about unrecognized options in this configure script"
|
||||||
opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
|
opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
|
||||||
opt locked-deps 0 "force Cargo.lock to be up to date"
|
opt locked-deps 0 "force Cargo.lock to be up to date"
|
||||||
|
@ -74,6 +74,7 @@ pub struct Config {
|
|||||||
pub rustc_default_ar: Option<String>,
|
pub rustc_default_ar: Option<String>,
|
||||||
pub rust_optimize_tests: bool,
|
pub rust_optimize_tests: bool,
|
||||||
pub rust_debuginfo_tests: bool,
|
pub rust_debuginfo_tests: bool,
|
||||||
|
pub rust_save_analysis: bool,
|
||||||
pub rust_dist_src: bool,
|
pub rust_dist_src: bool,
|
||||||
|
|
||||||
pub build: String,
|
pub build: String,
|
||||||
@ -225,6 +226,7 @@ struct Rust {
|
|||||||
optimize_tests: Option<bool>,
|
optimize_tests: Option<bool>,
|
||||||
debuginfo_tests: Option<bool>,
|
debuginfo_tests: Option<bool>,
|
||||||
codegen_tests: Option<bool>,
|
codegen_tests: Option<bool>,
|
||||||
|
save_analysis: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TOML representation of how each build target is configured.
|
/// TOML representation of how each build target is configured.
|
||||||
@ -350,6 +352,7 @@ impl Config {
|
|||||||
set(&mut config.rust_optimize_tests, rust.optimize_tests);
|
set(&mut config.rust_optimize_tests, rust.optimize_tests);
|
||||||
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
|
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
|
||||||
set(&mut config.codegen_tests, rust.codegen_tests);
|
set(&mut config.codegen_tests, rust.codegen_tests);
|
||||||
|
set(&mut config.rust_save_analysis, rust.save_analysis);
|
||||||
set(&mut config.rust_rpath, rust.rpath);
|
set(&mut config.rust_rpath, rust.rpath);
|
||||||
set(&mut config.debug_jemalloc, rust.debug_jemalloc);
|
set(&mut config.debug_jemalloc, rust.debug_jemalloc);
|
||||||
set(&mut config.use_jemalloc, rust.use_jemalloc);
|
set(&mut config.use_jemalloc, rust.use_jemalloc);
|
||||||
@ -457,6 +460,7 @@ impl Config {
|
|||||||
("LOCAL_REBUILD", self.local_rebuild),
|
("LOCAL_REBUILD", self.local_rebuild),
|
||||||
("NINJA", self.ninja),
|
("NINJA", self.ninja),
|
||||||
("CODEGEN_TESTS", self.codegen_tests),
|
("CODEGEN_TESTS", self.codegen_tests),
|
||||||
|
("SAVE_ANALYSIS", self.rust_save_analysis),
|
||||||
("LOCKED_DEPS", self.locked_deps),
|
("LOCKED_DEPS", self.locked_deps),
|
||||||
("VENDOR", self.vendor),
|
("VENDOR", self.vendor),
|
||||||
("FULL_BOOTSTRAP", self.full_bootstrap),
|
("FULL_BOOTSTRAP", self.full_bootstrap),
|
||||||
|
@ -234,6 +234,9 @@
|
|||||||
# saying that the FileCheck executable is missing, you may want to disable this.
|
# saying that the FileCheck executable is missing, you may want to disable this.
|
||||||
#codegen-tests = true
|
#codegen-tests = true
|
||||||
|
|
||||||
|
# Flag indicating whether the API analysis data should be saved.
|
||||||
|
#save-analysis = false
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Options for specific targets
|
# Options for specific targets
|
||||||
#
|
#
|
||||||
|
@ -311,18 +311,14 @@ pub fn rust_src_location(build: &Build) -> PathBuf {
|
|||||||
|
|
||||||
/// Creates a tarball of save-analysis metadata, if available.
|
/// Creates a tarball of save-analysis metadata, if available.
|
||||||
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
|
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
|
||||||
println!("Dist analysis");
|
if !build.config.rust_save_analysis {
|
||||||
|
|
||||||
if build.config.channel != "nightly" {
|
|
||||||
println!("\tskipping - not on nightly channel");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if compiler.host != build.config.build {
|
|
||||||
println!("\tskipping - not a build host");
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if compiler.stage != 2 {
|
|
||||||
println!("\tskipping - not stage2");
|
println!("Dist analysis");
|
||||||
|
|
||||||
|
if compiler.host != build.config.build {
|
||||||
|
println!("\tskipping, not a build host");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,10 @@ pub fn install(build: &Build, stage: u32, host: &str) {
|
|||||||
install_sh(&build, "docs", "rust-docs", stage, host, &prefix,
|
install_sh(&build, "docs", "rust-docs", stage, host, &prefix,
|
||||||
&docdir, &libdir, &mandir, &empty_dir);
|
&docdir, &libdir, &mandir, &empty_dir);
|
||||||
}
|
}
|
||||||
|
if build.config.rust_save_analysis {
|
||||||
|
install_sh(&build, "analysis", "rust-analysis", stage, host, &prefix,
|
||||||
|
&docdir, &libdir, &mandir, &empty_dir);
|
||||||
|
}
|
||||||
install_sh(&build, "std", "rust-std", stage, host, &prefix,
|
install_sh(&build, "std", "rust-std", stage, host, &prefix,
|
||||||
&docdir, &libdir, &mandir, &empty_dir);
|
&docdir, &libdir, &mandir, &empty_dir);
|
||||||
install_sh(&build, "rustc", "rustc", stage, host, &prefix,
|
install_sh(&build, "rustc", "rustc", stage, host, &prefix,
|
||||||
|
@ -524,7 +524,7 @@ impl Build {
|
|||||||
.env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
|
.env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.config.channel == "nightly" && compiler.is_final_stage(self) {
|
if self.config.rust_save_analysis && compiler.is_final_stage(self) {
|
||||||
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
|
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ fi
|
|||||||
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
|
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
|
||||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=nightly"
|
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=nightly"
|
||||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
|
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
|
||||||
|
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-save-analysis"
|
||||||
|
|
||||||
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
|
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
|
||||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
|
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
|
||||||
|
Loading…
Reference in New Issue
Block a user