From a69b5e16b14e6c97ba372c2a1626898fad9bc9b2 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 8 Apr 2025 09:29:10 -0700 Subject: [PATCH] fix(compile): multi icon ordering on windows (#28771) Fixes https://github.com/denoland/deno/issues/26400. Correctly handle multi-icon icos in `deno compile --icon`. Ref https://github.com/denoland/sui/commit/bf318ea9c847810b79d6a34a4e744b7b09630ddb ## Explanation Icons in PE are very sensitive to resource table ordering. Here's what works: We can't use `editpe`'s builtin `set_icon` because it lays out `Icon` and `Icon Group` together before/after the `RCData`. Instead, we need a custom implementation that places RCData between the icon entries. This means we defer `Icon Group` to always happen during `PortableExecutable::build`. After the fix: --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21585925d8..518a83508f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5180,11 +5180,12 @@ dependencies = [ [[package]] name = "libsui" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89795977654ad6250d6c0915411b622bac22f9efb4f852af94b2e00964cab832" +checksum = "7550a110415b4780bf6064d280f2dc5b761fb80d9af92258a72e5dc82ca6f05a" dependencies = [ "editpe", + "image", "libc", "sha2", "windows-sys 0.48.0", diff --git a/Cargo.toml b/Cargo.toml index c086be55f8..605c06eea2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -219,7 +219,7 @@ libffi = "=3.2.0" libffi-sys = "=2.3.0" libloading = "0.7" libsqlite3-sys = "0.30.1" -libsui = "0.5.0" +libsui = "0.7.0" libuv-sys-lite = "=1.48.2" libz-sys = { version = "1.1.20", default-features = false } log = { version = "0.4.20", features = ["kv"] }