Repository navigation
fix: compile Node 24+ prebuilds as C++20 - #28
Merged
Merged
Conversation
prebuildify passes the Node version as --target. That path treated every target as Electron and selected C++17 below version 32, overriding Node's gnu++20 default. Node 24.18 headers require C++20, so the macOS publish prebuild failed and cancelled the rest of the release matrix. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Member
Author
|
CI launches Mocha through test/index.js and never called node --test, so the new compiler-standard checks did not run. Run them before Mocha from both npm test and npm run mocha. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
npm test forwards npm_config_runtime into the new checks. An electron or node-webkit value made the Node 23 fixture select C++17 and stopped the suite before Mocha. Node fixtures now drop that inherited setting unless a test sets it on purpose. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
erunion
added this pull request to stack #30
October 8, 2026 22:43
The Actions list was showing these workflows by filename. Give them the same display names added on the closed prebuild-split branch. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
erunion
marked this pull request as ready for review
October 8, 2026 23:31
jboyens
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The 3.3.0 publish run failed while building the macOS Node 24 prebuild (job). Fail-fast cancelled the rest of the
buildmatrix, so the package was never published.prebuildifycompiles each release binary withnode-gyp --target=<that Node version>. For this run the Node 24 target was24.18.0.utils/defaultCxxStandard.jstreated every--targetas an Electron version, and Electron versions below 32 are compiled as C++17. The Node 24 build was therefore forced onto-std=c++17.That flag replaces the
gnu++20default that ships in Node's headers (common.gypi). Node 24.18's V8 headers require C++20, so compilation stopped insrc/async_worker.cc:The same override is in the Linux
cflags_ccpath. Those jobs were cancelled when the macOS build failed, before they reached the C++ sources. The musl jobs are a separate matrix and succeeded: their Docker build setsCXXFLAGS, which makesbinding.gypskip its own-stdflag and leave Node'sgnu++20in place.The test workflow on the same commit passed.
npm installthere does not pass--target, so the standard comes from the running process's Node ABI. Node 24 is ABI 137, which already selects C++20.Fix
--targetis now read as a Node version. Electron and NW.js are detected on their own, fromnpm_config_runtime(electronornode-webkit) or frombuilt_with_electronin the downloaded headers.Tests
utils/defaultCxxStandard.test.jsruns at the start ofnpm test(fromtest/index.js, before Mocha) and at the start ofnpm run mocha. CI usesnpm test, so these checks run on every test job. They do not load the native addon.Node fixtures drop an inherited
npm_config_runtime. An Electron or NW.js install environment no longer makes the Node 23 and 24 checks select C++17 and stop the suite. Tests that passnpm_config_runtimeexplicitly still cover the Electron mapping.Workflow names
.github/workflows/publish.ymlis named Publish and.github/workflows/tests.ymlis named Tests, so the Actions list no longer shows those workflows by filename. Prebuilds stay inside Publish; they are not a separate workflow that runs on every pull request.