Add nodejs26#2085
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for Node.js 26 to Debian 13 distroless images, updating repository definitions, configuration files, and documentation. It also introduces libatomic1 as a dependency for Node.js 26 to support dynamic linking. Feedback recommends refactoring repository definitions to minimize duplication and ensuring the libatomic1 inclusion logic is forward-compatible for future versions.
| node_archive( | ||
| name = "nodejs26_amd64", | ||
| sha256 = "62d555c329e05e3625109f2e3a8b5195b368d5ef38266292469d32f63cd98ffd", | ||
| strip_prefix = "node-v26.1.0-linux-x64/", | ||
| urls = ["https://nodejs.org/dist/v26.1.0/node-v26.1.0-linux-x64.tar.gz"], | ||
| version = "26.1.0", | ||
| architecture = "amd64", | ||
| control = "//nodejs:control", | ||
| ) | ||
|
|
||
| node_archive( | ||
| name = "nodejs26_arm64", | ||
| sha256 = "fcb4c339eef70c909cae72091008a6497278e2d0fcd221c0653068cf4ea4f0c7", | ||
| strip_prefix = "node-v26.1.0-linux-arm64/", | ||
| urls = ["https://nodejs.org/dist/v26.1.0/node-v26.1.0-linux-arm64.tar.gz"], | ||
| version = "26.1.0", | ||
| architecture = "arm64", | ||
| control = "//nodejs:control", | ||
| ) | ||
|
|
||
| node_archive( | ||
| name = "nodejs26_ppc64le", | ||
| sha256 = "f3ee72a29d3d25a626bae1672667a500b12c284fcfc00f5d6162e3762ebf173f", | ||
| strip_prefix = "node-v26.1.0-linux-ppc64le/", | ||
| urls = ["https://nodejs.org/dist/v26.1.0/node-v26.1.0-linux-ppc64le.tar.gz"], | ||
| version = "26.1.0", | ||
| architecture = "ppc64le", | ||
| control = "//nodejs:control", | ||
| ) | ||
|
|
||
| node_archive( | ||
| name = "nodejs26_s390x", | ||
| sha256 = "6e381e4a3b353f335d297abfe4c7d9485459247519df10445b17cc89d8c7f7a5", | ||
| strip_prefix = "node-v26.1.0-linux-s390x/", | ||
| urls = ["https://nodejs.org/dist/v26.1.0/node-v26.1.0-linux-s390x.tar.gz"], | ||
| version = "26.1.0", | ||
| architecture = "s390x", | ||
| control = "//nodejs:control", | ||
| ) |
There was a problem hiding this comment.
To improve maintainability and reduce code duplication, you could define the version and architecture-specific details in a map and loop over it to generate these node_archive calls. This would make it easier to update in the future.
For example:
NODE26_VERSION = "26.1.0"
NODE26_ARCHS = {
"amd64": ("x64", "62d555c329e05e3625109f2e3a8b5195b368d5ef38266292469d32f63cd98ffd"),
"arm64": ("arm64", "fcb4c339eef70c909cae72091008a6497278e2d0fcd221c0653068cf4ea4f0c7"),
"ppc64le": ("ppc64le", "f3ee72a29d3d25a626bae1672667a500b12c284fcfc00f5d6162e3762ebf173f"),
"s390x": ("s390x", "6e381e4a3b353f335d297abfe4c7d9485459247519df10445b17cc89d8c7f7a5"),
}
for arch, (platform, sha) in NODE26_ARCHS.items():
node_archive(
name = "nodejs26_" + arch,
sha256 = sha,
strip_prefix = "node-v{v}-linux-{p}/".format(v=NODE26_VERSION, p=platform),
urls = ["https://nodejs.org/dist/v{v}/node-v{v}-linux-{p}.tar.gz".format(v=NODE26_VERSION, p=platform)],
version = NODE26_VERSION,
architecture = arch,
control = "//nodejs:control",
)While this would be a good improvement, it would be even better to apply this pattern to the definitions for Node.js 22 and 24 as well for consistency, which could be done in a follow-up change.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| tars = [ | ||
| "@nodejs" + major_version + "_" + arch, | ||
| ], | ||
| ] + extra_tars, |
There was a problem hiding this comment.
we kind of moved away from this style, but I'll change it in a followup.
Adds nodejs 26 support and adds libatomic1
Closes #2077 and #1981