From 0242627b82ee14434d052684383e8caa5c659431 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 30 Apr 2026 18:28:55 +0000 Subject: [PATCH 1/9] chore: fix bazel example tests --- .bazelrc | 2 +- .bazelversion | 1 + bazel_example/.bazelrc | 1 + bazel_example/.bazelversion | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .bazelversion create mode 100644 bazel_example/.bazelrc create mode 100644 bazel_example/.bazelversion diff --git a/.bazelrc b/.bazelrc index 9016e628d..710c4d81a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -build --protocopt=--experimental_allow_proto3_optional +common --noenable_bzlmod diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000..798e38995 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +6.3.0 diff --git a/bazel_example/.bazelrc b/bazel_example/.bazelrc new file mode 100644 index 000000000..710c4d81a --- /dev/null +++ b/bazel_example/.bazelrc @@ -0,0 +1 @@ +common --noenable_bzlmod diff --git a/bazel_example/.bazelversion b/bazel_example/.bazelversion new file mode 100644 index 000000000..798e38995 --- /dev/null +++ b/bazel_example/.bazelversion @@ -0,0 +1 @@ +6.3.0 From 513eb5e4e59f9f27583207d6ed9f3970205845a5 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 30 Apr 2026 18:33:54 +0000 Subject: [PATCH 2/9] install bazelisk in CI --- .bazeliskrc | 2 -- .github/workflows/bazel_example.yml | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 .bazeliskrc diff --git a/.bazeliskrc b/.bazeliskrc deleted file mode 100644 index 127df2010..000000000 --- a/.bazeliskrc +++ /dev/null @@ -1,2 +0,0 @@ -# See https://github.com/bazelbuild/bazelisk -USE_BAZEL_VERSION=6.3.0 \ No newline at end of file diff --git a/.github/workflows/bazel_example.yml b/.github/workflows/bazel_example.yml index cb81902f8..03bd985bd 100644 --- a/.github/workflows/bazel_example.yml +++ b/.github/workflows/bazel_example.yml @@ -39,6 +39,11 @@ jobs: echo "and it will start over with a clean cache." echo "The old one will disappear after 7 days." + - name: Install Bazelisk + run: | + curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazel + chmod +x /usr/local/bin/bazel + - name: Show bazel version run: | bazel --version From 1b54e0385696ff563506eadff20244efaae45dce Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 30 Apr 2026 18:53:50 +0000 Subject: [PATCH 3/9] try to fix --- .github/workflows/bazel_example.yml | 3 +++ bazel_example/WORKSPACE.bazel | 3 ++- repositories.bzl | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel_example.yml b/.github/workflows/bazel_example.yml index 03bd985bd..832b7962f 100644 --- a/.github/workflows/bazel_example.yml +++ b/.github/workflows/bazel_example.yml @@ -10,6 +10,8 @@ jobs: build: runs-on: ubuntu-24.04 container: gcr.io/gapic-images/googleapis:latest + env: + USE_BAZEL_VERSION: 6.3.0 steps: - name: Checkout code @@ -46,6 +48,7 @@ jobs: - name: Show bazel version run: | + which -a bazel bazel --version - name: Build example package; all targets diff --git a/bazel_example/WORKSPACE.bazel b/bazel_example/WORKSPACE.bazel index a7f72a347..9781b2c17 100644 --- a/bazel_example/WORKSPACE.bazel +++ b/bazel_example/WORKSPACE.bazel @@ -50,10 +50,11 @@ http_archive( ], ) -_rules_gapic_version = "0.5.4" +_rules_gapic_version = "1.0.0" http_archive( name = "rules_gapic", + sha256 = "c21e78a42f69898e7c3142fa837e3a637b1993d27c08a64723262611971d2b96", strip_prefix = "rules_gapic-%s" % _rules_gapic_version, urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version], ) diff --git a/repositories.bzl b/repositories.bzl index 887ce7eef..bd4b28a6a 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -17,10 +17,11 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("//rules_php_gapic:php_repo.bzl", "php", "php_composer_install") def gapic_generator_php_repositories(): - _rules_gapic_version = "0.5.4" + _rules_gapic_version = "1.0.0" maybe( http_archive, name = "rules_gapic", + sha256 = "c21e78a42f69898e7c3142fa837e3a637b1993d27c08a64723262611971d2b96", strip_prefix = "rules_gapic-%s" % _rules_gapic_version, urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version], ) From 20096bb9660a293f9a9f07bdf3f20b55fbcf9efe Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 4 May 2026 23:53:45 +0000 Subject: [PATCH 4/9] try to define apple rules explicitly --- bazel_example/WORKSPACE.bazel | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bazel_example/WORKSPACE.bazel b/bazel_example/WORKSPACE.bazel index 9781b2c17..7a0f07c03 100644 --- a/bazel_example/WORKSPACE.bazel +++ b/bazel_example/WORKSPACE.bazel @@ -14,6 +14,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "build_bazel_rules_apple", + sha256 = "9c4f1e1ec4fdfeac5bddb07fa0e872c398e3d8eb0ac596af9c463f9123ace292", + url = "https://github.com/bazelbuild/rules_apple/releases/download/3.2.1/rules_apple.3.2.1.tar.gz", +) + http_archive( name = "com_google_protobuf", sha256 = "f7042d540c969b00db92e8e1066a9b8099c8379c33f40f360eb9e1d98a36ca26", From 2ddd9403789daf5c57589c4e7658472abe88631f Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 5 May 2026 00:02:45 +0000 Subject: [PATCH 5/9] try again --- .bazelrc | 2 +- .bazelversion | 2 +- .github/workflows/bazel_example.yml | 2 +- bazel_example/.bazelrc | 2 +- bazel_example/.bazelversion | 2 +- bazel_example/WORKSPACE.bazel | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.bazelrc b/.bazelrc index 710c4d81a..4980d66e3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -common --noenable_bzlmod +# common --noenable_bzlmod diff --git a/.bazelversion b/.bazelversion index 798e38995..ade65226e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.3.0 +5.4.1 diff --git a/.github/workflows/bazel_example.yml b/.github/workflows/bazel_example.yml index 832b7962f..3d599a93c 100644 --- a/.github/workflows/bazel_example.yml +++ b/.github/workflows/bazel_example.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-24.04 container: gcr.io/gapic-images/googleapis:latest env: - USE_BAZEL_VERSION: 6.3.0 + USE_BAZEL_VERSION: 5.4.1 steps: - name: Checkout code diff --git a/bazel_example/.bazelrc b/bazel_example/.bazelrc index 710c4d81a..4980d66e3 100644 --- a/bazel_example/.bazelrc +++ b/bazel_example/.bazelrc @@ -1 +1 @@ -common --noenable_bzlmod +# common --noenable_bzlmod diff --git a/bazel_example/.bazelversion b/bazel_example/.bazelversion index 798e38995..ade65226e 100644 --- a/bazel_example/.bazelversion +++ b/bazel_example/.bazelversion @@ -1 +1 @@ -6.3.0 +5.4.1 diff --git a/bazel_example/WORKSPACE.bazel b/bazel_example/WORKSPACE.bazel index 7a0f07c03..80c869697 100644 --- a/bazel_example/WORKSPACE.bazel +++ b/bazel_example/WORKSPACE.bazel @@ -15,9 +15,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "build_bazel_rules_apple", - sha256 = "9c4f1e1ec4fdfeac5bddb07fa0e872c398e3d8eb0ac596af9c463f9123ace292", - url = "https://github.com/bazelbuild/rules_apple/releases/download/3.2.1/rules_apple.3.2.1.tar.gz", + name = "build_bazel_apple_support", + sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2ed42ce3a268", + url = "https://github.com/bazelbuild/apple_support/releases/download/1.11.1/apple_support.1.11.1.tar.gz", ) http_archive( From a922626293db98b0d6a5217c4df1190004bb8d64 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 5 May 2026 00:08:58 +0000 Subject: [PATCH 6/9] fix checksum --- bazel_example/WORKSPACE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel_example/WORKSPACE.bazel b/bazel_example/WORKSPACE.bazel index 80c869697..613c97562 100644 --- a/bazel_example/WORKSPACE.bazel +++ b/bazel_example/WORKSPACE.bazel @@ -16,7 +16,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_apple_support", - sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2ed42ce3a268", + sha256 = "cf4d63f39c7ba9059f70e995bf5fe1019267d3f77379c2028561a5d7645ef67c", url = "https://github.com/bazelbuild/apple_support/releases/download/1.11.1/apple_support.1.11.1.tar.gz", ) From d90a9030b310f698ddc2194e2073aabcf7eba7e6 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 5 May 2026 03:00:05 +0000 Subject: [PATCH 7/9] try upgrading grpc --- bazel_example/WORKSPACE.bazel | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/bazel_example/WORKSPACE.bazel b/bazel_example/WORKSPACE.bazel index 613c97562..8b39170ff 100644 --- a/bazel_example/WORKSPACE.bazel +++ b/bazel_example/WORKSPACE.bazel @@ -14,12 +14,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "build_bazel_apple_support", - sha256 = "cf4d63f39c7ba9059f70e995bf5fe1019267d3f77379c2028561a5d7645ef67c", - url = "https://github.com/bazelbuild/apple_support/releases/download/1.11.1/apple_support.1.11.1.tar.gz", -) - http_archive( name = "com_google_protobuf", sha256 = "f7042d540c969b00db92e8e1066a9b8099c8379c33f40f360eb9e1d98a36ca26", @@ -33,9 +27,9 @@ protobuf_deps() http_archive( name = "com_github_grpc_grpc", - sha256 = "4b64cbc454cc4fd0801a2823111e1d99f519c765dfa116905740f7ca2256d085", - strip_prefix = "grpc-1.51.1", - urls = ["https://github.com/grpc/grpc/archive/v1.51.1.zip"], + sha256 = "5e53505a6c84030a26c4fddd71b3f46feec8e0a8eccff2a903b189d349ca6ff5", + strip_prefix = "grpc-1.54.0", + urls = ["https://github.com/grpc/grpc/archive/v1.54.0.tar.gz"], ) load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") From b24df634d71751af0319ad93c3b0a8c5edb87ddd Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 5 May 2026 16:48:21 +0000 Subject: [PATCH 8/9] maybe this will fix it? --- .bazelrc | 2 +- .bazelversion | 2 +- WORKSPACE.bazel | 28 ++++++++++++++-------------- bazel_example/.bazelrc | 2 +- bazel_example/.bazelversion | 2 +- bazel_example/WORKSPACE.bazel | 12 ++++++------ repositories.bzl | 9 --------- 7 files changed, 24 insertions(+), 33 deletions(-) diff --git a/.bazelrc b/.bazelrc index 4980d66e3..710c4d81a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -# common --noenable_bzlmod +common --noenable_bzlmod diff --git a/.bazelversion b/.bazelversion index ade65226e..a3fcc7121 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -5.4.1 +7.1.0 diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 4f18f8d13..b38ab4ad6 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -28,6 +28,20 @@ http_archive( ], ) +# gRPC. +http_archive( + name = "com_github_grpc_grpc", + sha256 = "d5509e40fb24f6390deeef8a88668124f4ec77d2ebb3b1a957b235a2f08b70c0", + urls = ["https://github.com/grpc/grpc/archive/v1.64.0.tar.gz"], + strip_prefix = "grpc-1.64.0", +) + +load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") +grpc_deps() + +load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") +grpc_extra_deps() + load("//:repositories.bzl", "gapic_generator_php_repositories") gapic_generator_php_repositories() @@ -45,17 +59,3 @@ switched_rules_by_language( php = True, ) -# gRPC. -http_archive( - name = "com_github_grpc_grpc", - sha256 = "4b64cbc454cc4fd0801a2823111e1d99f519c765dfa116905740f7ca2256d085", - urls = ["https://github.com/grpc/grpc/archive/v1.51.1.zip"], - strip_prefix = "grpc-1.51.1", -) - -load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") -grpc_deps() - -load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") -grpc_extra_deps() - diff --git a/bazel_example/.bazelrc b/bazel_example/.bazelrc index 4980d66e3..710c4d81a 100644 --- a/bazel_example/.bazelrc +++ b/bazel_example/.bazelrc @@ -1 +1 @@ -# common --noenable_bzlmod +common --noenable_bzlmod diff --git a/bazel_example/.bazelversion b/bazel_example/.bazelversion index ade65226e..a3fcc7121 100644 --- a/bazel_example/.bazelversion +++ b/bazel_example/.bazelversion @@ -1 +1 @@ -5.4.1 +7.1.0 diff --git a/bazel_example/WORKSPACE.bazel b/bazel_example/WORKSPACE.bazel index 8b39170ff..94554f310 100644 --- a/bazel_example/WORKSPACE.bazel +++ b/bazel_example/WORKSPACE.bazel @@ -16,9 +16,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "com_google_protobuf", - sha256 = "f7042d540c969b00db92e8e1066a9b8099c8379c33f40f360eb9e1d98a36ca26", - strip_prefix = "protobuf-3.21.12", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.12.zip"], + sha256 = "4fc5ff1b2c339fb86cd3a25f0b5311478ab081e65ad258c6789359cd84d421f8", + strip_prefix = "protobuf-26.1", + urls = ["https://github.com/protocolbuffers/protobuf/archive/v26.1.tar.gz"], ) load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") @@ -27,9 +27,9 @@ protobuf_deps() http_archive( name = "com_github_grpc_grpc", - sha256 = "5e53505a6c84030a26c4fddd71b3f46feec8e0a8eccff2a903b189d349ca6ff5", - strip_prefix = "grpc-1.54.0", - urls = ["https://github.com/grpc/grpc/archive/v1.54.0.tar.gz"], + sha256 = "d5509e40fb24f6390deeef8a88668124f4ec77d2ebb3b1a957b235a2f08b70c0", + strip_prefix = "grpc-1.64.0", + urls = ["https://github.com/grpc/grpc/archive/v1.64.0.tar.gz"], ) load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") diff --git a/repositories.bzl b/repositories.bzl index bd4b28a6a..54f00b8d6 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -42,15 +42,6 @@ def gapic_generator_php_repositories(): composer_json = "@gapic_generator_php//:composer.json", ) - # Import Bazel-only dependencies. - _protobuf_version = "3.13.0" - maybe( - http_archive, - name = "com_google_protobuf", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" % _protobuf_version], - strip_prefix = "protobuf-%s" % _protobuf_version, - ) - maybe( http_archive, name = "com_google_googleapis", From 4b93c8ff1fe69fc9ebad86f653f972504317d0a9 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 5 May 2026 17:26:23 +0000 Subject: [PATCH 9/9] try gemini patches --- repositories.bzl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repositories.bzl b/repositories.bzl index 54f00b8d6..bba333b7d 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -49,4 +49,8 @@ def gapic_generator_php_repositories(): urls = [ "https://github.com/googleapis/googleapis/archive/9841522f92c6542aad0049d98721cba04f541f29.zip", ], + patch_cmds = [ + "find . -name BUILD.bazel -exec sed -i '1i exports_files(glob([\"*.json\", \"*.yaml\"]))' {} +", + "find . -name BUILD -exec sed -i '1i exports_files(glob([\"*.json\", \"*.yaml\"]))' {} +", + ], )