Skip to content

Commit

Permalink
Bump Bazel to 7.1.1 (#564)
Browse files Browse the repository at this point in the history
Switch to bzlmod exclusively (no WORKSPACE anymore).

Fix bzlmod integration with npm. The 5.x series of rules_js is
unmaintained and does not support bzlmod, and the 6.x series only has
toolchains (with no packaging rules). Switch to aspect_rules_js which
is currently the best source of npm packaging rules.
  • Loading branch information
jwnimmer-tri committed Mar 25, 2024
1 parent fec36a9 commit 24935f4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0
7.1.1
17 changes: 10 additions & 7 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@aspect_rules_js//npm:defs.bzl", "npm_package", "stamped_package_json")

# gazelle:prefix github.com/bazelbuild/bazelisk
gazelle(name = "gazelle")
Expand Down Expand Up @@ -152,22 +152,25 @@ go_binary(
visibility = ["//visibility:public"],
)

pkg_npm(
stamped_package_json(
name = "package",
# This key is defined by /stamp.sh
stamp_var = "BUILD_SCM_VERSION",
)

npm_package(
name = "npm_package",
package_name = "@bazel/bazelisk",
srcs = [
"LICENSE",
"README.md",
"bazelisk.d.ts",
"bazelisk.js",
"package.json",
],
substitutions = {"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}"},
deps = [
":bazelisk-darwin-amd64",
":bazelisk-darwin-arm64",
":bazelisk-linux-amd64",
":bazelisk-linux-arm64",
":bazelisk-windows-amd64",
":package",
],
package = "@bazel/bazelisk",
)
3 changes: 1 addition & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module(name = "bazelisk", version="")

bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "gazelle", version = "0.32.0", repo_name = "bazel_gazelle")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_nodejs", version = "5.5.3", repo_name = "build_bazel_rules_nodejs")
bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "aspect_rules_js", version = "1.39.1")
# -- bazel_dep definitions -- #

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
Expand Down
94 changes: 0 additions & 94 deletions WORKSPACE

This file was deleted.

Empty file removed WORKSPACE.bzlmod
Empty file.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@bazel/bazelisk",
"description": "A user-friendly launcher for Bazel",
"version": "0.0.0-PLACEHOLDER",
"license": "Apache-2.0",
"bin": {
"bazelisk": "bazelisk.js",
Expand Down

0 comments on commit 24935f4

Please sign in to comment.