gecko-dev/toolkit/library/rust/shared/build.rs
David Major c33be7adfb Bug 1533010 - Update Windows Rust to 1.34 beta r=glandium
This is needed for cross-language LTO (bug 1512723). We don't want to block on waiting for 1.34's release, so we'll get a head start now, but we'll update to the final 1.34 release when available. Rust Forge estimates the release at 11 April.

Differential Revision: https://phabricator.services.mozilla.com/D25851

--HG--
extra : moz-landing-system : lando
2019-04-03 15:11:43 +00:00

24 lines
909 B
Rust

extern crate rustc_version;
use rustc_version::{version, Version};
fn main() {
let ver = version().unwrap();
let mut bootstrap = false;
let max_oom_hook_version = Version::parse("1.35.0-alpha").unwrap();
if ver >= Version::parse("1.28.0-alpha").unwrap() && ver < max_oom_hook_version {
println!("cargo:rustc-cfg=feature=\"oom_with_hook\"");
bootstrap = true;
} else if std::env::var("MOZ_AUTOMATION").is_ok() {
panic!("Builds on automation must use a version of rust for which we know how to hook OOM: want < {}, have {}",
max_oom_hook_version, ver);
}
// 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");
}
}