Skip to content

fix(compile): bump libsui to 0.16.4 to fix Windows resource SizeOfImage - #36242

Merged
bartlomieju merged 1 commit into
mainfrom
fix/bump-libsui-0.16.4
Jul 22, 2026
Merged

fix(compile): bump libsui to 0.16.4 to fix Windows resource SizeOfImage#36242
bartlomieju merged 1 commit into
mainfrom
fix/bump-libsui-0.16.4

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Bumps libsui from 0.16.3 to 0.16.4.

libsui 0.16.4 corrects the SizeOfImage field in the PE header when deno compile appends the embedded payload (and, with --icon, the icon) as a
resource section. The previous version grew SizeOfImage by the unaligned raw
length of the appended resource data, under-counting the image by up to one
section-alignment page. On Windows an undersized SizeOfImage leaves the tail of
the resource section outside the mapped image, which shows up either as an
access violation at startup before any JavaScript runs, or as the runtime
failing to find the embedded section and reporting "Could not find standalone
binary section" when an icon is embedded.

This is what regressed compiled binaries between 2.9.2 and 2.9.3 on Windows.
libsui itself did not change between those releases; the base deno binary's
section layout shifted just enough that the latent SizeOfImage miscalculation
began clipping the resource section. The fix recomputes SizeOfImage from the
final section table so it always covers every section's aligned virtual extent.
The libsui change (denoland/sui#79) also adds cross-platform regression tests
for this.

Closes #36206
Closes #36238

libsui 0.16.4 corrects the SizeOfImage computation when `deno compile`
appends the embedded data (and, with --icon, the icon) as a PE resource
section. The previous version grew SizeOfImage by the unaligned raw length of
the appended resource, under-counting the image by up to one page. On Windows
that leaves the tail of the resource section unmapped, which surfaced either
as an access violation at startup before any JavaScript ran, or as the runtime
failing to locate the embedded section ("Could not find standalone binary
section") when an icon was embedded.

This is what regressed compiled binaries between 2.9.2 and 2.9.3 on Windows:
libsui itself was unchanged, but the base binary's layout shifted enough to
start tripping the latent SizeOfImage bug.
@bartlomieju
bartlomieju merged commit 55bceb8 into main Jul 22, 2026
136 checks passed
@bartlomieju
bartlomieju deleted the fix/bump-libsui-0.16.4 branch July 22, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant