From 41c715c4cd874bfcebdd90631f5dc6eee72c6e1a Mon Sep 17 00:00:00 2001 From: Mostyn Bramley-Moore Date: Mon, 16 Sep 2024 01:18:52 +0200 Subject: [PATCH 1/3] Upgrade rules_go to 0.50.1 --- MODULE.bazel | 2 +- MODULE.bazel.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index be8f41fa1..3fe53f125 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ # https://registry.bazel.build/ bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5") -bazel_dep(name = "rules_go", version = "0.50.0", repo_name = "io_bazel_rules_go") +bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go") bazel_dep(name = "gazelle", version = "0.38.0", repo_name = "bazel_gazelle") bazel_dep(name = "rules_proto", version = "6.0.2") bazel_dep(name = "rules_pkg", version = "1.0.1") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 761318641..c726f6626 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -95,8 +95,8 @@ "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", "https://bcr.bazel.build/modules/rules_go/0.47.0/MODULE.bazel": "e425890d2a4d668abc0f59d8388b70bf63ad025edec76a385c35d85882519417", - "https://bcr.bazel.build/modules/rules_go/0.50.0/MODULE.bazel": "168383ee97b0be2308fa008be8b2fd553e86f202dc129bd2692773a71c3ffc2d", - "https://bcr.bazel.build/modules/rules_go/0.50.0/source.json": "80dc7e80dc47621c67439eba633b42b064361cd2f5850702b828bc36935a1b96", + "https://bcr.bazel.build/modules/rules_go/0.50.1/MODULE.bazel": "b91a308dc5782bb0a8021ad4330c81fea5bda77f96b9e4c117b9b9c8f6665ee0", + "https://bcr.bazel.build/modules/rules_go/0.50.1/source.json": "205765fd30216c70321f84c9a967267684bdc74350af3f3c46c857d9f80a4fa2", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", "https://bcr.bazel.build/modules/rules_java/5.1.0/MODULE.bazel": "324b6478b0343a3ce7a9add8586ad75d24076d6d43d2f622990b9c1cfd8a1b15", "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", From 85659de0581979e6e311d07ed2ee1bac4abfd970 Mon Sep 17 00:00:00 2001 From: Mostyn Bramley-Moore Date: Mon, 16 Sep 2024 01:24:37 +0200 Subject: [PATCH 2/3] Drop old io_bazel_rules_go repo name --- BUILD.bazel | 2 +- MODULE.bazel | 4 +-- cache/BUILD.bazel | 2 +- cache/azblobproxy/BUILD.bazel | 2 +- cache/disk/BUILD.bazel | 2 +- cache/disk/casblob/BUILD.bazel | 2 +- cache/disk/zstdimpl/BUILD.bazel | 6 ++-- cache/gcsproxy/BUILD.bazel | 2 +- cache/grpcproxy/BUILD.bazel | 2 +- cache/httpproxy/BUILD.bazel | 2 +- cache/s3proxy/BUILD.bazel | 2 +- config/BUILD.bazel | 2 +- external/gozstd.patch | 30 +++++++++---------- .../build/bazel/remote/asset/v1/BUILD.bazel | 2 +- .../bazel/remote/execution/v2/BUILD.bazel | 2 +- genproto/build/bazel/semver/BUILD.bazel | 2 +- ldap/BUILD.bazel | 2 +- server/BUILD.bazel | 2 +- utils/BUILD.bazel | 2 +- utils/annotate/BUILD.bazel | 2 +- utils/backendproxy/BUILD.bazel | 2 +- utils/fakes3/BUILD.bazel | 2 +- utils/flags/BUILD.bazel | 2 +- utils/grpcreadclient/BUILD.bazel | 2 +- utils/idle/BUILD.bazel | 2 +- utils/rlimit/BUILD.bazel | 2 +- utils/tempfile/BUILD.bazel | 2 +- utils/validate/BUILD.bazel | 2 +- utils/zstdpool/BUILD.bazel | 2 +- 29 files changed, 46 insertions(+), 46 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 9c0aca47f..9f0196d9e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,5 +1,5 @@ load("@bazel_gazelle//:def.bzl", "gazelle") -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_binary", "go_library") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball") load("@rules_pkg//:pkg.bzl", "pkg_tar") diff --git a/MODULE.bazel b/MODULE.bazel index 3fe53f125..9616344ea 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ # https://registry.bazel.build/ bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5") -bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go") +bazel_dep(name = "rules_go", version = "0.50.1") bazel_dep(name = "gazelle", version = "0.38.0", repo_name = "bazel_gazelle") bazel_dep(name = "rules_proto", version = "6.0.2") bazel_dep(name = "rules_pkg", version = "1.0.1") @@ -26,7 +26,7 @@ oci.pull( use_repo(oci, "cgo_arm64_base") # Download an SDK for the host OS & architecture as well as common remote execution platforms. -go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") +go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") go_sdk.download(version = "1.23.0") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") diff --git a/cache/BUILD.bazel b/cache/BUILD.bazel index 75ecb84a4..918fe5538 100644 --- a/cache/BUILD.bazel +++ b/cache/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/cache/azblobproxy/BUILD.bazel b/cache/azblobproxy/BUILD.bazel index 3038c7119..c30650e0e 100644 --- a/cache/azblobproxy/BUILD.bazel +++ b/cache/azblobproxy/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/cache/disk/BUILD.bazel b/cache/disk/BUILD.bazel index dd44026ef..69fa97dd2 100644 --- a/cache/disk/BUILD.bazel +++ b/cache/disk/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/cache/disk/casblob/BUILD.bazel b/cache/disk/casblob/BUILD.bazel index 64df55194..edb3e0b77 100644 --- a/cache/disk/casblob/BUILD.bazel +++ b/cache/disk/casblob/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/cache/disk/zstdimpl/BUILD.bazel b/cache/disk/zstdimpl/BUILD.bazel index 18fe1df78..545cf76b5 100644 --- a/cache/disk/zstdimpl/BUILD.bazel +++ b/cache/disk/zstdimpl/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", @@ -6,7 +6,7 @@ go_library( "gozstd.go", "zstdimpl.go", ] + select({ - "@io_bazel_rules_go//go/toolchain:cgo_on": [ + "@rules_go//go/toolchain:cgo_on": [ "cgozstd.go", ], "//conditions:default": [], @@ -18,7 +18,7 @@ go_library( "@com_github_klauspost_compress//zstd:go_default_library", "@com_github_mostynb_zstdpool_syncpool//:go_default_library", ] + select({ - "@io_bazel_rules_go//go/toolchain:cgo_on": [ + "@rules_go//go/toolchain:cgo_on": [ "@com_github_valyala_gozstd//:go_default_library", ], "//conditions:default": [], diff --git a/cache/gcsproxy/BUILD.bazel b/cache/gcsproxy/BUILD.bazel index caf019164..e0c8ab951 100644 --- a/cache/gcsproxy/BUILD.bazel +++ b/cache/gcsproxy/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/cache/grpcproxy/BUILD.bazel b/cache/grpcproxy/BUILD.bazel index 867039e78..e9c7de338 100644 --- a/cache/grpcproxy/BUILD.bazel +++ b/cache/grpcproxy/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/cache/httpproxy/BUILD.bazel b/cache/httpproxy/BUILD.bazel index b3da81320..5dde90059 100644 --- a/cache/httpproxy/BUILD.bazel +++ b/cache/httpproxy/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/cache/s3proxy/BUILD.bazel b/cache/s3proxy/BUILD.bazel index 193f69012..66e1f2e04 100644 --- a/cache/s3proxy/BUILD.bazel +++ b/cache/s3proxy/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/config/BUILD.bazel b/config/BUILD.bazel index 5e1409d42..010c0b1a2 100644 --- a/config/BUILD.bazel +++ b/config/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/external/gozstd.patch b/external/gozstd.patch index b59ddd752..453176a39 100644 --- a/external/gozstd.patch +++ b/external/gozstd.patch @@ -13,10 +13,10 @@ parsing go files for different platforms, ending with entry like: name = "gozstd", ... clinkopts = select({ - "@io_bazel_rules_go//go/platform:android_amd64": [ + "@rules_go//go/platform:android_amd64": [ "./libzstd_linux_amd64.a", ], - "@io_bazel_rules_go//go/platform:android_arm": [ + "@rules_go//go/platform:android_arm": [ "./libzstd_linux_arm.a", ], ... @@ -40,45 +40,45 @@ index 0000000..ce0ff97 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,97 @@ -+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++load("@rules_go//go:def.bzl", "go_library", "go_test") + +cc_library( + name = "gozstd-c-archive", + srcs = select({ -+ "@io_bazel_rules_go//go/platform:android_amd64": [ ++ "@rules_go//go/platform:android_amd64": [ + "libzstd_linux_amd64.a", + ], -+ "@io_bazel_rules_go//go/platform:android_arm": [ ++ "@rules_go//go/platform:android_arm": [ + "libzstd_linux_arm.a", + ], -+ "@io_bazel_rules_go//go/platform:android_arm64": [ ++ "@rules_go//go/platform:android_arm64": [ + "libzstd_linux_arm64.a", + ], -+ "@io_bazel_rules_go//go/platform:darwin_amd64": [ ++ "@rules_go//go/platform:darwin_amd64": [ + "libzstd_darwin_amd64.a", + ], -+ "@io_bazel_rules_go//go/platform:darwin_arm64": [ ++ "@rules_go//go/platform:darwin_arm64": [ + "libzstd_darwin_arm64.a", + ], -+ "@io_bazel_rules_go//go/platform:freebsd_amd64": [ ++ "@rules_go//go/platform:freebsd_amd64": [ + "libzstd_freebsd_amd64.a", + ], -+ "@io_bazel_rules_go//go/platform:ios_amd64": [ ++ "@rules_go//go/platform:ios_amd64": [ + "libzstd_darwin_amd64.a", + ], -+ "@io_bazel_rules_go//go/platform:ios_arm64": [ ++ "@rules_go//go/platform:ios_arm64": [ + "libzstd_darwin_arm64.a", + ], -+ "@io_bazel_rules_go//go/platform:linux_amd64": [ ++ "@rules_go//go/platform:linux_amd64": [ + "libzstd_linux_amd64.a", + ], -+ "@io_bazel_rules_go//go/platform:linux_arm": [ ++ "@rules_go//go/platform:linux_arm": [ + "libzstd_linux_arm.a", + ], -+ "@io_bazel_rules_go//go/platform:linux_arm64": [ ++ "@rules_go//go/platform:linux_arm64": [ + "libzstd_linux_arm64.a", + ], -+ "@io_bazel_rules_go//go/platform:windows_amd64": [ ++ "@rules_go//go/platform:windows_amd64": [ + "libzstd_windows_amd64.a", + ]}, + no_match_error = "Platform not supported by cgo zstd implementation"), diff --git a/genproto/build/bazel/remote/asset/v1/BUILD.bazel b/genproto/build/bazel/remote/asset/v1/BUILD.bazel index 6cb923695..ce682bb89 100644 --- a/genproto/build/bazel/remote/asset/v1/BUILD.bazel +++ b/genproto/build/bazel/remote/asset/v1/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/genproto/build/bazel/remote/execution/v2/BUILD.bazel b/genproto/build/bazel/remote/execution/v2/BUILD.bazel index f8c71235f..cf8e7eb29 100644 --- a/genproto/build/bazel/remote/execution/v2/BUILD.bazel +++ b/genproto/build/bazel/remote/execution/v2/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/genproto/build/bazel/semver/BUILD.bazel b/genproto/build/bazel/semver/BUILD.bazel index bf31c248c..5f1866f86 100644 --- a/genproto/build/bazel/semver/BUILD.bazel +++ b/genproto/build/bazel/semver/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/ldap/BUILD.bazel b/ldap/BUILD.bazel index 190c0ee6e..8bbda3d37 100644 --- a/ldap/BUILD.bazel +++ b/ldap/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/server/BUILD.bazel b/server/BUILD.bazel index 1286be262..81f5cd8ee 100644 --- a/server/BUILD.bazel +++ b/server/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/utils/BUILD.bazel b/utils/BUILD.bazel index 655a81318..bd310f346 100644 --- a/utils/BUILD.bazel +++ b/utils/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/utils/annotate/BUILD.bazel b/utils/annotate/BUILD.bazel index a35d254a2..dd43d4619 100644 --- a/utils/annotate/BUILD.bazel +++ b/utils/annotate/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/utils/backendproxy/BUILD.bazel b/utils/backendproxy/BUILD.bazel index 868b21fb1..8b68517e0 100644 --- a/utils/backendproxy/BUILD.bazel +++ b/utils/backendproxy/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/utils/fakes3/BUILD.bazel b/utils/fakes3/BUILD.bazel index 1d1610967..da4f1dde3 100644 --- a/utils/fakes3/BUILD.bazel +++ b/utils/fakes3/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "go_default_library", diff --git a/utils/flags/BUILD.bazel b/utils/flags/BUILD.bazel index 2b06046d1..4a023ee85 100644 --- a/utils/flags/BUILD.bazel +++ b/utils/flags/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/utils/grpcreadclient/BUILD.bazel b/utils/grpcreadclient/BUILD.bazel index e0014b9f9..eeff74c7d 100644 --- a/utils/grpcreadclient/BUILD.bazel +++ b/utils/grpcreadclient/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "go_default_library", diff --git a/utils/idle/BUILD.bazel b/utils/idle/BUILD.bazel index 976d89ce9..c7c58d3c8 100644 --- a/utils/idle/BUILD.bazel +++ b/utils/idle/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/utils/rlimit/BUILD.bazel b/utils/rlimit/BUILD.bazel index 1736a2da0..7a2fafc85 100644 --- a/utils/rlimit/BUILD.bazel +++ b/utils/rlimit/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", diff --git a/utils/tempfile/BUILD.bazel b/utils/tempfile/BUILD.bazel index f5bf91274..6b6b062d5 100644 --- a/utils/tempfile/BUILD.bazel +++ b/utils/tempfile/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/utils/validate/BUILD.bazel b/utils/validate/BUILD.bazel index 36fd6a5f7..a849d39e3 100644 --- a/utils/validate/BUILD.bazel +++ b/utils/validate/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", diff --git a/utils/zstdpool/BUILD.bazel b/utils/zstdpool/BUILD.bazel index 23ff83d6c..4ca21f5c9 100644 --- a/utils/zstdpool/BUILD.bazel +++ b/utils/zstdpool/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", From 5ae93dd56c69bf8dd08e292616bc8738d0340866 Mon Sep 17 00:00:00 2001 From: Mostyn Bramley-Moore Date: Mon, 16 Sep 2024 01:28:37 +0200 Subject: [PATCH 3/3] Drop old bazel_gazelle repo name --- BUILD.bazel | 2 +- MODULE.bazel | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 9f0196d9e..4458d8281 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,4 @@ -load("@bazel_gazelle//:def.bzl", "gazelle") +load("@gazelle//:def.bzl", "gazelle") load("@rules_go//go:def.bzl", "go_binary", "go_library") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball") load("@rules_pkg//:pkg.bzl", "pkg_tar") diff --git a/MODULE.bazel b/MODULE.bazel index 9616344ea..0a0bbacec 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,7 +1,7 @@ # https://registry.bazel.build/ bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5") bazel_dep(name = "rules_go", version = "0.50.1") -bazel_dep(name = "gazelle", version = "0.38.0", repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.38.0") bazel_dep(name = "rules_proto", version = "6.0.2") bazel_dep(name = "rules_pkg", version = "1.0.1") bazel_dep(name = "rules_oci", version = "1.8.0") @@ -29,7 +29,7 @@ use_repo(oci, "cgo_arm64_base") go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") go_sdk.download(version = "1.23.0") -go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//:go.mod") go_deps.module( path = "github.com/aws/aws-sdk-go",