Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nodejs/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load(":config.bzl", "NODEJS_ARCHITECTURES", "NODEJS_DISTROS", "NODEJS_MAJOR_VERSIONS")
load(":config.bzl", "NODEJS_ARCHITECTURES", "NODEJS_DISTROS", "NODEJS_MAJOR_VERSIONS", "NODEJS_PACKAGES")
load(":nodejs.bzl", "nodejs_image", "nodejs_image_index")

package(default_visibility = ["//visibility:public"])
Expand All @@ -8,6 +8,7 @@ package(default_visibility = ["//visibility:public"])
arch = arch,
distro = distro,
major_version = major_version,
packages = NODEJS_PACKAGES[major_version],
Comment thread
loosebazooka marked this conversation as resolved.
)
for distro in NODEJS_DISTROS
for major_version in NODEJS_MAJOR_VERSIONS
Expand Down
8 changes: 8 additions & 0 deletions nodejs/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ NODEJS_ARCHITECTURES = {
},
}
NODEJS_MAJOR_VERSIONS = ["22", "24", "26"]

NODEJS_PACKAGES = {
"22": [],
"24": [],
"26": [
Comment thread
loosebazooka marked this conversation as resolved.
"libatomic1",
],
}
14 changes: 6 additions & 8 deletions nodejs/nodejs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,28 @@ def _check_certificates_tar():
srcs = ["testdata/check_certificate.js"],
)

def nodejs_image(distro, major_version, arch):
def nodejs_image(distro, major_version, arch, packages):
"""nodejs and debug image with tests.

Args:
distro: name of distribution
major_version: version of nodejs
arch: the target arch
packages: any deb packages to add to the image
"""

# node 26 and later dynamically link libatomic.so.1, which isn't in the cc base image.
# Layer libatomic1 onto the nodejs26+ images only so we don't bloat other images.
extra_tars = []
if int(major_version) >= 26:
extra_tars = [deb.package(arch, distro, "libatomic1")]

for mode in DEBUG_MODE:
for user in USERS:
oci_image(
name = "nodejs" + major_version + mode + "_" + user + "_" + arch + "_" + distro,
base = "//cc:cc" + mode + "_" + user + "_" + arch + "_" + distro,
entrypoint = ["/nodejs/bin/node"],
tars = [
deb.package(arch, distro, pkg)
for pkg in packages
] + [
"@nodejs" + major_version + "_" + arch,
] + extra_tars,
],
)
Comment thread
loosebazooka marked this conversation as resolved.

_check_certificates_tar()
Expand Down
Loading