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
build: compile with C++20 support #45427
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
I see a lot of
|
I think V8 built fine. There's an error in
Any suggestions? |
If I understand https://unicode-org.atlassian.net/browse/ICU-22014 correctly, we need to build ICU with |
I pushed a commit try to fix, not verified |
Looks similar problem to DeserializeRequest error. |
hmm, what if we use designated initializers? e.g. instead of |
GCC 8 and 9 expect |
I found the cause: https://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf, we need to remove all the constructors of the aggregate type, even the diff --git a/src/env.h b/src/env.h
index 3d44e0acbd..8fbd48d58d 100644
--- a/src/env.h
+++ b/src/env.h
@@ -499,9 +499,6 @@ struct DeserializeRequest {
v8::Global<v8::Object> holder;
int index;
InternalFieldInfoBase* info = nullptr; // Owned by the request
-
- // Move constructor
- DeserializeRequest(DeserializeRequest&& other) = default;
};
struct EnvSerializeInfo {
@@ -565,13 +562,6 @@ struct SnapshotData {
static bool FromBlob(SnapshotData* out, FILE* in);
~SnapshotData();
-
- SnapshotData(const SnapshotData&) = delete;
- SnapshotData& operator=(const SnapshotData&) = delete;
- SnapshotData(SnapshotData&&) = delete;
- SnapshotData& operator=(SnapshotData&&) = delete;
-
- SnapshotData() = default;
};
void DefaultProcessExitHandlerInternal(Environment* env, ExitCode exit_code); |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Most platforms build passed. MSVC comes no surprise, v8 failed on MSVC. 15:01:24 C:\workspace\node-compile-windows\node\deps\v8\src\handles\handles.h(143,37): error C2027: use of undefined type 'v8::internal::Object' [C:\workspace\node-compile-windows\node\tools\v8_gypfiles\v8_base_without_compiler.vcxproj]
|
See https://bugs.chromium.org/p/chromium/issues/detail?id=1377771#c4 This is fixed in recent versions of MSVC. |
So when latest MSVC released, we only have issues on freebsd and alpine. Run into less issues than I think. But I still want gcc-10 as a minimum on next major. |
The GCC issue may be fixed by #52083 |
Added #52083 to try a new CI run. |
Unfortunately, we're still blocked on the |
V8 and Chromium are starting to use C++20 features. Only Visual Studio 2022 17.6 includes a version of MSVC with sufficient C++20 support to compile V8. Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=1284275 Refs: nodejs#45427 PR-URL: nodejs#49051 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Ruy Adorno <ruyadorno@google.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Here's a repro of the compiler error: godbolt link
Edit: forgot about #45427 (comment), which shows the same. |
Required to enable C++20 support. Refs: nodejs/node#45427
I opened nodejs/build#3700 to skip Alpine 3.18 and I'm working on downgrading GCC to version 11 on Debian 12. |
Required to enable C++20 support. Refs: nodejs/node#45427
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.
🫡
For people reading this: I strongly suspect that the problem is not with V8 or Node.js, but rather a compiler/runtime library issue. That is, it is warranted to 'force' the issue. |
Interestingly https://ci.nodejs.org/job/node-test-commit-linuxone/43448/nodes=rhel8-s390x/ succeeded with gcc 12.2.1 (gcc-toolset-12 on RHEL 8). |
@richardlau Yes. It is probably not a compiler bug per se... hence "compiler/runtime library issue". |
Closes: #45402