diff options
| author | Christian Poveda <christianpoveda@protonmail.com> | 2018-09-28 00:19:56 -0500 |
|---|---|---|
| committer | Christian Poveda <christianpoveda@protonmail.com> | 2018-09-28 01:53:38 -0500 |
| commit | 53254a888b424b02b1daaedfae63acb4e3231912 (patch) | |
| tree | d25d590b7d1259942e50052f36b5f48c056a4b01 /src/bootstrap | |
| parent | 7d52cbce6db83e4fc2d8706b4e4b9c7da76cbcf8 (diff) | |
| download | rust-53254a888b424b02b1daaedfae63acb4e3231912.tar.gz rust-53254a888b424b02b1daaedfae63acb4e3231912.zip | |
Add enable-missing-tools option
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/config.rs | 2 | ||||
| -rwxr-xr-x | src/bootstrap/configure.py | 1 | ||||
| -rw-r--r-- | src/bootstrap/dist.rs | 18 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 3a4bc526d03..ba2be29e459 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -134,6 +134,7 @@ pub struct Config { pub test_miri: bool, pub save_toolstates: Option<PathBuf>, pub print_step_timings: bool, + pub missing_tools: bool, // Fallback musl-root for all targets pub musl_root: Option<PathBuf>, @@ -375,6 +376,7 @@ impl Config { config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")]; config.rust_codegen_backends_dir = "codegen-backends".to_owned(); config.deny_warnings = true; + config.missing_tools = false; // set by bootstrap.py config.build = INTERNER.intern_str(&env::var("BUILD").expect("'BUILD' to be set")); diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 75831dbe262..3b8af5061cb 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -69,6 +69,7 @@ o("profiler", "build.profiler", "build the profiler runtime") o("emscripten", None, "compile the emscripten backend as well as LLVM") o("full-tools", None, "enable all tools") o("lldb", "rust.lldb", "build lldb") +o("enable-missing-tools", "build.missing-tools", "allow failures when building tools") # Optimization and debugging options. These may be overridden by the release # channel, etc. diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 2d94704fda7..c25f94357f2 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -67,6 +67,14 @@ fn rust_installer(builder: &Builder) -> Command { builder.tool_cmd(Tool::RustInstaller) } +fn missing_tool(tool_name: &str, skip: bool) { + if skip { + println!("Unable to build {}, skipping dist", tool_name) + } else { + panic!("Unable to build {}", tool_name) + } +} + #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] pub struct Docs { pub stage: u32, @@ -1166,7 +1174,7 @@ impl Step for Rls { let rls = builder.ensure(tool::Rls { compiler: builder.compiler(stage, builder.config.build), target, extra_features: Vec::new() - }).or_else(|| { println!("Unable to build RLS, skipping dist"); None })?; + }).or_else(|| { missing_tool("RLS", builder.build.config.missing_tools); None })?; builder.install(&rls, &image.join("bin"), 0o755); let doc = image.join("share/doc/rls"); @@ -1245,11 +1253,11 @@ impl Step for Clippy { let clippy = builder.ensure(tool::Clippy { compiler: builder.compiler(stage, builder.config.build), target, extra_features: Vec::new() - }).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?; + }).or_else(|| { missing_tool("clippy", builder.build.config.missing_tools); None })?; let cargoclippy = builder.ensure(tool::CargoClippy { compiler: builder.compiler(stage, builder.config.build), target, extra_features: Vec::new() - }).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?; + }).or_else(|| { missing_tool("cargo clippy", builder.build.config.missing_tools); None })?; builder.install(&clippy, &image.join("bin"), 0o755); builder.install(&cargoclippy, &image.join("bin"), 0o755); @@ -1324,11 +1332,11 @@ impl Step for Rustfmt { let rustfmt = builder.ensure(tool::Rustfmt { compiler: builder.compiler(stage, builder.config.build), target, extra_features: Vec::new() - }).or_else(|| { println!("Unable to build Rustfmt, skipping dist"); None })?; + }).or_else(|| { missing_tool("Rustfmt", builder.build.config.missing_tools); None })?; let cargofmt = builder.ensure(tool::Cargofmt { compiler: builder.compiler(stage, builder.config.build), target, extra_features: Vec::new() - }).or_else(|| { println!("Unable to build Cargofmt, skipping dist"); None })?; + }).or_else(|| { missing_tool("Cargofmt", builder.build.config.missing_tools); None })?; builder.install(&rustfmt, &image.join("bin"), 0o755); builder.install(&cargofmt, &image.join("bin"), 0o755); |
