mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 17:15:19 -07:00
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:
committed by
capy-ai-staging[bot]
parent
c31703a8c4
commit
370fd1565b
@@ -65,23 +65,45 @@ fn main() {
|
||||
])
|
||||
.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 {
|
||||
Ok(output) => {
|
||||
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!(
|
||||
"cargo:warning=actool failed (requires full Xcode, not just CLT) — \
|
||||
stub files will be used. stderr: {}",
|
||||
String::from_utf8_lossy(&output.stderr).trim()
|
||||
stub files will be used for this dev build"
|
||||
);
|
||||
for line in &detail {
|
||||
println!("cargo:warning=actool: {}", line);
|
||||
}
|
||||
} else {
|
||||
println!("Successfully compiled icon to {}", gen_dir);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
if release_build {
|
||||
eprintln!("Failed to execute xcrun actool: {}", e);
|
||||
panic!("Icon compilation failed (release build requires full Xcode)");
|
||||
}
|
||||
println!(
|
||||
"cargo:warning=xcrun actool not available ({e}) — \
|
||||
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."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user