Skip to content

Commit b664100

Browse files
author
Jake Goldsborough
committed
adding a check to bootstrap script
and a check to the rust config script
1 parent 70598e0 commit b664100

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/bootstrap/bootstrap.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ def rustc(self):
236236
return config + '/bin/rustc' + self.exe_suffix()
237237
return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())
238238

239+
def nodejs(self):
240+
config = self.get_toml('nodejs')
241+
if config:
242+
return config
243+
if os.path.exists(os.path.join(self.bin_root(), "bin/nodejs")):
244+
return os.path.join(self.bin_root(), "bin/nodejs" + self.exe_suffix())
245+
elif os.path.exists(os.path.join(self.bin_root(), "bin/node")):
246+
return os.path.join(self.bin_root(), "bin/node" + self.exe_suffix())
247+
239248
def get_string(self, line):
240249
start = line.find('"')
241250
end = start + 1 + line[start+1:].find('"')

src/bootstrap/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub struct Config {
6767
pub target: Vec<String>,
6868
pub rustc: Option<PathBuf>,
6969
pub cargo: Option<PathBuf>,
70+
pub nodejs: Option<PathBuf>,
7071
pub local_rebuild: bool,
7172

7273
// libstd features
@@ -111,6 +112,7 @@ struct Build {
111112
host: Vec<String>,
112113
target: Vec<String>,
113114
cargo: Option<String>,
115+
nodejs: Option<String>,
114116
rustc: Option<String>,
115117
compiler_docs: Option<bool>,
116118
docs: Option<bool>,
@@ -215,6 +217,7 @@ impl Config {
215217
}
216218
config.rustc = build.rustc.map(PathBuf::from);
217219
config.cargo = build.cargo.map(PathBuf::from);
220+
config.nodejs = build.nodejs.map(PathBuf::from);
218221
set(&mut config.compiler_docs, build.compiler_docs);
219222
set(&mut config.docs, build.docs);
220223

0 commit comments

Comments
 (0)