From 7603941d5c9e4876980e613e2a9ef3961ba3d307 Mon Sep 17 00:00:00 2001 From: Ruben Nogueira <40404708+rubnogueira@users.noreply.github.com> Date: Tue, 19 May 2026 19:03:06 +0100 Subject: [PATCH 1/2] fix(gyp): default enable_thin_lto so Node 26 win32 configure works Node 26's bundled common.gypi has a top-level ['enable_thin_lto=="true"', { ... }] condition, but doesn't always inject a default for the variable itself. node-gyp 10.x (shipped inside prebuild 13.0.1) doesn't inject the default either. On Linux/macOS the include chain happens to define it elsewhere, but on Windows gyp configure fails before MSBuild even starts: gyp: name 'enable_thin_lto' is not defined while evaluating condition 'enable_thin_lto=="true"' in binding.gyp Providing `enable_thin_lto%='false'` in our own variables block is a no-op when the variable is already set, so it's safe across all platforms and node-gyp versions. Verified locally that both 24.15.0 and 26.1.0 still build cleanly on darwin-arm64. Co-Authored-By: Claude Opus 4.7 (1M context) --- binding.gyp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/binding.gyp b/binding.gyp index 1400bde..b39839a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,4 +1,13 @@ { + # Node 26's common.gypi references variables like `enable_thin_lto` in + # `conditions`, but the bundled node-gyp (10.x) shipped with prebuild + # 13 doesn't inject defaults for them. On the Windows toolchain that + # results in `gyp: name 'enable_thin_lto' is not defined`. Providing a + # `%` default here is safe across all platforms and node-gyp versions: + # gyp only uses our default when the variable isn't already set. + 'variables': { + 'enable_thin_lto%': 'false', + }, 'targets': [ { 'target_name': 'node_expat', From 48be8fb3a9b18ffeb355e95f03928b6399f9a319 Mon Sep 17 00:00:00 2001 From: Ruben Nogueira <40404708+rubnogueira@users.noreply.github.com> Date: Tue, 19 May 2026 19:11:08 +0100 Subject: [PATCH 2/2] fix(gyp): also default enable_thin_lto in libexpat.gyp Same Node 26 / node-gyp 10 issue as the previous commit, but the error has now moved into the dependency: gyp: name 'enable_thin_lto' is not defined while evaluating condition 'enable_thin_lto=="true"' in deps\libexpat\libexpat.gyp while loading dependencies of binding.gyp gyp loads each .gyp file in its own variable scope, so a `%` default in the parent binding.gyp doesn't propagate down to dependencies. Adding the same default to libexpat.gyp's top-level variables block. Co-Authored-By: Claude Opus 4.7 (1M context) --- deps/libexpat/libexpat.gyp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deps/libexpat/libexpat.gyp b/deps/libexpat/libexpat.gyp index d74e868..5bc4cb9 100644 --- a/deps/libexpat/libexpat.gyp +++ b/deps/libexpat/libexpat.gyp @@ -7,6 +7,12 @@ # ./out/Debug/test { + # Same Node 26 / node-gyp 10 workaround as in ../../binding.gyp. gyp loads + # dependency .gyp files in their own variable scope, so the default has to + # live here too — the parent binding.gyp's variables don't propagate down. + 'variables': { + 'enable_thin_lto%': 'false', + }, 'target_defaults': { 'default_configuration': 'Debug', 'configurations': {