Skip to content

feat(ci): upgrade python and remove LLVM LTO flags from MSVC build to fix Node 26 Windows CI#1330

Merged
styfle merged 2 commits into
mainfrom
styfle/python-3.14
Jun 5, 2026
Merged

feat(ci): upgrade python and remove LLVM LTO flags from MSVC build to fix Node 26 Windows CI#1330
styfle merged 2 commits into
mainfrom
styfle/python-3.14

Conversation

@styfle
Copy link
Copy Markdown
Member

@styfle styfle commented Jun 5, 2026

Root Cause

Node.js 26 on Windows is compiled using Clang with thin LTO enabled (enable_thin_lto=true, lto_jobs=2). When node-gyp rebuild runs without --nodedir, it generates build/config.gypi from the running Node.js binary's process.config. This causes Node.js's common.gypi to inject LLVM/Clang-specific flags into the MSVC build:

  • -flto=thin → compiler/linker warning (ignored by MSVC)
  • /opt:lldltojobs=2fatal linker error LNK1117 (MSVC does not understand LLVM LTO job flags)

Fix

Modified test/binary/binding.gyp to strip the incompatible LLVM LTO flags when building on Windows with MSVC:

  • Added a "lto_jobs%": "" default variable as a safe fallback for Node versions that do not define this variable
  • Added a Windows-specific conditions block using GYP's AdditionalOptions! list-removal operator to remove -flto=thin, -flto=full, and /opt:lldltojobs=<(lto_jobs) from both VCCLCompilerTool and VCLinkerTool options

The fix is a no-op on Node 22/24 (LTO not enabled, no flags to remove) and does not affect Linux or macOS builds.

Copilot AI changed the title feat: use python 3.14 in ci fix: remove incompatible LLVM LTO flags from MSVC build to fix Node 26 Windows CI Jun 5, 2026
Copilot finished work on behalf of styfle June 5, 2026 16:11
@styfle styfle marked this pull request as ready for review June 5, 2026 17:24
@styfle styfle requested a review from ijjk June 5, 2026 17:24
@styfle styfle changed the title fix: remove incompatible LLVM LTO flags from MSVC build to fix Node 26 Windows CI feat(ci): upgrade python and remove LLVM LTO flags from MSVC build to fix Node 26 Windows CI Jun 5, 2026
@styfle styfle enabled auto-merge (squash) June 5, 2026 17:26
@styfle styfle merged commit 7290aa7 into main Jun 5, 2026
14 checks passed
@styfle styfle deleted the styfle/python-3.14 branch June 5, 2026 21:00
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.

3 participants