-
Notifications
You must be signed in to change notification settings - Fork 16k
build: compile Node.js with C++20 support #43555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
script/spec-runner.js
Outdated
// but don't clobber any other CXXFLAGS that were passed into spec-runner.js | ||
const CXXFLAGS = ['-std=c++17', process.env.CXXFLAGS].filter(x => !!x).join(' '); | ||
const CXXFLAGS = ['-std=c++20', process.env.CXXFLAGS].filter(x => !!x).join(' '); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const CXXFLAGS = ['-std=c++20', process.env.CXXFLAGS].filter(x => !!x).join(' '); | |
const CXXFLAGS = ['-std=gnu++20', process.env.CXXFLAGS].filter(x => !!x).join(' '); |
if the CI uses gcc <= 9 then it would be -std=gnu++2a
but no need to make the condition if it passes with the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not new to this PR -- for example, I see we had gnu++17
before -- but does anyone know if the GNU extensions are actually needed here?
Unless we need the GNU extensions, we'd be better off using the standard, i.e. -std=c++20
here and in the patch above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use it but the headers from Node.js could, but I missed this before but we should actually remove the -std
argument from this list, it will get set by common.gypi
when building the native modules. We were overriding previously when headers had c++14 and we wanted to use c++17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepak1556 done in dc1e1bb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
V8 change landed first in Chromium 127, removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
some failures - investigating! |
@codebytere that is the one I mentioned in #43555 (comment). If the CI uses gcc <= 9 which in this case seems to be we would need to override the CXXFLAGS. You can get the version from |
@deepak1556 ah understood - i read #43555 (comment) as meaning we should just remove it entirely. |
You are correct, I did mean we could remove it completely if CI passed by using newer gcc which I was not sure when the comment was made. Given the current failure we had to bring this back. |
bdb9ba0
to
54268fb
Compare
a721ea8
to
898b260
Compare
No Release Notes |
I was unable to backport this PR to "32-x-y" cleanly; |
I have automatically backported this PR to "33-x-y", please check out #43684 |
Is it possible to be merged into 32-x-y branch? |
When is this change expected to be released in an electron version? |
* build: compile with C++20 support * build: update build-image-sha for gcc 10
build: compile Node.js with C++20 support (#43555) * build: compile with C++20 support * build: update build-image-sha for gcc 10 Co-authored-by: Shelley Vohr <[email protected]>
Will there be a new 32-x-y release with this issue fixed? |
Description of Change
Closes #43580
Refs nodejs/node#45427
Refs nodejs/node#52870
V8 updated their required version of c++ in https://chromium-review.googlesource.com/c/v8/v8/+/55
87859 and we did not accordingly follow suit.
Checklist
npm test
passesRelease Notes
Notes: none