Skip to content

Don't panic if WASI_SDK_PATH not set when detecting compiler #143752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/bootstrap/src/utils/cc_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,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++"),
Expand Down
Loading