src: migrate from deprecated SnapshotCreator constructor
Previously we have been using the variant of SnapshotCreator that only passes the external references instead of v8::Isolate::CreateParams and it's about to be deprecated. Switch to using the new constructor that takes a fully CreateParams instead.
This also makes sure that the snapshot building script is using the Node.js array buffer allocator instead of a separate default one that was previously used by the old constructor. The zero fill toggle in the Node.js array buffer allocator would still be ignored during snapshot building, however, until we fixes the array buffer allocator and let V8 own the toggle backing store instead, because otherwise the snapshot would contain the external toggle address and become unreproducible.
Review requested:
- [ ] @nodejs/startup
CI: https://ci.nodejs.org/job/node-test-pull-request/63012/
Codecov Report
Attention: Patch coverage is 87.50000% with 5 lines in your changes missing coverage. Please review.
Project coverage is 90.24%. Comparing base (
29af9ce) to head (b007f46). Report is 6 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| lib/internal/buffer.js | 72.22% | 5 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #55337 +/- ##
=======================================
Coverage 90.24% 90.24%
=======================================
Files 630 630
Lines 185670 185688 +18
Branches 36405 36407 +2
=======================================
+ Hits 167555 167574 +19
Misses 10998 10998
+ Partials 7117 7116 -1
| Files with missing lines | Coverage Ξ | |
|---|---|---|
| lib/internal/process/pre_execution.js | 95.96% <ΓΈ> (+0.40%) |
:arrow_up: |
| src/api/embed_helpers.cc | 75.98% <100.00%> (+1.36%) |
:arrow_up: |
| src/node_buffer.cc | 67.20% <100.00%> (-0.31%) |
:arrow_down: |
| src/node_snapshotable.cc | 75.52% <100.00%> (+0.13%) |
:arrow_up: |
| lib/internal/buffer.js | 98.49% <72.22%> (-0.26%) |
:arrow_down: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
I assume the labels were removed because of the awkward GitHub UI.
CI: https://ci.nodejs.org/job/node-test-pull-request/63177/
It seems the checksum of the read only snapshots are mismatched after the changes. Need to look into a bit..
CI: https://ci.nodejs.org/job/node-test-pull-request/66222/
Failed to start CI
β Commits were pushed since the last approving review: β - src: migrate from deprecated SnapshotCreator constructor β - fixup! src: migrate from deprecated SnapshotCreator constructor β Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/14424311872
CI: https://ci.nodejs.org/job/node-test-pull-request/66229/
CI: https://ci.nodejs.org/job/node-test-pull-request/66253/
CI: https://ci.nodejs.org/job/node-test-pull-request/66265/ π
Landed in b2405e9b075e
I checked the following:
-
4968db1de4c560088de27d84543af9f029217321 zero-fills allocUnsafe,
4968db1^doesn't -
494669b2f2a22cd9aa351e42dfec06b2d8e68cd1 zero-fills allocUnsafe,
494669b^doesn't -
1e4871cfb173da9543045fe9d8dbbf6a4fe14799 zero-fills allocUnsafe,
1e4871c^too,1e4871c^^doesn't
- b2405e9b075e5637f250cf57e93c0bd6f3189f9b zero-fills allocUnsafe,
b2405e9^doesn't
b2405e9b075e5637f250cf57e93c0bd6f3189f9b was landed