-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: add common defines
#23426
build: add common defines
#23426
Conversation
/CC @nodejs/build-files @nodejs/addon-api @nodejs/node-gyp |
Currently this will cause a lot of deprecation warning for the node build:
So we can consider unsetting |
As explained in #23167, I don’t think the OpenSSL defines should or need to end up here. |
That does make sense, but ATM we do define it for the node build:
(and every other architecture), so this just synchronizes how we build, and what we export to addons. /CC @nodejs/crypto should it be undefined for the node build? |
If we're going to suddenly enable warnings for native addons, |
We can decide to do that, but I’d not consider it |
It would be advantageous to have this in node11 |
# `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures. | ||
'OPENSSL_THREADS' | ||
'V8_DEPRECATION_WARNINGS', | ||
'V8_IMMINENT_DEPRECATION_WARNINGS', |
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.
Just to understand this better, what are the differences between these two?
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.
Example: https://github.com/nodejs/node/pull/23414/files
AFAIU V8_DEPRECATION_WARNINGS
makes API points marked with V8_DEPRECATED
marked [[deprecated]]
V8_IMMINENT_DEPRECATION_WARNINGS
makes thant for API points marked with V8_DEPRECATE_SOON
.
Similar to node's policy V8_DEPRECATED
are not-recommended for use, and can be removed in the next V8 version. V8_DEPRECATE_SOON
can only be demoted to V8_DEPRECATED
in a next version.
/CC @hashseed, right?
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.
ATM we do turn on V8_DEPRECATION_WARNINGS
for node build, and native addons builds.
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.
So V8_IMMINENT_DEPRECATION_WARNINGS
will report DEPRECATE_SOON
and V8_DEPRECATION_WARNINGS
will report the normal deprecation, right?
Fair enough. I'm just mindful that the majority of users seeing these will be users installing the addons (probably as dependencies of other modules) who are unlikely to be in a position to do something about them and may be asking why they are suddenly appearing with a new version of Node.js. Maybe at least it should be called out in the release notes? |
@jkrems Given nodejs/nan#811 (comment), do you maybe want to weigh in here? |
@addaleax Thanks for the ping!
Is there any way this could not be enabled for things coming from dependencies? I don't think there's any value for 3rd party dependencies, other than causing a lot of non-actionable noise. The issue is that I've seen a lot of teams we support start writing hacks and workarounds to get rid of these warnings if they originated in code they don't control. Even worse: warnings that cannot be directly addressed drown out other, more critical issues and can send people on wild goose chases. In other words: Can we make sure that the people who see these new warnings are mostly (or even only) the people who can actually fix them? |
I think we can but we'll need to patch |
This could break addons with -Werror
Hmm, I just learned that some addons use |
IMHO that's a good thing, it will best way to notify the authors ahead of time or
|
That’s … interesting. @joyeecheung Do you know how much “some addons” is? If we do enable warnings for those, every deprecation would already be as bad as the breaking change itself, which completely defeats the purpose of deprecations… |
What happens when you combine I'll go check... |
Much work to be done for that. (and we'll need to exclude all the |
/CC @nodejs/release @nodejs/addon-api PTAL |
a1060a4
to
c159847
Compare
c159847
to
af968e2
Compare
Sample CI: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/1491/ @nodejs/tsc PTAL: ATM this will produce a significant amount of new warning when compiling node. Last audit gross number is 673, of which 175 are unique. |
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.
Let's land it first - at least it will take a while to actually reach the addon ecosystem, in the meantime we can fix our warnings first
* `V8_DEPRECATION_WARNINGS` is here for explicity. It is already defined in `node.gypi`, and `addon.gypi`. * `V8_IMMINENT_DEPRECATION_WARNINGS` added to warn addons authors. * `OPENSSL_THREADS` apears in the openSSL `.h` files, and was only defined via GYP for the node build. PR-URL: nodejs#23426 Fixes: nodejs#23167 Refs: nodejs#23122 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
af968e2
to
765766b
Compare
@@ -503,7 +513,18 @@ | |||
'ldflags': [ | |||
'-Wl,--export-dynamic', | |||
], | |||
}] | |||
}], | |||
['node_shared_openssl!="true"', { |
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.
@refack You suggested that to avoid OpenSSL flags being passed to icu (and thus triggering an icu rebuild when switching between shared/non-shared openssl, a change that doesn't effect icu), I could "Add OPENSSL_THREADS
to the else clause.", but I'm not sure what you mean by else clause here. Can you elaborate, and I'll make the change and test it?
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.
cf. #25135
V8_DEPRECATION_WARNINGS
is here for explicity. It is already definedin
node.gypi
, andaddon.gypi
.V8_IMMINENT_DEPRECATION_WARNINGS
added to warn addons authors.OPENSSL_THREADS
apears in the openSSL.h
files, and was onlydefined via GYP for the node build.
Refs: #23122
Refs: #23414 (comment)
Fixes: #23167
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes