-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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: use higher version c++ #16501
Conversation
I guess my main question here would be, what’s the motivation for this? We’re still stuck with C++11 for now, and |
https://ci.nodejs.org/job/node-test-commit/13465/ /cc @nodejs/build @nodejs/platform-freebsd |
@targos and V8 I assume - nodejs/build#945 |
@targos Does bumping to |
@addaleax It doesn't :( CI results: I think we should align with V8 as much as possible. Luckily, their constraints are very similar to ours: they can use C++14 features if it compiles in GCC 4.8. |
common.gypi
Outdated
'cflags_cc': [ '-std=c++14' ], | ||
}, { | ||
'cflags_cc': [ '-std=gnu++11' ], | ||
}], |
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.
maybe keep that for FreeBSD since mac seems to ignore it
@@ -10,7 +10,9 @@ | |||
'component%': 'static_library', # NB. these names match with what V8 expects | |||
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way | |||
'python%': 'python', | |||
|
|||
'gas_version%': 0, | |||
'llvm_version%': 0, |
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.
What is this?
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.
It's a variable set in the configure script when clang is detected.
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.
I'm confused. The configure script wasn't modified in this PR. How come these two lines weren't necessary before?
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.
In order to check llvm_version
version (without first doing "feature detection"), we need these vars with default value (90f055f).
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.
P.S. It not necessary in the current changeset, so I could move this to a new PR
@@ -211,6 +214,9 @@ | |||
# and their sheer number drowns out other, more legitimate warnings. | |||
'DisableSpecificWarnings': ['4267'], | |||
'WarnAsError': 'false', | |||
'AdditionalOptions': [ | |||
'/std:c++14' |
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.
Unnecessary, both VS2015 and VS2015 default to /std:c++14
.
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.
I'd rather have this (1) for being explicit (2) for future proofing, in case the default changes to C++17 or higher
Why C++11 if C++14 is necessary for V8? |
because GCC 4.8 does not support C++14 and our build infra is still on this version. |
If this doesn't solve the V8 problem, then what's the point? |
The V8 problem is with Clang. To fix it we need |
I'm -1 on using different C++ versions on clang and gcc. Since gcc supports |
Then wouldn't it make sense to upgrade to 4.9 and stop using 4.8? |
@bnoordhuis I agree, but that seems like a non-trivial thing to do now: nodejs/build#945 (comment) |
Sure would. I've been trying to help with that, but it's been stuck on Ubuntu 14.04 and CentOS 6 for the last 3 months: nodejs/build#797, nodejs/build#809 |
Canary build with |
Just to make sure I’m understanding this correctly: The purpose of this patch is to fix a compile error in V8 that happens only with clang and for which bumping to |
@addaleax Yes. the main goal is to fix a compile error. The secondary is to build with a configuration closer to what the V8 team has to prevent errors in the future. |
@targos Thanks, that is the information I was looking for. I kind of agree with @seishun’s sentiment that it’s a bad idea to have some people running C++14 and some people running C++11. I think upgrading to a requirement of C++14 (as |
I'm OK with semver-major. I can float the commit in |
I'm a bit reluctant on this but as long as it's semver-major then ok |
I fail to see how this is semver-major. |
It is unless we take care to ensure that the build keeps working with older libstdc++ versions (ref.) More precisely, we need to ensure that it doesn't stop working with edit: https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html for details. |
I'm pretty sure none of that has anything to do with the |
You'd be surprised. The language level and the standard library go hand in hand. At least, on Linux they do. |
I'd love to see some reference for that. |
Closing as suggested. @refack please reopen if you feel differently. |
Use c++14 on all Windows and
clang
using platformsUse c++11 on all GCC using platforms
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
build