about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJake Goldsborough <rjgoldsborough@gmail.com>2016-09-03 20:22:12 -0700
committerJake Goldsborough <rjgoldsborough@gmail.com>2016-09-03 20:22:12 -0700
commitb66410043a8d2f352b8261f93c4227d48292df72 (patch)
tree88b249bee72dee3687ef8fef9594c9cc2383e7b7
parent70598e04f922a0f451f63cec4134bd28b31c6411 (diff)
downloadrust-b66410043a8d2f352b8261f93c4227d48292df72.tar.gz
rust-b66410043a8d2f352b8261f93c4227d48292df72.zip
adding a check to bootstrap script
and a check to the rust config script
-rw-r--r--src/bootstrap/bootstrap.py9
-rw-r--r--src/bootstrap/config.rs3
2 files changed, 12 insertions, 0 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 17a7c9ca66a..3f4a18ab124 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -236,6 +236,15 @@ class RustBuild:
             return config + '/bin/rustc' + self.exe_suffix()
         return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())
 
+    def nodejs(self):
+        config = self.get_toml('nodejs')
+        if config:
+            return config
+        if os.path.exists(os.path.join(self.bin_root(), "bin/nodejs")):
+            return os.path.join(self.bin_root(), "bin/nodejs" + self.exe_suffix())
+        elif os.path.exists(os.path.join(self.bin_root(), "bin/node")):
+            return os.path.join(self.bin_root(), "bin/node" + self.exe_suffix())
+
     def get_string(self, line):
         start = line.find('"')
         end = start + 1 + line[start+1:].find('"')
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 682a6f74126..5a7ae4f6973 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -67,6 +67,7 @@ pub struct Config {
     pub target: Vec<String>,
     pub rustc: Option<PathBuf>,
     pub cargo: Option<PathBuf>,
+    pub nodejs: Option<PathBuf>,
     pub local_rebuild: bool,
 
     // libstd features
@@ -111,6 +112,7 @@ struct Build {
     host: Vec<String>,
     target: Vec<String>,
     cargo: Option<String>,
+    nodejs: Option<String>,
     rustc: Option<String>,
     compiler_docs: Option<bool>,
     docs: Option<bool>,
@@ -215,6 +217,7 @@ impl Config {
         }
         config.rustc = build.rustc.map(PathBuf::from);
         config.cargo = build.cargo.map(PathBuf::from);
+        config.nodejs = build.nodejs.map(PathBuf::from);
         set(&mut config.compiler_docs, build.compiler_docs);
         set(&mut config.docs, build.docs);