Skip to content

Commit fa3b7a6

Browse files
authored
Unrolled build for #143752
Rollup merge of #143752 - pmur:murp/no-panic-detect-wasi-cc, r=Kobzol Don't panic if WASI_SDK_PATH not set when detecting compiler The fedora packaging builds the wasm sysroot outside of the rust build system. Fedora applies a couple of patches related to wasm which I think make this possible. Not panicking seems consistent with the detection logic of other targets when they cannot find cc.
2 parents a9fb610 + 9bdd3b0 commit fa3b7a6

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)