From 0dd2cb4b2182c48171bb8904422ccc00214adc6b Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 24 Nov 2025 18:42:20 -0600 Subject: [PATCH] always resolve icons relative to the crate, not the cwd of the CLI (#5020) --- packages/cli/src/cli/bundle.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/cli/src/cli/bundle.rs b/packages/cli/src/cli/bundle.rs index ba6f0e9e3..7a7bafcfe 100644 --- a/packages/cli/src/cli/bundle.rs +++ b/packages/cli/src/cli/bundle.rs @@ -197,6 +197,18 @@ impl Bundle { } } + // resolve the icon relative to the crate, not the current working directory + if let Some(icons) = bundle_settings.icon.as_mut() { + for icon in icons { + let icon_path = build + .crate_dir() + .join(&icon) + .canonicalize() + .with_context(|| format!("Failed to canonicalize path to icon {icon:?}"))?; + *icon = icon_path.to_string_lossy().to_string(); + } + } + if bundle_settings.resources_map.is_none() { bundle_settings.resources_map = Some(HashMap::new()); }