Report which required build-time environment variable is not set
This commit is contained in:
parent
2d1d4d1994
commit
cc8727e675
7 changed files with 19 additions and 19 deletions
|
@ -55,10 +55,10 @@ fn main() {
|
||||||
} else {
|
} else {
|
||||||
("RUSTC_REAL", "RUSTC_LIBDIR")
|
("RUSTC_REAL", "RUSTC_LIBDIR")
|
||||||
};
|
};
|
||||||
let stage = env::var("RUSTC_STAGE").unwrap();
|
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
|
||||||
|
|
||||||
let rustc = env::var_os(rustc).unwrap();
|
let rustc = env::var_os(rustc).unwrap_or_else(|| panic!("{:?} was not set", rustc));
|
||||||
let libdir = env::var_os(libdir).unwrap();
|
let libdir = env::var_os(libdir).unwrap_or_else(|| panic!("{:?} was not set", libdir));
|
||||||
let mut dylib_path = bootstrap::util::dylib_path();
|
let mut dylib_path = bootstrap::util::dylib_path();
|
||||||
dylib_path.insert(0, PathBuf::from(libdir));
|
dylib_path.insert(0, PathBuf::from(libdir));
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fn main() {
|
||||||
if let Some(target) = target {
|
if let Some(target) = target {
|
||||||
// The stage0 compiler has a special sysroot distinct from what we
|
// The stage0 compiler has a special sysroot distinct from what we
|
||||||
// actually downloaded, so we just always pass the `--sysroot` option.
|
// actually downloaded, so we just always pass the `--sysroot` option.
|
||||||
cmd.arg("--sysroot").arg(env::var_os("RUSTC_SYSROOT").unwrap());
|
cmd.arg("--sysroot").arg(env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set"));
|
||||||
|
|
||||||
// When we build Rust dylibs they're all intended for intermediate
|
// When we build Rust dylibs they're all intended for intermediate
|
||||||
// usage, so make sure we pass the -Cprefer-dynamic flag instead of
|
// usage, so make sure we pass the -Cprefer-dynamic flag instead of
|
||||||
|
|
|
@ -20,15 +20,16 @@ use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args = env::args_os().skip(1).collect::<Vec<_>>();
|
let args = env::args_os().skip(1).collect::<Vec<_>>();
|
||||||
let rustdoc = env::var_os("RUSTDOC_REAL").unwrap();
|
let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
|
||||||
let libdir = env::var_os("RUSTC_LIBDIR").unwrap();
|
let libdir = env::var_os("RUSTC_LIBDIR").expect("RUSTC_LIBDIR was not set");
|
||||||
|
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
|
||||||
|
|
||||||
let mut dylib_path = bootstrap::util::dylib_path();
|
let mut dylib_path = bootstrap::util::dylib_path();
|
||||||
dylib_path.insert(0, PathBuf::from(libdir));
|
dylib_path.insert(0, PathBuf::from(libdir));
|
||||||
|
|
||||||
let mut cmd = Command::new(rustdoc);
|
let mut cmd = Command::new(rustdoc);
|
||||||
cmd.args(&args)
|
cmd.args(&args)
|
||||||
.arg("--cfg").arg(format!("stage{}", env::var("RUSTC_STAGE").unwrap()))
|
.arg("--cfg").arg(format!("stage{}", stage))
|
||||||
.arg("--cfg").arg("dox")
|
.arg("--cfg").arg("dox")
|
||||||
.env(bootstrap::util::dylib_path_var(),
|
.env(bootstrap::util::dylib_path_var(),
|
||||||
env::join_paths(&dylib_path).unwrap());
|
env::join_paths(&dylib_path).unwrap());
|
||||||
|
@ -37,4 +38,3 @@ fn main() {
|
||||||
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
|
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ fn main() {
|
||||||
println!("cargo:rustc-cfg=cargobuild");
|
println!("cargo:rustc-cfg=cargobuild");
|
||||||
println!("cargo:rerun-if-changed=build.rs");
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").expect("TARGET was not set");
|
||||||
let host = env::var("HOST").unwrap();
|
let host = env::var("HOST").expect("HOST was not set");
|
||||||
let build_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
let build_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||||
let src_dir = env::current_dir().unwrap();
|
let src_dir = env::current_dir().unwrap();
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ fn main() {
|
||||||
.current_dir(&build_dir)
|
.current_dir(&build_dir)
|
||||||
.arg("build_lib_static")
|
.arg("build_lib_static")
|
||||||
.arg("-j")
|
.arg("-j")
|
||||||
.arg(env::var("NUM_JOBS").unwrap()));
|
.arg(env::var("NUM_JOBS").expect("NUM_JOBS was not set")));
|
||||||
|
|
||||||
if target.contains("windows") {
|
if target.contains("windows") {
|
||||||
println!("cargo:rustc-link-lib=static=jemalloc");
|
println!("cargo:rustc-link-lib=static=jemalloc");
|
||||||
|
|
|
@ -72,7 +72,7 @@ impl Sources {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").expect("TARGET was not set");
|
||||||
let cfg = &mut gcc::Config::new();
|
let cfg = &mut gcc::Config::new();
|
||||||
|
|
||||||
if target.contains("msvc") {
|
if target.contains("msvc") {
|
||||||
|
|
|
@ -20,7 +20,7 @@ use build_helper::output;
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rustc-cfg=cargobuild");
|
println!("cargo:rustc-cfg=cargobuild");
|
||||||
|
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").expect("TARGET was not set");
|
||||||
let llvm_config = env::var_os("LLVM_CONFIG")
|
let llvm_config = env::var_os("LLVM_CONFIG")
|
||||||
.map(PathBuf::from)
|
.map(PathBuf::from)
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
|
@ -62,8 +62,8 @@ fn main() {
|
||||||
// can't trust all the output of llvm-config becaues it might be targeted
|
// can't trust all the output of llvm-config becaues it might be targeted
|
||||||
// for the host rather than the target. As a result a bunch of blocks below
|
// for the host rather than the target. As a result a bunch of blocks below
|
||||||
// are gated on `if !is_crossed`
|
// are gated on `if !is_crossed`
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").expect("TARGET was not set");
|
||||||
let host = env::var("HOST").unwrap();
|
let host = env::var("HOST").expect("HOST was not set");
|
||||||
let is_crossed = target != host;
|
let is_crossed = target != host;
|
||||||
|
|
||||||
let optional_components = ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz"];
|
let optional_components = ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz"];
|
||||||
|
|
|
@ -23,8 +23,8 @@ fn main() {
|
||||||
println!("cargo:rustc-cfg=cargobuild");
|
println!("cargo:rustc-cfg=cargobuild");
|
||||||
println!("cargo:rerun-if-changed=build.rs");
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").expect("TARGET was not set");
|
||||||
let host = env::var("HOST").unwrap();
|
let host = env::var("HOST").expect("HOST was not set");
|
||||||
if cfg!(feature = "backtrace") && !target.contains("apple") && !target.contains("msvc") &&
|
if cfg!(feature = "backtrace") && !target.contains("apple") && !target.contains("msvc") &&
|
||||||
!target.contains("emscripten") {
|
!target.contains("emscripten") {
|
||||||
build_libbacktrace(&host, &target);
|
build_libbacktrace(&host, &target);
|
||||||
|
@ -103,5 +103,5 @@ fn build_libbacktrace(host: &str, target: &str) {
|
||||||
run(Command::new("make")
|
run(Command::new("make")
|
||||||
.current_dir(&build_dir)
|
.current_dir(&build_dir)
|
||||||
.arg(format!("INCDIR={}", src_dir.display()))
|
.arg(format!("INCDIR={}", src_dir.display()))
|
||||||
.arg("-j").arg(env::var("NUM_JOBS").unwrap()));
|
.arg("-j").arg(env::var("NUM_JOBS").expect("NUM_JOBS was not set")));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ use std::env;
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rustc-cfg=cargobuild");
|
println!("cargo:rustc-cfg=cargobuild");
|
||||||
|
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").expect("TARGET was not set");
|
||||||
|
|
||||||
if target.contains("linux") {
|
if target.contains("linux") {
|
||||||
if target.contains("musl") && !target.contains("mips") {
|
if target.contains("musl") && !target.contains("mips") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue