diff --git a/MODULE.bazel b/MODULE.bazel index 087193836..306aa70e1 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -96,20 +96,6 @@ node_dev = use_extension( "node", dev_dependency = True, ) -use_repo(node_dev, "node16_linux_amd64") -use_repo(node_dev, "node16_darwin_arm64") -use_repo(node_dev, "node16_darwin_amd64") -use_repo(node_dev, "node16_linux_arm64") -use_repo(node_dev, "node16_linux_s390x") -use_repo(node_dev, "node16_linux_ppc64le") -use_repo(node_dev, "node16_windows_amd64") -use_repo(node_dev, "node18_linux_amd64") -use_repo(node_dev, "node18_darwin_arm64") -use_repo(node_dev, "node18_darwin_amd64") -use_repo(node_dev, "node18_linux_arm64") -use_repo(node_dev, "node18_linux_s390x") -use_repo(node_dev, "node18_linux_ppc64le") -use_repo(node_dev, "node18_windows_amd64") use_repo(node_dev, "node20_linux_amd64") use_repo(node_dev, "node20_darwin_arm64") use_repo(node_dev, "node20_darwin_amd64") @@ -131,15 +117,11 @@ use_repo(node_dev, "node24_linux_arm64") use_repo(node_dev, "node24_linux_s390x") use_repo(node_dev, "node24_linux_ppc64le") use_repo(node_dev, "node24_windows_amd64") -node_dev.toolchain(node_version = "18.20.4") -node_dev.toolchain( - name = "node16", - node_version = "16.20.0", -) -node_dev.toolchain( - name = "node18", - node_version = "18.20.4", -) + +# default name+version +node_dev.toolchain() + +# additional custom name+versions node_dev.toolchain( name = "node20", node_version = "20.17.0", diff --git a/examples/js_binary/npm_version_test.js b/examples/js_binary/npm_version_test.js index 3e7b54054..6936d9055 100644 --- a/examples/js_binary/npm_version_test.js +++ b/examples/js_binary/npm_version_test.js @@ -1,4 +1,4 @@ const assert = require('assert') const child_process = require('child_process') const npmVersion = child_process.execSync('npm --version').toString().trim() -assert.equal(npmVersion, '10.7.0') +assert.equal(npmVersion, '10.8.2') diff --git a/js/private/test/BUILD.bazel b/js/private/test/BUILD.bazel index 61819ff8d..4e668b442 100644 --- a/js/private/test/BUILD.bazel +++ b/js/private/test/BUILD.bazel @@ -72,32 +72,26 @@ if (parseInt(process.version.slice(1)) !== parseInt(process.argv[2])) { js_test( name = "main_default_toolchain", - args = ["18"], - entry_point = "binary_version.js", -) - -js_test( - name = "main_toolchain_18", - args = ["18"], - entry_point = "binary_version.js", - # using the select statement will download toolchains for all three platforms - # you can also just provide an individual toolchain if you don't want to download them all - node_toolchain = select({ - "@bazel_tools//src/conditions:linux_x86_64": "@node18_linux_amd64//:node_toolchain", - "@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain", - "@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain", - }), -) - -js_test( - name = "main_toolchain_20", args = ["20"], entry_point = "binary_version.js", - # using the select statement will download toolchains for all three platforms - # you can also just provide an individual toolchain if you don't want to download them all - node_toolchain = select({ - "@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain", - "@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain", - "@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain", - }), ) + +[ + js_test( + name = "main_toolchain_%s" % version, + args = [version], + entry_point = "binary_version.js", + # using the select statement will download toolchains for all three platforms + # you can also just provide an individual toolchain if you don't want to download them all + node_toolchain = select({ + "@bazel_tools//src/conditions:linux_x86_64": "@node%s_linux_amd64//:node_toolchain" % version, + "@bazel_tools//src/conditions:darwin": "@node%s_darwin_amd64//:node_toolchain" % version, + "@bazel_tools//src/conditions:windows": "@node%s_windows_amd64//:node_toolchain" % version, + }), + ) + for version in [ + "20", + "22", + "24", + ] +] diff --git a/js/private/test/image/checksum_test.expected b/js/private/test/image/checksum_test.expected index b6aae24ba..82f8b4810 100644 --- a/js/private/test/image/checksum_test.expected +++ b/js/private/test/image/checksum_test.expected @@ -1,4 +1,4 @@ -91b7822d971ff2561696d8db681172e53b05160b597925f5a03d08f5f4ee8d6f js/private/test/image/cksum_node +c01c8dc7e9a202ec0f0e1bd4e48afcdfc4c71c27ebe186275d525eeb199b29ac js/private/test/image/cksum_node 052600f3a82ab6a4cc12cab7384971c960f9c589fdbfcf21bca563c36ff7d16e js/private/test/image/cksum_package_store_3p 971f291232f3ab63aff37fb66c96fbf0eddc05ea9564b9673d0d2c9bfe958994 js/private/test/image/cksum_package_store_1p febf95a6d554c9bda3f0515bfd5ef273ac67d31c231d8162beaef8c4b7bc72f3 js/private/test/image/cksum_node_modules diff --git a/js/private/test/image/custom_layers_nomatch_test_node.listing b/js/private/test/image/custom_layers_nomatch_test_node.listing index f828926ba..35b612246 100644 --- a/js/private/test/image/custom_layers_nomatch_test_node.listing +++ b/js/private/test/image/custom_layers_nomatch_test_node.listing @@ -14,4 +14,4 @@ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin. drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/ --r-xr-xr-x 0 0 0 91342624 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node +-r-xr-xr-x 0 0 0 97607264 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node diff --git a/js/private/test/image/custom_owner_test_node.listing b/js/private/test/image/custom_owner_test_node.listing index 9d7763243..f0a6a2687 100644 --- a/js/private/test/image/custom_owner_test_node.listing +++ b/js/private/test/image/custom_owner_test_node.listing @@ -13,4 +13,4 @@ drwxr-xr-x 0 100 0 0 Jan 1 1970 ./js/private/test/image/bin.runf drwxr-xr-x 0 100 0 0 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/ drwxr-xr-x 0 100 0 0 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/ drwxr-xr-x 0 100 0 0 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/ --r-xr-xr-x 0 100 0 91342624 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node +-r-xr-xr-x 0 100 0 97607264 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node diff --git a/js/private/test/image/default_test_node.listing b/js/private/test/image/default_test_node.listing index a643959eb..ccc0308fc 100644 --- a/js/private/test/image/default_test_node.listing +++ b/js/private/test/image/default_test_node.listing @@ -13,4 +13,4 @@ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./js/private/test/image/bin.runf drwxr-xr-x 0 0 0 0 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/ --r-xr-xr-x 0 0 0 91342624 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node +-r-xr-xr-x 0 0 0 97607264 Jan 1 1970 ./js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node diff --git a/js/private/test/image/non_ascii/custom_layer_groups_test_node.listing b/js/private/test/image/non_ascii/custom_layer_groups_test_node.listing index 480acc973..4f5ece3df 100644 --- a/js/private/test/image/non_ascii/custom_layer_groups_test_node.listing +++ b/js/private/test/image/non_ascii/custom_layer_groups_test_node.listing @@ -14,4 +14,4 @@ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/non_ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/non_ascii/bin2.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/non_ascii/bin2.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/non_ascii/bin2.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/ --r-xr-xr-x 0 0 0 91342624 Jan 1 1970 ./app/js/private/test/image/non_ascii/bin2.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node +-r-xr-xr-x 0 0 0 97607264 Jan 1 1970 ./app/js/private/test/image/non_ascii/bin2.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node diff --git a/js/private/test/image/regex_edge_cases_test_node.listing b/js/private/test/image/regex_edge_cases_test_node.listing index f828926ba..35b612246 100644 --- a/js/private/test/image/regex_edge_cases_test_node.listing +++ b/js/private/test/image/regex_edge_cases_test_node.listing @@ -14,4 +14,4 @@ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin. drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/ drwxr-xr-x 0 0 0 0 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/ --r-xr-xr-x 0 0 0 91342624 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node +-r-xr-xr-x 0 0 0 97607264 Jan 1 1970 ./app/js/private/test/image/bin.runfiles/rules_nodejs~~node~nodejs_linux_amd64/bin/nodejs/bin/node diff --git a/js/private/test/node-patches/BUILD.bazel b/js/private/test/node-patches/BUILD.bazel index b549aed71..f5980e134 100644 --- a/js/private/test/node-patches/BUILD.bazel +++ b/js/private/test/node-patches/BUILD.bazel @@ -21,8 +21,10 @@ CJS_TESTS = [ # Multiple node toolchains for testing across versions TOOLCHAINS_NAMES = [ - "node16", - "node18", + # default name+version + "nodejs", + + # custom versions for tests "node20", "node22", "node24",