From 7e46f2ceaa84ae7ba7143fcbe8bb3d0da2449fb4 Mon Sep 17 00:00:00 2001 From: Jake Goldsborough Date: Wed, 7 Sep 2016 13:13:37 -0700 Subject: [PATCH] moving nodejs detection logic to configure and adding a nodejs cmd sanity check --- src/bootstrap/config.rs | 4 ++++ src/bootstrap/sanity.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 682a6f74126..b1701202511 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -79,6 +79,7 @@ pub struct Config { pub musl_root: Option, pub prefix: Option, pub codegen_tests: bool, + pub nodejs: Option, } /// Per-target configuration stored in the global configuration structure. @@ -391,6 +392,9 @@ impl Config { self.rustc = Some(PathBuf::from(value).join("bin/rustc")); self.cargo = Some(PathBuf::from(value).join("bin/cargo")); } + "CFG_NODEJS" if value.len() > 0 => { + self.nodejs = Some(PathBuf::from(value)); + } _ => {} } } diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index ae7f2e018f9..c345893954f 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -76,7 +76,7 @@ pub fn check(build: &mut Build) { need_cmd("python".as_ref()); // If a manual nodejs was added to the config, - // of if a nodejs install is detected through bootstrap.py, use it. + // of if a nodejs install is detected through config, use it. if build.config.nodejs.is_some() { need_cmd("nodejs".as_ref()) }