#![deny(warnings)]
+#[macro_use]
extern crate build_helper;
extern crate cmake;
extern crate filetime;
use std::path::{Component, PathBuf, Path};
use std::process::Command;
-use build_helper::{run_silent, output};
+use build_helper::{run_silent, output, mtime};
-use util::{exe, mtime, libdir, add_lib_path};
-
-/// A helper macro to `unwrap` a result except also print out details like:
-///
-/// * The file/line of the panic
-/// * The expression that failed
-/// * The error itself
-///
-/// This is currently used judiciously throughout the build system rather than
-/// using a `Result` with `try!`, but this may change one day...
-macro_rules! t {
- ($e:expr) => (match $e {
- Ok(e) => e,
- Err(e) => panic!("{} failed with {}", stringify!($e), e),
- })
-}
+use util::{exe, libdir, add_lib_path};
mod cc;
mod channel;
version: String,
package_vers: String,
local_rebuild: bool,
+ release_num: String,
+ prerelease_version: String,
// Probed tools at runtime
lldb_version: Option<String>,
lldb_version: None,
lldb_python_dir: None,
is_sudo: is_sudo,
+ release_num: String::new(),
+ prerelease_version: String::new(),
}
}
//
// These variables are primarily all read by
// src/bootstrap/bin/{rustc.rs,rustdoc.rs}
- cargo.env("RUSTC", self.out.join("bootstrap/debug/rustc"))
+ cargo.env("RUSTBUILD_NATIVE_DIR", self.native_dir(target))
+ .env("RUSTC", self.out.join("bootstrap/debug/rustc"))
.env("RUSTC_REAL", self.compiler_path(compiler))
.env("RUSTC_STAGE", stage.to_string())
.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
/// Get the space-separated set of activated features for the standard
/// library.
fn std_features(&self) -> String {
- let mut features = "panic-unwind".to_string();
+ let mut features = "panic-unwind asan lsan msan tsan".to_string();
+
if self.config.debug_jemalloc {
features.push_str(" debug-jemalloc");
}
}
}
+ /// Directory for libraries built from C/C++ code and shared between stages.
+ fn native_dir(&self, target: &str) -> PathBuf {
+ self.out.join(target).join("native")
+ }
+
/// Root output directory for rust_test_helpers library compiled for
/// `target`
fn test_helpers_out(&self, target: &str) -> PathBuf {
- self.out.join(target).join("rust-test-helpers")
+ self.native_dir(target).join("rust-test-helpers")
}
/// Adds the compiler's directory of dynamic libraries to `cmd`'s dynamic
.map(|p| &**p)
}
+ /// Returns the root of the "rootfs" image that this target will be using,
+ /// if one was configured.
+ ///
+ /// If `Some` is returned then that means that tests for this target are
+ /// emulated with QEMU and binaries will need to be shipped to the emulator.
+ fn qemu_rootfs(&self, target: &str) -> Option<&Path> {
+ self.config.target_config.get(target)
+ .and_then(|t| t.qemu_rootfs.as_ref())
+ .map(|p| &**p)
+ }
+
/// Path to the python interpreter to use
fn python(&self) -> &Path {
self.config.python.as_ref().unwrap()