Skip to content

Windows prebuilt binaries with bundled GTK4 runtime#450

Merged
romgrk merged 8 commits into
masterfrom
test-windows-prebuilt
Jun 19, 2026
Merged

Windows prebuilt binaries with bundled GTK4 runtime#450
romgrk merged 8 commits into
masterfrom
test-windows-prebuilt

Conversation

@romgrk

@romgrk romgrk commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Ships self-contained Windows prebuilts so npm install node-gtk works on Windows with no MSYS2/compiler.

  • lib/native.js auto-wires the GTK runtime bundled next to the .node (PATH / GI_TYPELIB_PATH / XDG_DATA_DIRS / schemas / gdk-pixbuf loaders) before the addon loads.
  • scripts/windows-bundle-runtime.sh bundles the full GTK4/Adwaita/GtkSourceView DLL closure + typelibs + runtime data, driven by the curated seed list windows/runtime-libraries.txt; emits an exact bundled-dlls.txt manifest and a portable gdk-pixbuf loaders cache.
  • main.yaml build-windows now installs the GTK4 ship-stack (alongside the GTK3 test deps), bundles the runtime, and publishes to S3 on a [publish binary] commit.
  • Verified end-to-end on a clean Windows runner (no compiler, MinGW stripped from PATH): all quilx namespaces load and live Adw/GtkSource widgets + PNG decoding work. Vte (terminal) has no Windows port and is the one exception.

CI proof: branch test-windows-prebuilt workflow runs.

🤖 Generated with Claude Code

romgrk and others added 8 commits June 19, 2026 16:23
Builds the addon under MSYS2, bundles its full MinGW DLL closure + GI
typelibs next to the .node, then on a separate clean Windows runner (no
MSYS2, no compiler) installs deps with --ignore-scripts and runs a smoke
test that loads GTK via GObject-Introspection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ntldd on the addon alone misses the namespace libraries that GI loads at
runtime via g_module_open (libgio, libgtk, libgdk, libpango, ...); seed
the closure from those too. Also isolate the smoke test's PATH so the
runner's own C:\mingw64 cannot contaminate the result.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… size

Switch the prebuilt test to the quilx namespace set (Gtk4 + Adw +
GtkSource5 + Pango + GdkPixbuf + Graphene; Vte has no Windows port).
Bundle runtime data a real app needs (gdk-pixbuf loaders, GSettings
schemas, Adwaita/hicolor icons, GtkSourceView data) and print a size
breakdown plus the compressed node-pre-gyp tarball size.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the bundled-library list out of the bash script into
windows/runtime-libraries.txt, which doubles as user-facing reference
and the build script's input. Emit the exact resolved closure to
<binding-dir>/bundled-dlls.txt at build time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- lib/native.js: on win32, point PATH / GI_TYPELIB_PATH / XDG_DATA_DIRS /
  GSETTINGS_SCHEMA_DIR / GDK_PIXBUF_MODULE_FILE at the runtime bundled next
  to the .node, before the addon loads. Plain `npm install node-gtk` now
  works on Windows with no MSYS2/compiler and no manual env setup.
- windows-bundle-runtime.sh: rewrite gdk-pixbuf loaders.cache to portable
  (bare) names so image loaders work on the user's machine.
- main.yaml: install the GTK4 ship-stack alongside the GTK3 test deps,
  bundle the runtime, and publish the prebuilt to S3 on [publish binary].
- smoke test now sets NO env vars (relies on native.js) and runs with the
  runner's MinGW stripped from PATH; also decodes a PNG via bundled loaders.
- doc: Windows prebuilt binaries are now available.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@romgrk romgrk merged commit 0e8fbc5 into master Jun 19, 2026
13 checks passed
@romgrk romgrk deleted the test-windows-prebuilt branch June 19, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant