Skip to content

compile-test: allow overriding nodejs binary location #37611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
@@ -128,6 +128,7 @@ struct Build {
submodules: Option<bool>,
gdb: Option<String>,
vendor: Option<bool>,
nodejs: Option<String>,
}

/// TOML representation of how the LLVM build is configured.
@@ -232,6 +233,7 @@ impl Config {
}
config.rustc = build.rustc.map(PathBuf::from);
config.cargo = build.cargo.map(PathBuf::from);
config.nodejs = build.nodejs.map(PathBuf::from);
config.gdb = build.gdb.map(PathBuf::from);
set(&mut config.compiler_docs, build.compiler_docs);
set(&mut config.docs, build.docs);
13 changes: 7 additions & 6 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
@@ -81,15 +81,16 @@ pub fn check(build: &mut Build) {

need_cmd("python".as_ref());

// Look for the nodejs command, needed for emscripten testing
if let Some(node) = have_cmd("node".as_ref()) {
build.config.nodejs = Some(node);
} else if let Some(node) = have_cmd("nodejs".as_ref()) {
build.config.nodejs = Some(node);
}

if let Some(ref s) = build.config.nodejs {
need_cmd(s.as_ref());
} else {
// Look for the nodejs command, needed for emscripten testing
if let Some(node) = have_cmd("node".as_ref()) {
build.config.nodejs = Some(node);
} else if let Some(node) = have_cmd("nodejs".as_ref()) {
build.config.nodejs = Some(node);
}
}

if let Some(ref gdb) = build.config.gdb {
7 changes: 5 additions & 2 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
@@ -1456,8 +1456,11 @@ actual:\n\

// If this is emscripten, then run tests under nodejs
if self.config.target.contains("emscripten") {
let nodejs = self.config.nodejs.clone().unwrap_or("nodejs".to_string());
args.push(nodejs);
if let Some(ref p) = self.config.nodejs {
args.push(p.clone());
} else {
self.fatal("no NodeJS binary found (--nodejs)");
}
}

let exe_file = self.make_exe_name();