-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
build: enable -DV8_ENABLE_CHECKS flag #61327
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
|
Review requested:
|
configure.py
Outdated
| def set_configuration_variable_and_defines(configs, name, define, release=None, debug=None): | ||
| set_configuration_variable(configs, name, release, debug) | ||
| if configs['Debug'].get('defines') is None: | ||
| configs['Debug']['defines'] = [] | ||
| if configs['Release'].get('defines') is None: | ||
| configs['Release']['defines'] = [] | ||
| configs['Debug']['defines'].append(define) | ||
| configs['Release']['defines'].append(define) | ||
|
|
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.
This might be a GYP issue, but it seems that variables defined inside a conditions block are not reflected when evaluating other conditions.
In this case, the value of v8_enable_v8_checks set in configure.py (https://github.com/nodejs/node/blob/main/configure.py#L1530-L1532
) does not appear to be used when evaluating the condition 'v8_enable_v8_checks==1' in tools/v8_gypfiles/features.gypi (https://github.com/nodejs/node/blob/main/tools/v8_gypfiles/features.gypi#L405-L407
).
Therefore, I’m setting the defines directly.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61327 +/- ##
==========================================
+ Coverage 89.79% 89.80% +0.01%
==========================================
Files 672 672
Lines 203907 203913 +6
Branches 39196 39200 +4
==========================================
+ Hits 183094 183121 +27
+ Misses 13132 13116 -16
+ Partials 7681 7676 -5
🚀 New features to boost your workflow:
|
lib/util.js
Outdated
| frameCount = MathFloor(frameCount); | ||
| return binding.getCallSites(frameCount); |
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.
| frameCount = MathFloor(frameCount); | |
| return binding.getCallSites(frameCount); | |
| return binding.getCallSites(MathFloor(frameCount)); |
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.
Since this is experimental, would it make more sense to switch to validateInteger?
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.
Agree, I switched to validateInteger to limit it to integers.
| @@ -441,7 +442,7 @@ void BuiltinLoader::SaveCodeCache(const std::string& id, Local<Data> data) { | |||
| new_cached_data.reset( | |||
| ScriptCompiler::CreateCodeCache(mod->GetUnboundModuleScript())); | |||
| } else { | |||
| Local<Function> fun = data.As<Function>(); | |||
| Local<Function> fun = data.As<Value>().As<Function>(); | |||
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.
Why do you need 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.
When V8_ENABLE_CHECKS is enabled, Local::As() fails because v8::Function only supports Cast(Value*), causing a compile error.
https://github.com/nodejs/node/blob/main/deps/v8/include/v8-local-handle.h#L424.
| } else { | ||
| CHECK(value->IsNumber()); | ||
| v8::Isolate* isolate = v8::Isolate::GetCurrent(); | ||
| v8::Local<v8::Context> context = isolate->GetCurrentContext(); | ||
| v8::Maybe<uint32_t> maybe = value->Uint32Value(context); |
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 line 684 why don't you just check for IsUint32?
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.
Because we need to accept signed values for some call sites (e.g. fs.chown), not only strict Uint32.
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
Commit Queue failed- Loading data for nodejs/node/pull/61327 ✔ Done loading data for nodejs/node/pull/61327 ----------------------------------- PR info ------------------------------------ Title build: enable -DV8_ENABLE_CHECKS flag (#61327) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch islandryu:61301 -> nodejs:main Labels c++, build, lib / src, author ready, needs-ci Commits 6 - build: enable -DV8_ENABLE_CHECKS flag - fix lint - fix set_configuration_variable_and_defines - Update lib/util.js - validate frameCount is an integer - use options.debug for branching Committers 1 - islandryu <shimaryuhei@gmail.com> PR-URL: https://github.com/nodejs/node/pull/61327 Fixes: https://github.com/nodejs/node/issues/61301 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/61327 Fixes: https://github.com/nodejs/node/issues/61301 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 09 Jan 2026 11:37:00 GMT ✔ Approvals: 1 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/61327#pullrequestreview-3706160274 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-01-26T12:56:43Z: https://ci.nodejs.org/job/node-test-pull-request/71042/ - Querying data for job/node-test-pull-request/71042/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 61327 From https://github.com/nodejs/node * branch refs/pull/61327/merge -> FETCH_HEAD ✔ Fetched commits as 150d154bf1ba..8541332a7637 -------------------------------------------------------------------------------- [main 7b7478a657] build: enable -DV8_ENABLE_CHECKS flag Author: islandryu <shimaryuhei@gmail.com> Date: Fri Jan 9 20:26:32 2026 +0900 6 files changed, 30 insertions(+), 6 deletions(-) [main 652080ab7b] fix lint Author: islandryu <shimaryuhei@gmail.com> Date: Fri Jan 9 20:40:14 2026 +0900 2 files changed, 3 insertions(+), 2 deletions(-) [main 633ced745a] fix set_configuration_variable_and_defines Author: islandryu <shimaryuhei@gmail.com> Date: Sat Jan 10 22:35:16 2026 +0900 1 file changed, 8 insertions(+), 5 deletions(-) [main 9b44f595b7] Update lib/util.js Author: Ryuhei Shima <65934663+islandryu@users.noreply.github.com> Date: Sat Jan 10 23:03:33 2026 +0900 1 file changed, 1 insertion(+), 2 deletions(-) Auto-merging doc/api/util.md [main fa4d3726fe] validate frameCount is an integer Author: islandryu <shimaryuhei@gmail.com> Date: Sat Jan 10 23:27:27 2026 +0900 3 files changed, 11 insertions(+), 13 deletions(-) [main 21f4afb2dc] use options.debug for branching Author: islandryu <shimaryuhei@gmail.com> Date: Tue Jan 13 18:24:59 2026 +0900 1 file changed, 5 insertions(+), 24 deletions(-) ✔ Patches applied There are 6 commits in the PR. Attempting autorebase. (node:2326) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/12) Executing: git node land --amend --yes ⚠ Found Fixes: https://github.com/nodejs/node/issues/61301, skipping.. --------------------------------- New Message ---------------------------------- build: enable -DV8_ENABLE_CHECKS flaghttps://github.com/nodejs/node/actions/runs/21424254133 |
|
Landed in 74c3658 |
Fixes: #61301
I’ve made changes so that V8_ENABLE_CHECKS is enabled in debug builds.
In addition, I’ve fixed code that caused errors when V8_ENABLE_CHECKS is enabled.