sea: only assert snapshot main function for main threads
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
Review requested:
- [ ] @nodejs/single-executable
- [ ] @nodejs/startup
CI: https://ci.nodejs.org/job/node-test-pull-request/63850/
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: |
CI: https://ci.nodejs.org/job/node-test-pull-request/63873/
CI: https://ci.nodejs.org/job/node-test-pull-request/63899/
CI: https://ci.nodejs.org/job/node-test-pull-request/63914/
Landed in 7fdeeac4d34a66c023ab3c1bb791f123031a82fb