Skip to content

Commit c3980ab

Browse files
author
Paul Murphy
committed
Don't panic if WASI_SDK_PATH is not set when detecting compiler
They are not always needed when building std, as is the case when packaging on Fedora. Instead, print a warning that the default cxx/cc compiler will be used.
1 parent 25cf7d1 commit c3980ab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bootstrap/src/utils/cc_detect.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,12 @@ 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+
println!("WARNING: WASI_SDK_PATH not set, using default cc/cxx compiler");
228+
return None;
229+
};
228230
let compiler = match compiler {
229231
Language::C => format!("{t}-clang"),
230232
Language::CPlusPlus => format!("{t}-clang++"),

0 commit comments

Comments
 (0)