Merge pull request #2278 from rtfeldman/configure-zig-executable

use ROC_ZIG environment variable to configure which zig is used
This commit is contained in:
Lucas 2021-12-26 14:40:48 -05:00 committed by GitHub
commit fe62e59e31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 36 deletions

View file

@ -369,7 +369,7 @@ pub fn helper_wasm<'a>(
use std::process::Command;
Command::new("zig")
Command::new(&crate::helpers::zig_executable())
.current_dir(dir_path)
.args(&[
"wasm-ld",

View file

@ -10,6 +10,13 @@ pub mod wasm;
#[cfg(feature = "gen-wasm")]
pub mod wasm32_test_result;
pub fn zig_executable() -> String {
match std::env::var("ROC_ZIG") {
Ok(path) => path,
Err(_) => "zig".into(),
}
}
/// Used in the with_larger_debug_stack() function, for tests that otherwise
/// run out of stack space in debug builds (but don't in --release builds)
#[allow(dead_code)]

View file

@ -185,7 +185,7 @@ pub fn helper_wasm<'a, T: Wasm32TestResult>(
"#UserApp_main_1",
];
let linker_output = std::process::Command::new("zig")
let linker_output = std::process::Command::new(&crate::helpers::zig_executable())
.args(args)
.output()
.unwrap();