Skip to content

Commit

Permalink
chore: upgrade to Bazel 7.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Apr 2, 2024
1 parent 6199ad0 commit 64e2c31
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
bazel: 6.1.1
bazel: 7.1.1
# Note, this will tell the user to do the wrong thing (manually run buildifer)
# See https://github.com/bazelbuild/continuous-integration/issues/1161
buildifier:
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.1
7.1.1
46 changes: 22 additions & 24 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ write_file(
# alias(
# name = "node_bin",
# actual = select({
# "@bazel_tools//src/conditions:darwin_arm64": "@node16_darwin_arm64//:node_bin",
# "@bazel_tools//src/conditions:darwin_x86_64": "@node16_darwin_amd64//:node_bin",
# "@bazel_tools//src/conditions:linux_aarch64": "@node16_linux_arm64//:node_bin",
# "@bazel_tools//src/conditions:linux_s390x": "@node16_linux_s390x//:node_bin",
# "@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_bin",
# "@bazel_tools//src/conditions:linux_ppc64le": "@node16_linux_ppc64le//:node_bin",
# "@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_bin",
# "//conditions:default": "@node16_linux_amd64//:node_bin",
# "@bazel_tools//src/conditions:darwin_arm64": "@nodejs_darwin_arm64//:node_bin",
# "@bazel_tools//src/conditions:darwin_x86_64": "@nodejs_darwin_amd64//:node_bin",
# "@bazel_tools//src/conditions:linux_aarch64": "@nodejs_linux_arm64//:node_bin",
# "@bazel_tools//src/conditions:linux_s390x": "@nodejs_linux_s390x//:node_bin",
# "@bazel_tools//src/conditions:linux_x86_64": "@nodejs_linux_amd64//:node_bin",
# "@bazel_tools//src/conditions:linux_ppc64le": "@nodejs_linux_ppc64le//:node_bin",
# "@bazel_tools//src/conditions:windows": "@nodejs_windows_amd64//:node_bin",
# "//conditions:default": "@nodejs_linux_amd64//:node_bin",
# }),
# )
# genrule(
Expand Down Expand Up @@ -59,8 +59,8 @@ genrule(
srcs = ["some.js"],
outs = ["actual1"],
cmd = "$(NODE_PATH) $(execpath some.js) $@",
toolchains = ["@node16_toolchains//:resolved_toolchain"],
tools = ["@node16_toolchains//:resolved_toolchain"],
toolchains = ["@nodejs_toolchains//:resolved_toolchain"],
tools = ["@nodejs_toolchains//:resolved_toolchain"],
)

diff_test(
Expand Down Expand Up @@ -120,9 +120,9 @@ genrule(
--compact \\
$(execpath one.js) \\
> $@""",
toolchains = ["@node16_toolchains//:resolved_toolchain"],
toolchains = ["@nodejs_toolchains//:resolved_toolchain"],
tools = [
"@node16_toolchains//:resolved_toolchain",
"@nodejs_toolchains//:resolved_toolchain",
"@npm_acorn-8.5.0",
],
)
Expand Down Expand Up @@ -170,9 +170,9 @@ genrule(
$(NODE_PATH) \\
./$(execpath require_acorn.js) \\
$@""",
toolchains = ["@node16_toolchains//:resolved_toolchain"],
toolchains = ["@nodejs_toolchains//:resolved_toolchain"],
tools = [
"@node16_toolchains//:resolved_toolchain",
"@nodejs_toolchains//:resolved_toolchain",
"@npm_acorn-8.5.0",
],
)
Expand Down Expand Up @@ -228,13 +228,11 @@ my_nodejs(
)

# this tests to make sure that the first version imported in the workspace is used as default
# FIXME: under bzlmod, the first toolchain registered is in the rules_nodejs/MODULE.bazel
# which is the "latest version" of node, not the one in our local MODULE.bazel file.
# diff_test(
# name = "node_version_default_toolchain_test",
# file1 = "write_node_version_16",
# file2 = "thing_no_toolchain",
# )
diff_test(
name = "node_version_default_toolchain_test",
file1 = "write_node_version_16",
file2 = "thing_no_toolchain",
)

# Output contains the version number of node that is used.
# This is used in tests later to verify the toolchain specified is resolved correctly
Expand Down Expand Up @@ -265,9 +263,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({
"@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain",
"@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain",
"@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain",
"@bazel_tools//src/conditions:linux_x86_64": "@nodejs_linux_amd64//:node_toolchain",
"@bazel_tools//src/conditions:darwin": "@nodejs_darwin_amd64//:node_toolchain",
"@bazel_tools//src/conditions:windows": "@nodejs_windows_amd64//:node_toolchain",
}),
)

Expand Down
15 changes: 5 additions & 10 deletions e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ local_path_override(

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")

# Note, this gets the default version of Node.js from
# https://github.com/bazelbuild/rules_nodejs/blob/5.8.0/nodejs/repositories.bzl#L11
node.toolchain(
name = "node16",
node_version = "16.5.0",
)
node.toolchain(node_version = "16.5.0")
node.toolchain(
name = "node15",
node_version = "15.14.0",
Expand All @@ -35,8 +30,8 @@ use_repo(
"node15_darwin_amd64",
"node15_linux_amd64",
"node15_windows_amd64",
"node16_darwin_amd64",
"node16_linux_amd64",
"node16_toolchains",
"node16_windows_amd64",
"nodejs_darwin_amd64",
"nodejs_linux_amd64",
"nodejs_toolchains",
"nodejs_windows_amd64",
)

0 comments on commit 64e2c31

Please sign in to comment.