From 58756232aa33ca58ca1d91925d515dd6d8606a6f Mon Sep 17 00:00:00 2001 From: thesayyn Date: Tue, 21 Dec 2021 17:45:08 +0100 Subject: [PATCH] test: add rules_nodejs to integration test --- e2e/core/BUILD.bazel | 26 ++++---- internal/common/copy_to_bin.bzl | 2 +- internal/common/params_file.bzl | 2 +- internal/js_library/js_library.bzl | 2 +- internal/linker/npm_link.bzl | 2 +- internal/node/test/BUILD.bazel | 60 +++++++++---------- internal/pkg_npm/pkg_npm.bzl | 4 +- .../rules/private/copy_file_private.bzl | 2 +- .../rules/private/write_file_private.bzl | 4 +- toolchains/cypress/BUILD.bazel | 16 ++--- toolchains/node/BUILD.bazel | 28 ++++----- 11 files changed, 74 insertions(+), 74 deletions(-) diff --git a/e2e/core/BUILD.bazel b/e2e/core/BUILD.bazel index b541605027..299d346935 100644 --- a/e2e/core/BUILD.bazel +++ b/e2e/core/BUILD.bazel @@ -22,13 +22,13 @@ write_file( # alias( # name = "node_bin", # actual = select({ -# "@rules_nodejs//nodejs:is_darwin_arm64": "@node16_darwin_arm64//:node_bin", -# "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_bin", -# "@rules_nodejs//nodejs:is_linux_arm64": "@node16_linux_arm64//:node_bin", -# "@rules_nodejs//nodejs:is_linux_s390x": "@node16_linux_s390x//:node_bin", -# "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_bin", -# "@rules_nodejs//nodejs:is_linux_ppc64le": "@node16_linux_ppc64le//:node_bin", -# "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@node16_darwin_arm64//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_linux_arm64": "@node16_linux_arm64//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_linux_s390x": "@node16_linux_s390x//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_linux_ppc64le": "@node16_linux_ppc64le//:node_bin", +# "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_bin", # "//conditions:default": "@node16_linux_amd64//:node_bin", # }), # ) @@ -213,9 +213,9 @@ my_nodejs( # 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 toolchain = select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", }), ) @@ -233,9 +233,9 @@ my_nodejs( # 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 toolchain = select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", }), ) diff --git a/internal/common/copy_to_bin.bzl b/internal/common/copy_to_bin.bzl index fd99f23747..3439c842d1 100644 --- a/internal/common/copy_to_bin.bzl +++ b/internal/common/copy_to_bin.bzl @@ -58,7 +58,7 @@ def copy_to_bin(name, srcs, **kwargs): name = name, srcs = srcs, is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True, "//conditions:default": False, }), **kwargs diff --git a/internal/common/params_file.bzl b/internal/common/params_file.bzl index 16798680ce..e752a24b17 100644 --- a/internal/common/params_file.bzl +++ b/internal/common/params_file.bzl @@ -125,7 +125,7 @@ def params_file( data = data, newline = newline or "auto", is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True, "//conditions:default": False, }), **kwargs diff --git a/internal/js_library/js_library.bzl b/internal/js_library/js_library.bzl index 70a5e7f8bf..9d416a3da1 100644 --- a/internal/js_library/js_library.bzl +++ b/internal/js_library/js_library.bzl @@ -445,7 +445,7 @@ def js_library( # TODO: remove once legacy module_mapping is removed module_name = package_name if package_name != "$node_modules$" and package_name != "$node_modules_dir$" else None, is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True, "//conditions:default": False, }), **kwargs diff --git a/internal/linker/npm_link.bzl b/internal/linker/npm_link.bzl index 4723881017..3802bbf512 100644 --- a/internal/linker/npm_link.bzl +++ b/internal/linker/npm_link.bzl @@ -148,7 +148,7 @@ set to the target's package & the files provided from the targets DefaultInfo. package_name = package_name, package_path = package_path, is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True, "//conditions:default": False, }), **kwargs diff --git a/internal/node/test/BUILD.bazel b/internal/node/test/BUILD.bazel index 96d44c940b..9f3baffb45 100644 --- a/internal/node/test/BUILD.bazel +++ b/internal/node/test/BUILD.bazel @@ -558,9 +558,9 @@ nodejs_binary( # 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 toolchain = select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", }), ) @@ -570,9 +570,9 @@ nodejs_binary( # 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 toolchain = select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", }), ) @@ -587,9 +587,9 @@ nodejs_test( # 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 toolchain = select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", }), ) @@ -599,9 +599,9 @@ nodejs_test( # 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 toolchain = select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", }), ) @@ -626,14 +626,14 @@ nodejs_test( # using the select statement will download toolchains for all platforms # you can also just provide an individual toolchain if you don't want to download them all select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", }), select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", }), ], ) @@ -661,14 +661,14 @@ nodejs_test( # using the select statement will download toolchains for all platforms # you can also just provide an individual toolchain if you don't want to download them all select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", }), select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", }), ], ) @@ -697,14 +697,14 @@ nodejs_test( # using the select statement will download toolchains for all platforms # you can also just provide an individual toolchain if you don't want to download them all select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain", }), select({ - "@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain", }), ], ) diff --git a/internal/pkg_npm/pkg_npm.bzl b/internal/pkg_npm/pkg_npm.bzl index b92e6ab144..df491591c1 100644 --- a/internal/pkg_npm/pkg_npm.bzl +++ b/internal/pkg_npm/pkg_npm.bzl @@ -380,7 +380,7 @@ def pkg_npm_macro(name, tgz = None, **kwargs): native.alias( name = name + ".pack", actual = select({ - "@rules_nodejs//nodejs:is_windows_amd64": name + ".pack.bat", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": name + ".pack.bat", "//conditions:default": name + ".pack.sh", }), ) @@ -388,7 +388,7 @@ def pkg_npm_macro(name, tgz = None, **kwargs): native.alias( name = name + ".publish", actual = select({ - "@rules_nodejs//nodejs:is_windows_amd64": name + ".publish.bat", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": name + ".publish.bat", "//conditions:default": name + ".publish.sh", }), ) diff --git a/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl b/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl index 4c024eba01..307242d881 100644 --- a/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl +++ b/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl @@ -209,7 +209,7 @@ def copy_file(name, src, out, is_directory = False, is_executable = False, allow src = src, out = out, is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@bazel_tools//src/conditions:host_windows": True, "//conditions:default": False, }), is_executable = is_executable, diff --git a/third_party/github.com/bazelbuild/bazel-skylib/rules/private/write_file_private.bzl b/third_party/github.com/bazelbuild/bazel-skylib/rules/private/write_file_private.bzl index 697f07273e..a5a69ae72d 100644 --- a/third_party/github.com/bazelbuild/bazel-skylib/rules/private/write_file_private.bzl +++ b/third_party/github.com/bazelbuild/bazel-skylib/rules/private/write_file_private.bzl @@ -95,7 +95,7 @@ def write_file( out = out, newline = newline or "auto", is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@bazel_tools//src/conditions:host_windows": True, "//conditions:default": False, }), **kwargs @@ -107,7 +107,7 @@ def write_file( out = out, newline = newline or "auto", is_windows = select({ - "@rules_nodejs//nodejs:is_windows_amd64": True, + "@bazel_tools//src/conditions:host_windows": True, "//conditions:default": False, }), **kwargs diff --git a/toolchains/cypress/BUILD.bazel b/toolchains/cypress/BUILD.bazel index 8ec1d7eeec..005b376b87 100644 --- a/toolchains/cypress/BUILD.bazel +++ b/toolchains/cypress/BUILD.bazel @@ -38,10 +38,10 @@ toolchain_type(name = "toolchain_type") alias( name = "toolchain", actual = select({ - "@rules_nodejs//nodejs:is_darwin_amd64": ":cypress_darwin_toolchain_config", - "@rules_nodejs//nodejs:is_darwin_arm64": ":cypress_darwin_arm64_toolchain_config", - "@rules_nodejs//nodejs:is_linux_amd64": ":cypress_linux_toolchain_config", - "@rules_nodejs//nodejs:is_windows_amd64": ":cypress_windows_toolchain_config", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": ":cypress_darwin_toolchain_config", + "@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": ":cypress_darwin_arm64_toolchain_config", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": ":cypress_linux_toolchain_config", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": ":cypress_windows_toolchain_config", "//conditions:default": ":cypress_linux_toolchain_config", }), visibility = ["//visibility:public"], @@ -51,10 +51,10 @@ alias( alias( name = "cypress_bin", actual = select({ - "@rules_nodejs//nodejs:is_darwin_amd64": "@cypress_darwin//:bin", - "@rules_nodejs//nodejs:is_darwin_arm64": "@cypress_darwin_arm64//:bin", - "@rules_nodejs//nodejs:is_linux_amd64": "@cypress_linux//:bin", - "@rules_nodejs//nodejs:is_windows_amd64": "@cypress_windows//:bin", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@cypress_darwin//:bin", + "@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@cypress_darwin_arm64//:bin", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@cypress_linux//:bin", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@cypress_windows//:bin", "//conditions:default": "@cypress_linux//:bin", }), visibility = ["//visibility:public"], diff --git a/toolchains/node/BUILD.bazel b/toolchains/node/BUILD.bazel index e4e352906f..afa31dd2e1 100644 --- a/toolchains/node/BUILD.bazel +++ b/toolchains/node/BUILD.bazel @@ -40,13 +40,13 @@ toolchain_type( alias( name = "toolchain", actual = select({ - "@rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64_config//:toolchain", - "@rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64_config//:toolchain", - "@rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64_config//:toolchain", - "@rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x_config//:toolchain", - "@rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64_config//:toolchain", - "@rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64_config//:toolchain", - "@rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64_config//:toolchain", + "@build_bazel_rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le_config//:toolchain", "//conditions:default": "@nodejs_linux_amd64_config//:toolchain", }), visibility = ["//visibility:public"], @@ -56,13 +56,13 @@ alias( alias( name = "node_bin", actual = select({ - "@rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64//:node_bin", - "@rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64//:node_bin", - "@rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64//:node_bin", - "@rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x//:node_bin", - "@rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64//:node_bin", - "@rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le//:node_bin", - "@rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le//:node_bin", + "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64//:node_bin", "//conditions:default": "@nodejs_linux_amd64//:node_bin", }), visibility = ["//visibility:public"],