Fix chromium backend icon write failing with ENOENT

The chromium build path created a TempDir via `tempdir()?.path().join(...)`,
which dropped the TempDir at the end of the statement and deleted the
directory before fetch_or_create_icon could write into it. Every
`deskify build --backend chromium` failed with:

    Error: Failed to write RGBA PNG icon to /tmp/.tmpXXXXXX/icon.png
    Caused by: No such file or directory (os error 2)

Bind the TempDir to a local like the tauri branch already does so it
lives until the icon has been written and copied to its final location.
This commit is contained in:
Lasath Fernando
2026-05-18 20:39:15 -05:00
parent 557cd4dc2d
commit 7fc81ececa

View File

@@ -56,7 +56,8 @@ fn execute_build(args: &BuildArgs, dry_run: bool, print_config: bool) -> Result<
"Installing Chromium app '{}' for URL: {}", "Installing Chromium app '{}' for URL: {}",
args.name, args.url args.name, args.url
); );
let temp_icon = tempdir()?.path().join("icon.png"); let dir = tempdir().context("Failed to create temporary directory for building")?;
let temp_icon = dir.path().join("icon.png");
icon::fetch_or_create_icon(&args.url, args.icon.as_ref(), &temp_icon)?; icon::fetch_or_create_icon(&args.url, args.icon.as_ref(), &temp_icon)?;
install::install_chromium_app(args, &temp_icon)?; install::install_chromium_app(args, &temp_icon)?;
app::write_app_config_from_args(args)?; app::write_app_config_from_args(args)?;