Fail the build without panic! when SOUNDCRAFT_REQUIRE_WINRES is set

The workspace denies clippy::panic, build scripts included. Print the reason on stderr and exit 1 instead.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Fredrik HallinandClaude Sonnet 5.5 committed 2026-11-28 20:52:45 +01:00
1 parent 865baa99f1
commit 3e584701c5
1 file changed
+4 -1
+4 -1
View File
@@ -67,7 +67,10 @@ fn main() {
}
if let Err(e) = res.compile() {
if std::env::var_os("SOUNDCRAFT_REQUIRE_WINRES").is_some() {
panic!("embedding Windows resources failed: {e}");
// The workspace denies `clippy::panic`, build scripts included: stop the build with
// the reason on stderr.
eprintln!("embedding Windows resources failed: {e}");
std::process::exit(1);
}
println!("cargo:warning=soundcraft.exe built without icon/version resources: {e}");
}