From 370fd1565be3cb35bf57750e14cd83b626cffbb7 Mon Sep 17 00:00:00 2001 From: jamiepine <32987599+jamiepine@users.noreply.github.com> Date: Sat, 3 Oct 2026 20:21:32 +0000 Subject: [PATCH] fix(build): keep actool failure fatal for release builds; surface its full output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tauri/src-tauri/build.rs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tauri/src-tauri/build.rs b/tauri/src-tauri/build.rs index 22fc4470..863c7ca0 100644 --- a/tauri/src-tauri/build.rs +++ b/tauri/src-tauri/build.rs @@ -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::>(); + 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." ); } }