Bug 1472857 - Allow rustc 1.27 to build in automation for the sake of the base-toolchains build. r=glandium draft
authorChris Manchester <cmanchester@mozilla.com>
Tue, 03 Jul 2018 15:27:20 -0700
changeset 814311 072ec286faefb00480ab51e099a36636cb05233b
parent 813581 a0e47ebc4c06e652b919dabee711fdbd6bfd31b5
child 814312 8663fb83f13a5a9009ba4848694e041a969f8d27
push id115152
push usercmanchester@mozilla.com
push dateWed, 04 Jul 2018 21:59:10 +0000
reviewersglandium
bugs1472857
milestone63.0a1
Bug 1472857 - Allow rustc 1.27 to build in automation for the sake of the base-toolchains build. r=glandium MozReview-Commit-ID: EQj9aLbbckA
toolkit/library/rust/shared/build.rs
--- a/toolkit/library/rust/shared/build.rs
+++ b/toolkit/library/rust/shared/build.rs
@@ -7,17 +7,19 @@ fn main() {
     let mut bootstrap = false;
 
     if ver >= Version::parse("1.24.0").unwrap() && ver < Version::parse("1.27.0").unwrap() {
         println!("cargo:rustc-cfg=feature=\"oom_with_global_alloc\"");
         bootstrap = true;
     } else if ver >= Version::parse("1.28.0-alpha").unwrap() && ver < Version::parse("1.29.0").unwrap() {
         println!("cargo:rustc-cfg=feature=\"oom_with_hook\"");
         bootstrap = true;
-    } else if std::env::var("MOZ_AUTOMATION").is_ok() {
+    } else if std::env::var("MOZ_AUTOMATION").is_ok() && ver >= Version::parse("1.29.0-alpha").unwrap() {
+        // For the sake of the base-toolchains build we allow building with 1.27, but
+        // retain this check for newer versions.
         panic!("Builds on automation must use a version of rust that supports OOM hooking")
     }
 
     // This is a rather awful thing to do, but we're only doing it on
     // versions of rustc that are not going to change the unstable APIs
     // we use from under us, all being already released or beta.
     if bootstrap {
         println!("cargo:rustc-env=RUSTC_BOOTSTRAP=1");