node icon indicating copy to clipboard operation
node copied to clipboard

sea: only assert snapshot main function for main threads

Open joyeecheung opened this issue 1 year ago • 5 comments

Snapshot main functions are only loaded for main threads in single executable applications. Update the check to avoid asserting it in worker threads - this allows worker threads to be spawned in snapshot main functions bundled into a single executable application.

(Also noticed that worker_threads cannot be loaded in the snapshot builder script, which is to be expected currently since we haven't vetted the worker_threads module for snapshot building. I left a FIXME on how to vet the worker internals and make it loadable in the snapshot builder).

Fixes: https://github.com/nodejs/node/issues/56077

joyeecheung avatar Dec 03 '24 14:12 joyeecheung

Review requested:

  • [ ] @nodejs/single-executable
  • [ ] @nodejs/startup

nodejs-github-bot avatar Dec 03 '24 14:12 nodejs-github-bot

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

nodejs-github-bot avatar Dec 03 '24 14:12 nodejs-github-bot

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.98%. Comparing base (61e4ad5) to head (630b6f8). Report is 41 commits behind head on main.

Files with missing lines Patch % Lines
src/node.cc 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56120      +/-   ##
==========================================
- Coverage   88.01%   87.98%   -0.03%     
==========================================
  Files         656      656              
  Lines      188982   188960      -22     
  Branches    35997    35978      -19     
==========================================
- Hits       166330   166263      -67     
- Misses      15825    15861      +36     
- Partials     6827     6836       +9     
Files with missing lines Coverage Δ
src/node.cc 73.50% <50.00%> (-0.11%) :arrow_down:

... and 50 files with indirect coverage changes

codecov[bot] avatar Dec 03 '24 15:12 codecov[bot]

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

nodejs-github-bot avatar Dec 04 '24 16:12 nodejs-github-bot

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

nodejs-github-bot avatar Dec 05 '24 14:12 nodejs-github-bot

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

nodejs-github-bot avatar Dec 06 '24 15:12 nodejs-github-bot

Landed in 7fdeeac4d34a66c023ab3c1bb791f123031a82fb

nodejs-github-bot avatar Dec 07 '24 17:12 nodejs-github-bot