node icon indicating copy to clipboard operation
node copied to clipboard

src: migrate from deprecated SnapshotCreator constructor

Open joyeecheung opened this issue 1 year ago β€’ 5 comments

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.

joyeecheung avatar Oct 09 '24 16:10 joyeecheung

Review requested:

  • [ ] @nodejs/startup

nodejs-github-bot avatar Oct 09 '24 16:10 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/63012/

nodejs-github-bot avatar Oct 09 '24 16:10 nodejs-github-bot

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:

... and 26 files with indirect coverage changes

: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.

codecov[bot] avatar Oct 09 '24 18:10 codecov[bot]

I assume the labels were removed because of the awkward GitHub UI.

legendecas avatar Oct 10 '24 07:10 legendecas

CI: https://ci.nodejs.org/job/node-test-pull-request/63177/

nodejs-github-bot avatar Oct 18 '24 12:10 nodejs-github-bot

It seems the checksum of the read only snapshots are mismatched after the changes. Need to look into a bit..

joyeecheung avatar Oct 25 '24 13:10 joyeecheung

CI: https://ci.nodejs.org/job/node-test-pull-request/66222/

nodejs-github-bot avatar Apr 12 '25 18:04 nodejs-github-bot

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 PR
https://github.com/nodejs/node/actions/runs/14424311872

github-actions[bot] avatar Apr 12 '25 23:04 github-actions[bot]

CI: https://ci.nodejs.org/job/node-test-pull-request/66229/

nodejs-github-bot avatar Apr 12 '25 23:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66253/

nodejs-github-bot avatar Apr 14 '25 12:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66265/ πŸ’›

nodejs-github-bot avatar Apr 14 '25 16:04 nodejs-github-bot

Landed in b2405e9b075e

jasnell avatar Apr 14 '25 19:04 jasnell

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

ChALkeR avatar Oct 27 '25 04:10 ChALkeR