Update expected sha256sums for Node.js 3e7ddc77635f6225b8cba469b948752d16decdb94293b13ea6c9ce4792526d2e node-v20.19.6-alpine-arm64 39f3a1fb1c83ecd3483e4335124bd9282dba239fcdf85430b7aea8fbfb8a1206 node-v20.19.6-alpine-x64 3f19fd984a558d2b3cc2f78fae2a3927b9d87a631ad454eeccf7ffd10e7c6f19 node-v20.19.6-linux-arm64 de270a8b37db68307fead80ddb75718c5599d4a96004d052588e24fac0a5e8f5 node-v20.19.6-linux-x64 049aefa14949d95ded5e3761b263171b1a5d430c1b6af10ab82ffbdfd945507a node-v20.19.6-linuxstatic-arm64 96b66e0cb1bc3f53e4e652e4a1b4d1c51acec13d2c9136c7cb0f565d75ba60f5 node-v20.19.6-linuxstatic-armv7 ddc9c76e002e6e1768139099d27bf297bf564750187cef230e3113f773a97724 node-v20.19.6-linuxstatic-x64 4f50f1d0484cc69043abacd266de603773dc84a2d5ae0233453c701fed0d2241 node-v20.19.6-macos-arm64 9ed57a94c5dfc099fc262884b633fad61a7fba19b4b43ca2fd7a2ec0ffa5580d node-v20.19.6-macos-x64 a0384fe007e78340cc863224dafd5a6de5c97b83ea8c764e1f31abfeaea07d03 node-v20.19.6-win-arm64 3203fce16436a5e78f77e927c2d1616404d567e20fd11d9f21cb41aa524978a7 node-v20.19.6-win-x64 7795a8932f8dfdebc3636cf83bfa69b7da2e4256dbfa99fe39a4c201a95d70f8 node-v24.12.0-alpine-arm64 d157149a911313dda8ceb6bc93096d531a850b0e6c1b76b2ac721e4f49413ce9 node-v24.12.0-alpine-x64 9a5816b9e3552bb5a914aeed16326a569e18dcc17f07ad8dd28b4a7fa67066a4 node-v24.12.0-linux-arm64 81a0b40e6d7d14d501e100a5a1f08eb3621c2323ee66c6bfd42f7bf7407b06dc node-v24.12.0-linux-x64 fdb80c730160db3157923e8fef52df595aba597757affb9f7c0e11c5562f4ccd node-v24.12.0-linuxstatic-arm64 4f9f3c2a1e3155f4203f8043e04412e7be90dc16ac7f78341083f9f1076b138c node-v24.12.0-linuxstatic-x64 9dffdd09697f041369fec623e86dc866f00a4daaa9da84808f7352372339d9de node-v24.12.0-macos-arm64 a7e48452945f37a831f96ab49f52d5049b989c68137cd398553787d3d1b14554 node-v24.12.0-macos-x64 9db6863e384aa746d1ae369c38aa11f3e46550240bb0abcbedb27d2a085c669d node-v24.12.0-win-arm64 78eda417c8baf713d1790b8b42d8e6eec846101bb4249776d68069d64d240570 node-v24.12.0-win-x64 Co-authored-by: robertsLando <robertsLando@users.noreply.github.com> |
||
|---|---|---|
| .github | ||
| .vscode | ||
| lib | ||
| patches | ||
| scripts | ||
| .dockerignore | ||
| .eslintignore | ||
| .eslintrc | ||
| .gitignore | ||
| .prettierignore | ||
| .release-it.json | ||
| CHANGELOG.md | ||
| DEVELOPMENT.md | ||
| Dockerfile.alpine | ||
| Dockerfile.alpine-muslcc | ||
| Dockerfile.linux | ||
| Dockerfile.linuxcross | ||
| license.md | ||
| package.json | ||
| README.md | ||
| shas.txt | ||
| tsconfig.json | ||
| yarn.lock | ||
A utility to fetch or build patched Node binaries used by pkg to generate executables. This repo hosts prebuilt binaries in Releases.
Binary Compatibility
| Node | Platform | Architectures | Minimum OS version |
|---|---|---|---|
| 81, 101, 121, 141, 161, 18, 20, 22 | alpine | x64, arm64 | 3.7.3, other distros with musl libc >= 1.1.18 |
| 81, 101, 121, 141, 161 | linux | x64 | Enterprise Linux 7, Ubuntu 14.04, Debian jessie, other distros with glibc >= 2.17 |
| 18, 20, 22 | linux | x64 | Enterprise Linux 8, Ubuntu 20.04, Debian buster, other distros with glibc >= 2.28 |
| 81, 101, 121, 141, 161 | linux | arm64 | Enterprise Linux 8, Ubuntu 18.04, Debian buster, other distros with glibc >= 2.27 |
| 18, 20, 22 | linux | arm64 | Enterprise Linux 9, Ubuntu 20.04, Debian bullseye, other distros with glibc >= 2.31 |
| 81, 101, 121, 141, 161, 18, 20, 22 | linuxstatic | x64, arm64 | Any distro with Linux Kernel >= 2.6.32 (>= 3.10 strongly recommended) |
| 161, 18, 20, 22 | linuxstatic | armv72 | Any distro with Linux Kernel >= 2.6.32 (>= 3.10 strongly recommended) |
| 81, 101, 121, 141, 161, 18, 20, 22 | macos | x64 | 10.13 |
| 141, 161, 18, 20, 22 | macos | arm643 | 11.0 |
| 81, 101, 121, 141, 161, 18, 20, 22 | win | x64 | 8.1 |
| 141, 161, 18, 20, 22 | win | arm64 | 10 |
[1]: end-of-life, may be removed in the next major release.
[2]: best-effort basis, not semver-protected.
[3]: mandatory code signing is enforced by Apple.
Security
We do not expect this project to have vulnerabilities of its own. Nonetheless, as this project distributes prebuilt Node.js binaries,
Node.js security vulnerabilities affect binaries distributed by this project, as well.
Like most of you, this project does not have access to advance/private disclosures of Node.js security vulnerabilities. We can only closely monitor the public security advisories from the Node.js team. It takes time to build and release a new set of binaries, once a new Node.js version has been released.
It is possible for this project to fall victim to a supply chain attack.
This project deploys multiple defense measures to ensure that the safe binaries are delivered to users:
- Binaries are compiled by Github Actions
- Workflows and build logs are transparent and auditable.
- Artifacts are the source of truth. Even repository/organization administrators can't tamper them.
- Hashes of binaries are hardcoded in source
- Origins of the binaries are documented.
- Changes to the binaries are logged by VCS (Git) and are publicly visible.
pkg-fetchrejects the binary if it does not match the hardcoded hash.
- GPG-signed hashes are available in Releases
- Easy to spot a compromise.
pkg-fetchpackage on npm is strictly permission-controlled- Only @robertsLando can push new revisions to npm.
Contributing Updates to Patches
Example workflow for applying patches to a new version of Node.js (18.13.0)
-
Clone Node.js as a sibling to your current
pkg-fetchclonegit clone -b v18.13.0 --single-branch https://github.com/nodejs/node.gitcd node
-
Attempt to apply the closest patch (e.g. applying the existing patch for 18.12.1 when trying to generate a new patch for 18.13.0)
git apply ..\pkg-fetch\patches\node.v18.12.1.cpp.patch --reject
- If no rejects, great! you are ready to make your new patch file.
git add -Agit diff --staged --src-prefix=node/ --dst-prefix=node/ > ..\pkg-fetch\patches\node.v18.13.0.cpp.patch
- If rejects exist, resolve them yourself, and ensure all changes are saved, and repeat step 4 to export the patch file
Resolving Rejects
Usually when a patch is rejected, it's because the context around the changes
was refactored slightly since the last patched version. This is not usually
complicated to resolve, but requires a human to interpret the changes since the
last version pkg was patched against, compared with the version you wish to
create a patch for.
One method is to pull up the diff for the file where the rejects apply for the
changes between the last tag (e.g. v18.12.1 to use the previous example) and the
tag you want a patch for (e.g. v18.13.0 to use the previous example). Alongside
this, have the .rej file and go through each rejected hunk by hunk and use
your best judgement to determine how it should apply against the new tag.
Save you results, and export the overall git diff with the commands from the example above.
Checking that patches apply cleanly
The expectation is that a patch applies cleanly, with no delta or offsets from the source repo.
When making a change to a patch file, it is possible to apply that patch without building by running
yarn applyPatches --node-range node18
where the --node-range can be specified to apply patches for the version of
node for which you are updating patches. If unspecified, the latest node version
in patches.json will be used.
Ultimately, the patch should result in fully functional node binary, but the
applyPatches script can be used to quickly iterate just the application of
the patches you are updating without needing to wait for the full build to
complete.
Building a Binary Locally
You can use the yarn start script to build the binary locally, which is helpful
when updating patches to ensure functionality before pushing patch updates for
review.
For example:
yarn start --node-range node18 --arch x64 --output dist
Small ICU
Node.js binaries built by this project use the small-icu option to reduce the size of the binary. If you need a Node.js binary with full ICU support, you can build it yourself by setting the --with-intl=full-icu option. Small ICU is sufficient for most use cases, and it reduces the binary size by about 30 MB.
Environment
| Var | Description |
|---|---|
PKG_BUILD_PATH |
Directory to use to clone and build nodejs binaries. Default to system temporary directory |
PKG_CACHE_PATH |
Path to pkg-cache. Default to ~/.pkg-cache |
PKG_IGNORE_TAG |
Ignore tag folder when checking local binary path |
PKG_NODE_PATH |
Custom path to the local nodejs binary to use |
HTTPS_PROXY |
Optional HTTPS proxy to use when fetching binaries |
HTTP_PROXY |
Optional HTTP proxy to use when fetching binaries |
MAKE_JOB_COUNT |
Number of parallel jobs when building binaries (value passed to make -j option). Default to number of cpus |
CFLAGS |
Flags to use when invoking C compiler |
CXXFLAGS |
Flags to use when invoking C++ compiler |
STRIP |
Path to strip command. Default to strip |