pkg-fetch/lib
faulpeltz a4bdb1649a
feat: node 24 support and attempt some Node 22 fixes (by @faulpeltz) (#107)
This PR adds Node24 support

**Node/V8 changes:**
- Move to new V8 syntax for some constructs (e.g. Cast<>)
- Tracked down two issues which caused the read-only snapshot to be
different across platforms:
- in `read-only-serializer:258` the "live" pointer gets overwritten by
the encoded slot (EncodedTagged).
If V8_COMPRESS_POINTERS is not enabled, EncodedTagged is 4 bytes, but
the live pointer is 8 bytes.
memcpy() only copies EncodeTagged leaving 4bytes of "garbage" (=previous
upper pointer half) which is semi-random per run - fixed this by
clearing the whole value first
- the CSA_HOLE_SECURITY_CHECK macro somehow leaves a string with a
platform-dependent filename in the readonly heap as a constant, replaced
that with "placeholder"
- add PKG_TRACE_READONLY_HEAP blocks for debugging further snapshot
issues

Those fixes partially fix the sourceless cross-build issues introduced
in Node 22 - For my test builds linux/linuxstatic/alpine/win on x64 are
now compatible again. The heap contents on macos builds and other arm64
is wildly different, not sure why. I don't think this kind of
compatibility is a goal for the V8 snapshot implementation in general.
(This affects Node SEA as well, but SEA always has the source to fall
back onto, which incurs a small performance hit)

**Build Changes:**

- Update linux/linuxcross build to use gcc 12 (required for Node 24)
- For aloine/linuxstatic: Node 24 doesn't build on the muslcc image used
previously, the image is unmaintained (although the toolchain builder
isn't, we could build our own image)
- Moved alpine/linuxstatic to native Alpine x64/arm64 toolchains, which
seems to work quite well
- Some minor upgrades to the Windows build, but had to enable `full-icu`
for now because the ICU code gen step crashes with `small-icu` on the GH
action build runners (not on my Windows test machine though)
- Moved the macos build to macos 14 which is now required for Node 24 -
x64 is now cross-built from arm64 because GH doesn't offer free macos14
x64 build workers
- Removed all builds for Node 18 and older
- 
**Notes:**
- Needs more testing, I did some basic testing for x64 builds as well as
macos/arm64
- I added a backport of the snapshot-determinism fixes to the latest
Node 22 patch
2025-09-17 14:50:36 +02:00
..
apply-patches.ts Add applyPatches script and some basic patch documentation (#251) 2023-01-27 20:09:06 -06:00
bin.ts CI: output to dist/ with "node-*" prefix (#156) 2021-04-07 17:59:50 +08:00
build.ts feat: node 24 support and attempt some Node 22 fixes (by @faulpeltz) (#107) 2025-09-17 14:50:36 +02:00
expected-shas.json feat: update expected SHAs for Node.js versions 20.19.4 and 22.17.1 2025-07-19 13:40:24 +02:00
expected.ts expected: Refactor SHAs into sorted, machine-updatable json format 2023-03-28 10:15:03 +02:00
generate-expected-shas.ts update sha sorting algorithm to coerce to semver sorting 2023-03-28 10:15:03 +02:00
index.ts refactor: replace chalk and fs-extra (#53) 2024-10-17 06:56:51 +00:00
log.ts refactor: replace chalk and fs-extra (#53) 2024-10-17 06:56:51 +00:00
places.ts feat: support for custom PKG_NODE_PATH (#7) 2023-10-17 08:50:13 +02:00
print-hashes.ts update sha sorting algorithm to coerce to semver sorting 2023-03-28 10:15:03 +02:00
system.ts feat: add riscv64 and loong64 to known archs (#62) 2024-11-20 13:57:29 +01:00
tsconfig.json expected: Refactor SHAs into sorted, machine-updatable json format 2023-03-28 10:15:03 +02:00
utils.ts fix: improved error when downloading from GitHub fails 2025-07-17 08:37:51 +02:00
verify.ts feat: support for latest NodeJS v20 (#11) 2023-12-04 09:09:51 +01:00