Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bazelisk past v1.21.0 #8119

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions buildpatches/bazelisk.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
diff --git a/BUILD b/BUILD
index 59efe64..672f82d 100644
index 8b32e96..ae97ba4 100644
--- a/BUILD
+++ b/BUILD
@@ -1,5 +1,4 @@
@@ -1,4 +1,3 @@
-load("@aspect_rules_js//npm:defs.bzl", "npm_package", "stamped_package_json")
load("@bazel_gazelle//:def.bzl", "gazelle")
-load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

# gazelle:prefix github.com/bazelbuild/bazelisk
@@ -151,23 +150,3 @@ go_binary(
pure = "on",
visibility = ["//visibility:public"],
@@ -125,28 +124,3 @@ genrule(
"@platforms//os:macos",
],
)
-
-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",
- ":bazelisk-windows-arm64",
- ":package",
- ],
- package = "@bazel/bazelisk",
- publishable = True,
-)
13 changes: 5 additions & 8 deletions cli/bazelisk/bazelisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ func Run(args []string, opts *RunOpts) (exitCode int, err error) {
if err := setBazelVersion(); err != nil {
return -1, fmt.Errorf("failed to set bazel version: %s", err)
}
gcs := &repositories.GCSRepo{}
bazeliskConf := core.MakeDefaultConfig()
gitHub := repositories.CreateGitHubRepo(bazeliskConf.Get("BAZELISK_GITHUB_TOKEN"))
// Fetch releases, release candidates and Bazel-at-commits from GCS, forks from GitHub
repos := core.CreateRepositories(gcs, gcs, gitHub, gcs, gcs, true)
repos := createRepositories(core.MakeDefaultConfig())

if opts.Stdout != nil {
close, err := redirectStdio(opts.Stdout, &os.Stdout)
Expand Down Expand Up @@ -159,9 +155,10 @@ func redirectStdio(w io.Writer, stdio **os.File) (close func(), err error) {

func createRepositories(bazeliskConf config.Config) *core.Repositories {
gcs := &repositories.GCSRepo{}
gitHub := repositories.CreateGitHubRepo(bazeliskConf.Get("BAZELISK_GITHUB_TOKEN"))
// Fetch releases, release candidates and Bazel-at-commits from GCS, forks from GitHub
return core.CreateRepositories(gcs, gcs, gitHub, gcs, gcs, true)
config := core.MakeDefaultConfig()
gitHub := repositories.CreateGitHubRepo(config.Get("BAZELISK_GITHUB_TOKEN"))
// Fetch LTS releases & candidates, rolling releases and Bazel-at-commits from GCS, forks from GitHub.
return core.CreateRepositories(gcs, gitHub, gcs, gcs, true)
}

func getBazeliskHome(bazeliskConf config.Config) (string, error) {
Expand Down
28 changes: 14 additions & 14 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
name = "com_github_bazelbuild_bazelisk",
build_file_generation = "on",
importpath = "github.com/bazelbuild/bazelisk",
sum = "h1:TOh9touXYcKKiZqE+Dj4XD/FHrzsqmu9iDvPTsW9jIc=",
version = "v1.19.0",
sum = "h1:Jf3Frcg+7hE9P14xDg9XJaOVDzIz+3e1r9fXoDvfVSw=",
version = "v0.0.0-20250107101242-0a4dc6b170da",
)
go_repository(
name = "com_github_bazelbuild_buildtools",
Expand Down Expand Up @@ -1998,8 +1998,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_gofrs_flock",
importpath = "github.com/gofrs/flock",
sum = "h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=",
version = "v0.8.1",
sum = "h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=",
version = "v0.12.1",
)
go_repository(
name = "com_github_gogo_googleapis",
Expand Down Expand Up @@ -2542,8 +2542,8 @@ def install_go_mod_dependencies(workspace_name = "buildbuddy"):
go_repository(
name = "com_github_hashicorp_go_version",
importpath = "github.com/hashicorp/go-version",
sum = "h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=",
version = "v1.6.0",
sum = "h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=",
version = "v1.7.0",
)
go_repository(
name = "com_github_hashicorp_golang_lru",
Expand Down Expand Up @@ -6511,26 +6511,26 @@ def install_static_dependencies(workspace_name = "buildbuddy"):
)
http_file(
name = "com_github_bazelbuild_bazelisk-bazelisk-darwin-amd64",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-darwin-amd64"],
sha256 = "f2ba5f721a995b54bab68c6b76a340719888aa740310e634771086b6d1528ecd",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-darwin-amd64"],
sha256 = "0af019eeb642fa70744419d02aa32df55e6e7a084105d49fb26801a660aa56d3",
executable = True,
)
http_file(
name = "com_github_bazelbuild_bazelisk-bazelisk-darwin-arm64",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-darwin-arm64"],
sha256 = "69fa21cd2ccffc2f0970c21aa3615484ba89e3553ecce1233a9d8ad9570d170e",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-darwin-arm64"],
sha256 = "b13dd89c6ecd90944ca3539f5a2c715a18f69b7458878c471a902a8e482ceb4b",
executable = True,
)
http_file(
name = "com_github_bazelbuild_bazelisk-bazelisk-linux-amd64",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64"],
sha256 = "d28b588ac0916abd6bf02defb5433f6eddf7cba35ffa808eabb65a44aab226f7",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64"],
sha256 = "fd8fdff418a1758887520fa42da7e6ae39aefc788cf5e7f7bb8db6934d279fc4",
executable = True,
)
http_file(
name = "com_github_bazelbuild_bazelisk-bazelisk-linux-arm64",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64"],
sha256 = "861a16ba9979613e70bd3d2f9d9ab5e3b59fe79471c5753acdc9c431ab6c9d94",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-arm64"],
sha256 = "4c8d966e40ac2c4efcc7f1a5a5cceef2c0a2f16b957e791fa7a867cce31e8fcb",
executable = True,
)
http_file(
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/aws/smithy-go v1.13.5
github.com/awslabs/soci-snapshotter v0.1.0
github.com/bazelbuild/bazel-gazelle v0.41.0
github.com/bazelbuild/bazelisk v1.19.0
github.com/bazelbuild/bazelisk v0.0.0-20250107101242-0a4dc6b170da
github.com/bazelbuild/buildtools v0.0.0-20240918101019-be1c24cc9a44
github.com/bazelbuild/rules_go v0.51.0
github.com/bazelbuild/rules_webtesting v0.0.0-20210910170740-6b2ef24cfe95
Expand Down Expand Up @@ -270,6 +270,7 @@ require (
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/glog v1.2.1 // indirect
Expand All @@ -291,7 +292,7 @@ require (
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-sockaddr v1.0.6 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
Expand Down
9 changes: 6 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/bazelbuild/bazel-gazelle v0.41.0 h1:blh57YCxe3QNFbzRtEuLxaak+f5KYSQynznGnUNDRc4=
github.com/bazelbuild/bazel-gazelle v0.41.0/go.mod h1:SRCc60YGZ27y+BqLzQ+nMh249+FyZz7YtX/V2ng+/z4=
github.com/bazelbuild/bazelisk v1.19.0 h1:TOh9touXYcKKiZqE+Dj4XD/FHrzsqmu9iDvPTsW9jIc=
github.com/bazelbuild/bazelisk v1.19.0/go.mod h1:EwrQdJpNWr17zu6UWVk49YBNZ9MkIgTkOUwfTIeaRnc=
github.com/bazelbuild/bazelisk v0.0.0-20250107101242-0a4dc6b170da h1:Jf3Frcg+7hE9P14xDg9XJaOVDzIz+3e1r9fXoDvfVSw=
github.com/bazelbuild/bazelisk v0.0.0-20250107101242-0a4dc6b170da/go.mod h1:EcD+apTi37Jq7m9B2eXXCO/xxd8FoSeUwmNsIxb7uDo=
github.com/bazelbuild/buildtools v0.0.0-20240918101019-be1c24cc9a44 h1:FGzENZi+SX9I7h9xvMtRA3rel8hCEfyzSixteBgn7MU=
github.com/bazelbuild/buildtools v0.0.0-20240918101019-be1c24cc9a44/go.mod h1:PLNUetjLa77TCCziPsz0EI8a6CUxgC+1jgmWv0H25tg=
github.com/bazelbuild/rules_go v0.51.0 h1:og6AqW7T4uFgcySRYn/EFg5VUHR2KY7jypYmVeIGh9k=
Expand Down Expand Up @@ -795,6 +795,8 @@ github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=
github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -992,8 +994,9 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down
Loading