about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorOliver Schneider <git-no-reply-9879165716479413131@oli-obk.de>2017-09-10 11:48:56 +0200
committerOliver Schneider <git-no-reply-9879165716479413131@oli-obk.de>2017-09-17 21:41:45 +0200
commit68fc65eaf2a17c5fad14911b15f8a13d5c3d5b4a (patch)
treea8dcdd8a6e2610cd982b678a57bbea8d61816cc4 /src/bootstrap
parent13921dafbff6dcff629164fda7ab454615301877 (diff)
downloadrust-68fc65eaf2a17c5fad14911b15f8a13d5c3d5b4a.tar.gz
rust-68fc65eaf2a17c5fad14911b15f8a13d5c3d5b4a.zip
Prevent distribution if miri is enabled
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/builder.rs2
-rw-r--r--src/bootstrap/dist.rs25
2 files changed, 26 insertions, 1 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 9df7d6c6bef..1af96f1bf0b 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -260,7 +260,7 @@ impl<'a> Builder<'a> {
                 doc::Reference, doc::Rustdoc, doc::CargoBook),
             Kind::Dist => describe!(dist::Docs, dist::Mingw, dist::Rustc, dist::DebuggerScripts,
                 dist::Std, dist::Analysis, dist::Src, dist::PlainSourceTarball, dist::Cargo,
-                dist::Rls, dist::Extended, dist::HashSign),
+                dist::Rls, dist::Extended, dist::HashSign, dist::DontDistWithMiriEnabled),
             Kind::Install => describe!(install::Docs, install::Std, install::Cargo, install::Rls,
                 install::Analysis, install::Src, install::Rustc),
         }
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 7bca088dbd5..5188604b0a6 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -1111,6 +1111,31 @@ impl Step for Rls {
     }
 }
 
+
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct DontDistWithMiriEnabled;
+
+impl Step for DontDistWithMiriEnabled {
+    type Output = PathBuf;
+    const DEFAULT: bool = true;
+
+    fn should_run(run: ShouldRun) -> ShouldRun {
+        let build_miri = run.builder.build.config.test_miri;
+        run.default_condition(build_miri)
+    }
+
+    fn make_run(run: RunConfig) {
+        run.builder.ensure(DontDistWithMiriEnabled);
+    }
+
+    fn run(self, _: &Builder) -> PathBuf {
+        panic!("Do not distribute with miri enabled.\n\
+                The distributed libraries would include all MIR (increasing binary size).
+                The distributed MIR would include validation statements.");
+    }
+}
+
+
 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct Extended {
     stage: u32,