Skip to content

Commit 9bdd3b0

Browse files
author
Paul Murphy
committed
Don't always panic if WASI_SDK_PATH is not set when detecting compilers
They are not always needed when building std, as is the case when packaging on Fedora. Panic if building from CI, but warn otherwise.
1 parent 25cf7d1 commit 9bdd3b0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/bootstrap/src/utils/cc_detect.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,15 @@ fn default_compiler(
221221
}
222222

223223
t if t.contains("-wasi") => {
224-
let root = build
225-
.wasi_sdk_path
226-
.as_ref()
227-
.expect("WASI_SDK_PATH mut be configured for a -wasi target");
224+
let root = if let Some(path) = build.wasi_sdk_path.as_ref() {
225+
path
226+
} else {
227+
if build.config.is_running_on_ci {
228+
panic!("ERROR: WASI_SDK_PATH must be configured for a -wasi target on CI");
229+
}
230+
println!("WARNING: WASI_SDK_PATH not set, using default cc/cxx compiler");
231+
return None;
232+
};
228233
let compiler = match compiler {
229234
Language::C => format!("{t}-clang"),
230235
Language::CPlusPlus => format!("{t}-clang++"),

0 commit comments

Comments
 (0)