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.
This commit is contained in:
commit
6b6c8be19d
1 changed files with 9 additions and 4 deletions
|
|
@ -220,10 +220,15 @@ fn default_compiler(
|
|||
}
|
||||
|
||||
t if t.contains("-wasi") => {
|
||||
let root = build
|
||||
.wasi_sdk_path
|
||||
.as_ref()
|
||||
.expect("WASI_SDK_PATH mut be configured for a -wasi target");
|
||||
let root = if let Some(path) = build.wasi_sdk_path.as_ref() {
|
||||
path
|
||||
} else {
|
||||
if build.config.is_running_on_ci {
|
||||
panic!("ERROR: WASI_SDK_PATH must be configured for a -wasi target on CI");
|
||||
}
|
||||
println!("WARNING: WASI_SDK_PATH not set, using default cc/cxx compiler");
|
||||
return None;
|
||||
};
|
||||
let compiler = match compiler {
|
||||
Language::C => format!("{t}-clang"),
|
||||
Language::CPlusPlus => format!("{t}-clang++"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue