Skip to content

Backport the Windows addon LTO fix to node-gyp v12.x #3391

Open

Description

@StefanStojanovic

Hello everyone, would you consider backporting d30bb6e (“disable LTO for addon builds on Windows”) to a new v12.x release?

I have prepared a branch based on v12.4.0 containing the backport. I'm not familiar with the release process for older node-gyp majors, so I'd like to confirm whether this is something the project would consider.

This would unblock nodejs/node#66170, which backports Thin LTO for official Windows builds to Node.js v24. Thin LTO is already enabled in Node.js v26, and PGO changes have already been backported to v24.

The remaining concern is native-addon compatibility: without this fix, Node.js's Thin LTO configuration leaks clang/lld-specific flags into addon builds using the default MSVC toolchain, causing failures. The fix disables LTO for Windows addon builds while preserving it for Node.js itself.

The dependency constraints are:

  • Node.js v24 and v26 bundle npm v11. The Release WG decided not to ship npm v12 in those release lines.
  • npm v11 currently bundles node-gyp v12.
  • node-gyp v13 contains the fix, but its Node.js engine requirements exclude versions that npm v11 still supports, including Node.js v20. Updating npm v11 to node-gyp v13 would therefore conflict with its existing compatibility range.

The proposed path would be:

  • Backport the fix and publish a node-gyp v12.x release.
  • Coordinate with npm maintainers to include that release in npm v11.
  • Update the bundled npm in Node.js v24 and v26.
  • With the addon compatibility fix available, resume review of the Thin LTO backport for Node.js v24.

Would you be open to this backport, and what branch should a PR target?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions