From 6b62fb2da4fa34fe30030c07f57df85c0c2c4d1e Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 2 Apr 2024 21:25:58 -0400 Subject: [PATCH] refactor: set minimum aspect_bazel_lib to 2.7.1 (#1580) chore: bump minimum bazel-lib version to 2.7.1 Fixes #159 --- MODULE.bazel | 2 +- e2e/gyp_no_install_script/WORKSPACE | 9 --------- e2e/js_run_devserver/MODULE.bazel | 2 +- e2e/npm_translate_lock/MODULE.bazel | 2 +- e2e/npm_translate_lock_auth/MODULE.bazel | 1 - e2e/npm_translate_lock_empty/MODULE.bazel | 2 +- e2e/npm_translate_lock_git+ssh/MODULE.bazel | 1 - e2e/npm_translate_lock_multi/MODULE.bazel | 1 - e2e/npm_translate_lock_partial_clone/MODULE.bazel | 1 - e2e/npm_translate_lock_subdir_patch/MODULE.bazel | 1 - e2e/npm_translate_package_lock/MODULE.bazel | 1 - e2e/npm_translate_yarn_lock/MODULE.bazel | 1 - e2e/package_json_module/MODULE.bazel | 1 - e2e/pnpm_workspace/WORKSPACE | 15 +++------------ e2e/pnpm_workspace_deps/MODULE.bazel | 1 - e2e/pnpm_workspace_deps/WORKSPACE | 15 +++------------ e2e/pnpm_workspace_rerooted/MODULE.bazel | 1 - e2e/rules_foo/MODULE.bazel | 6 ++++++ e2e/update_pnpm_lock/MODULE.bazel | 1 - e2e/update_pnpm_lock_with_import/MODULE.bazel | 1 - e2e/vendored_node/MODULE.bazel | 1 - e2e/vendored_tarfile/MODULE.bazel | 1 - e2e/verify_patches/MODULE.bazel | 1 - e2e/webpack_devserver/MODULE.bazel | 1 - e2e/webpack_devserver_esm/MODULE.bazel | 1 - e2e/worker/MODULE.bazel | 2 +- js/private/BUILD.bazel | 1 + js/repositories.bzl | 6 +++--- 28 files changed, 21 insertions(+), 58 deletions(-) create mode 100644 e2e/rules_foo/MODULE.bazel diff --git a/MODULE.bazel b/MODULE.bazel index 188d89ddd..1c9d146c0 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,7 +8,7 @@ module( # Lower-bounds (minimum) versions for direct runtime dependencies. # Do not bump these unless rules_js requires a newer version to function. -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "bazel_features", version = "1.9.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") diff --git a/e2e/gyp_no_install_script/WORKSPACE b/e2e/gyp_no_install_script/WORKSPACE index 91c77771e..a43d69b45 100644 --- a/e2e/gyp_no_install_script/WORKSPACE +++ b/e2e/gyp_no_install_script/WORKSPACE @@ -1,17 +1,8 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - local_repository( name = "aspect_rules_js", path = "../..", ) -http_archive( - name = "aspect_bazel_lib", - sha256 = "b554eb7942a5ab44c90077df6a0c76fc67c5874c9446a007e9ba68be82bd4796", - strip_prefix = "bazel-lib-2.7.1", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.7.1/bazel-lib-v2.7.1.tar.gz", -) - load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") rules_js_dependencies() diff --git a/e2e/js_run_devserver/MODULE.bazel b/e2e/js_run_devserver/MODULE.bazel index e494368cd..d0d7d9c42 100644 --- a/e2e/js_run_devserver/MODULE.bazel +++ b/e2e/js_run_devserver/MODULE.bazel @@ -4,7 +4,7 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "aspect_rules_js", version = "0.0.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "rules_go", version = "0.46.0") diff --git a/e2e/npm_translate_lock/MODULE.bazel b/e2e/npm_translate_lock/MODULE.bazel index d141a9404..c83b1fcea 100644 --- a/e2e/npm_translate_lock/MODULE.bazel +++ b/e2e/npm_translate_lock/MODULE.bazel @@ -5,7 +5,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "aspect_rules_js", version = "0.0.0") bazel_dep(name = "platforms", version = "0.0.8") diff --git a/e2e/npm_translate_lock_auth/MODULE.bazel b/e2e/npm_translate_lock_auth/MODULE.bazel index 88f7e6982..b3beb9aa9 100644 --- a/e2e/npm_translate_lock_auth/MODULE.bazel +++ b/e2e/npm_translate_lock_auth/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/npm_translate_lock_empty/MODULE.bazel b/e2e/npm_translate_lock_empty/MODULE.bazel index fb2d59f5d..6b6bda52c 100644 --- a/e2e/npm_translate_lock_empty/MODULE.bazel +++ b/e2e/npm_translate_lock_empty/MODULE.bazel @@ -5,7 +5,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "aspect_rules_js", version = "0.0.0") bazel_dep(name = "platforms", version = "0.0.8") diff --git a/e2e/npm_translate_lock_git+ssh/MODULE.bazel b/e2e/npm_translate_lock_git+ssh/MODULE.bazel index 4e1c35ec0..e99465505 100644 --- a/e2e/npm_translate_lock_git+ssh/MODULE.bazel +++ b/e2e/npm_translate_lock_git+ssh/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/npm_translate_lock_multi/MODULE.bazel b/e2e/npm_translate_lock_multi/MODULE.bazel index c096de81e..4f55561b7 100644 --- a/e2e/npm_translate_lock_multi/MODULE.bazel +++ b/e2e/npm_translate_lock_multi/MODULE.bazel @@ -4,7 +4,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( diff --git a/e2e/npm_translate_lock_partial_clone/MODULE.bazel b/e2e/npm_translate_lock_partial_clone/MODULE.bazel index 048984ae4..1d3c70bcb 100644 --- a/e2e/npm_translate_lock_partial_clone/MODULE.bazel +++ b/e2e/npm_translate_lock_partial_clone/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/npm_translate_lock_subdir_patch/MODULE.bazel b/e2e/npm_translate_lock_subdir_patch/MODULE.bazel index 75e2ca156..972ad6778 100644 --- a/e2e/npm_translate_lock_subdir_patch/MODULE.bazel +++ b/e2e/npm_translate_lock_subdir_patch/MODULE.bazel @@ -1,4 +1,3 @@ -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/npm_translate_package_lock/MODULE.bazel b/e2e/npm_translate_package_lock/MODULE.bazel index f707e0396..957f9b26a 100644 --- a/e2e/npm_translate_package_lock/MODULE.bazel +++ b/e2e/npm_translate_package_lock/MODULE.bazel @@ -4,7 +4,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( diff --git a/e2e/npm_translate_yarn_lock/MODULE.bazel b/e2e/npm_translate_yarn_lock/MODULE.bazel index a827a3eae..a4b07e9c9 100644 --- a/e2e/npm_translate_yarn_lock/MODULE.bazel +++ b/e2e/npm_translate_yarn_lock/MODULE.bazel @@ -4,7 +4,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( diff --git a/e2e/package_json_module/MODULE.bazel b/e2e/package_json_module/MODULE.bazel index 6e7d90fe8..d6b31cce7 100644 --- a/e2e/package_json_module/MODULE.bazel +++ b/e2e/package_json_module/MODULE.bazel @@ -4,7 +4,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/pnpm_workspace/WORKSPACE b/e2e/pnpm_workspace/WORKSPACE index ca46f54d4..2e8911717 100644 --- a/e2e/pnpm_workspace/WORKSPACE +++ b/e2e/pnpm_workspace/WORKSPACE @@ -1,16 +1,11 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - local_repository( name = "aspect_rules_js", path = "../..", ) -http_archive( - name = "aspect_bazel_lib", - sha256 = "ac6392cbe5e1cc7701bbd81caf94016bae6f248780e12af4485d4a7127b4cb2b", - strip_prefix = "bazel-lib-2.6.1", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.6.1/bazel-lib-v2.6.1.tar.gz", -) +load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") + +rules_js_dependencies() load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "register_coreutils_toolchains") @@ -18,10 +13,6 @@ aspect_bazel_lib_dependencies() register_coreutils_toolchains() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") - -rules_js_dependencies() - load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") nodejs_register_toolchains( diff --git a/e2e/pnpm_workspace_deps/MODULE.bazel b/e2e/pnpm_workspace_deps/MODULE.bazel index 77ed21c4f..497869aa9 100644 --- a/e2e/pnpm_workspace_deps/MODULE.bazel +++ b/e2e/pnpm_workspace_deps/MODULE.bazel @@ -4,7 +4,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/pnpm_workspace_deps/WORKSPACE b/e2e/pnpm_workspace_deps/WORKSPACE index 045f9f238..1d7985616 100644 --- a/e2e/pnpm_workspace_deps/WORKSPACE +++ b/e2e/pnpm_workspace_deps/WORKSPACE @@ -1,16 +1,11 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - local_repository( name = "aspect_rules_js", path = "../..", ) -http_archive( - name = "aspect_bazel_lib", - sha256 = "b554eb7942a5ab44c90077df6a0c76fc67c5874c9446a007e9ba68be82bd4796", - strip_prefix = "bazel-lib-2.7.1", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.7.1/bazel-lib-v2.7.1.tar.gz", -) +load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") + +rules_js_dependencies() load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "register_coreutils_toolchains") @@ -18,10 +13,6 @@ aspect_bazel_lib_dependencies() register_coreutils_toolchains() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") - -rules_js_dependencies() - load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") nodejs_register_toolchains( diff --git a/e2e/pnpm_workspace_rerooted/MODULE.bazel b/e2e/pnpm_workspace_rerooted/MODULE.bazel index 561bf0f07..a6ae7f8e6 100644 --- a/e2e/pnpm_workspace_rerooted/MODULE.bazel +++ b/e2e/pnpm_workspace_rerooted/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/rules_foo/MODULE.bazel b/e2e/rules_foo/MODULE.bazel new file mode 100644 index 000000000..00bb18361 --- /dev/null +++ b/e2e/rules_foo/MODULE.bazel @@ -0,0 +1,6 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### diff --git a/e2e/update_pnpm_lock/MODULE.bazel b/e2e/update_pnpm_lock/MODULE.bazel index 0c323121d..5f31ee35b 100644 --- a/e2e/update_pnpm_lock/MODULE.bazel +++ b/e2e/update_pnpm_lock/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/update_pnpm_lock_with_import/MODULE.bazel b/e2e/update_pnpm_lock_with_import/MODULE.bazel index d7c6d2700..8d3f14959 100644 --- a/e2e/update_pnpm_lock_with_import/MODULE.bazel +++ b/e2e/update_pnpm_lock_with_import/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/vendored_node/MODULE.bazel b/e2e/vendored_node/MODULE.bazel index 7200365f3..2b1239638 100644 --- a/e2e/vendored_node/MODULE.bazel +++ b/e2e/vendored_node/MODULE.bazel @@ -4,7 +4,6 @@ module( compatibility_level = 1, ) -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") bazel_dep(name = "rules_nodejs", version = "6.1.0") bazel_dep(name = "platforms", version = "0.0.4") diff --git a/e2e/vendored_tarfile/MODULE.bazel b/e2e/vendored_tarfile/MODULE.bazel index 122941654..e23b384a1 100644 --- a/e2e/vendored_tarfile/MODULE.bazel +++ b/e2e/vendored_tarfile/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/verify_patches/MODULE.bazel b/e2e/verify_patches/MODULE.bazel index b09121a21..37b516042 100644 --- a/e2e/verify_patches/MODULE.bazel +++ b/e2e/verify_patches/MODULE.bazel @@ -5,7 +5,6 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/webpack_devserver/MODULE.bazel b/e2e/webpack_devserver/MODULE.bazel index 6e146ed24..e540e49e0 100644 --- a/e2e/webpack_devserver/MODULE.bazel +++ b/e2e/webpack_devserver/MODULE.bazel @@ -1,6 +1,5 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "rules_go", version = "0.46.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/webpack_devserver_esm/MODULE.bazel b/e2e/webpack_devserver_esm/MODULE.bazel index f7f378767..176b6d1a8 100644 --- a/e2e/webpack_devserver_esm/MODULE.bazel +++ b/e2e/webpack_devserver_esm/MODULE.bazel @@ -1,6 +1,5 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "rules_go", version = "0.46.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/worker/MODULE.bazel b/e2e/worker/MODULE.bazel index 9c12c972e..b9d8a7f93 100644 --- a/e2e/worker/MODULE.bazel +++ b/e2e/worker/MODULE.bazel @@ -6,7 +6,7 @@ module( bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "rules_nodejs", version = "6.1.0") -bazel_dep(name = "aspect_bazel_lib", version = "1.42.3") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/js/private/BUILD.bazel b/js/private/BUILD.bazel index 1c98fb3d3..af6e5cb05 100644 --- a/js/private/BUILD.bazel +++ b/js/private/BUILD.bazel @@ -46,6 +46,7 @@ bzl_library( "@aspect_bazel_lib//lib:expand_make_vars", "@aspect_bazel_lib//lib:paths", "@aspect_bazel_lib//lib:windows_utils", + "@bazel_skylib//lib:dicts", ] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if is_bazel_7_or_greater() else []), ) diff --git a/js/repositories.bzl b/js/repositories.bzl index ee02079e5..a8c4c57ad 100644 --- a/js/repositories.bzl +++ b/js/repositories.bzl @@ -23,9 +23,9 @@ def rules_js_dependencies(): http_archive( name = "aspect_bazel_lib", - sha256 = "d0529773764ac61184eb3ad3c687fb835df5bee01afedf07f0cf1a45515c96bc", - strip_prefix = "bazel-lib-1.42.3", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.42.3/bazel-lib-v1.42.3.tar.gz", + sha256 = "b554eb7942a5ab44c90077df6a0c76fc67c5874c9446a007e9ba68be82bd4796", + strip_prefix = "bazel-lib-2.7.1", + url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.7.1/bazel-lib-v2.7.1.tar.gz", ) http_archive(