fix(build): keep actool failure fatal for release builds; surface its full output

Review follow-ups on the non-fatal actool change: the stub Assets.car /
partial.plist fallback is only acceptable for dev builds, so gate it on
PROFILE != release and keep panicking for release bundles (release.yml
builds signed DMGs where an empty icon catalog must fail the job). The
warning now emits one cargo:warning per non-empty line of actool's
stdout and stderr — actool writes its compile diagnostics to stdout, and
Cargo only reads the first line of a warning directive.
This commit is contained in:
jamiepine
2026-10-04 00:01:53 +00:00
committed by capy-ai-staging[bot]
parent c31703a8c4
commit 370fd1565b
+25 -3
View File
@@ -65,23 +65,45 @@ fn main() {
]) ])
.output(); .output();
// A missing or failing actool is survivable for dev builds (the
// stub block below writes empty Assets.car / partial.plist), but a
// release bundle must never ship those stubs as its icon catalog.
let release_build = std::env::var("PROFILE").as_deref() == Ok("release");
match output { match output {
Ok(output) => { Ok(output) => {
if !output.status.success() { if !output.status.success() {
let detail = String::from_utf8_lossy(&output.stdout)
.lines()
.chain(String::from_utf8_lossy(&output.stderr).lines())
.filter(|line| !line.trim().is_empty())
.map(|line| line.trim().to_string())
.collect::<Vec<_>>();
if release_build {
for line in &detail {
eprintln!("actool: {}", line);
}
panic!("actool failed to compile icon (release build requires full Xcode)");
}
println!( println!(
"cargo:warning=actool failed (requires full Xcode, not just CLT) — \ "cargo:warning=actool failed (requires full Xcode, not just CLT) — \
stub files will be used. stderr: {}", stub files will be used for this dev build"
String::from_utf8_lossy(&output.stderr).trim()
); );
for line in &detail {
println!("cargo:warning=actool: {}", line);
}
} else { } else {
println!("Successfully compiled icon to {}", gen_dir); println!("Successfully compiled icon to {}", gen_dir);
} }
} }
Err(e) => { Err(e) => {
if release_build {
eprintln!("Failed to execute xcrun actool: {}", e);
panic!("Icon compilation failed (release build requires full Xcode)");
}
println!( println!(
"cargo:warning=xcrun actool not available ({e}) — \ "cargo:warning=xcrun actool not available ({e}) — \
install Xcode from the App Store for Liquid Glass icons. \ install Xcode from the App Store for Liquid Glass icons. \
Stub files will be used for dev builds." Stub files will be used for this dev build."
); );
} }
} }