From a996fceabbfb927738d4ea0988f994d49883ee48 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 19:54:55 +0900 Subject: [PATCH 1/9] simplify the initial port/uniification --- .bazelci/presubmit.yml | 147 ++++++++++++------------------------- .bcr/gazelle/presubmit.yml | 4 +- .bcr/presubmit.yml | 6 +- 3 files changed, 52 insertions(+), 105 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e6ee33558a..066baf2310 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -91,7 +91,50 @@ buildifier: - //tests:version_3_13_test - //tests:version_3_14_test - //tests:version_default_test + +matrix: + platform: + - ubuntu2204 + - debian11 + - macos_arm64 + - windows + bazel: [7.*, 8.*, 9.*] + tasks: + bcr_test: + name: BCR test module + platform: ${{ platform }} + working_directory: examples/bzlmod + bazel: ${{ bazel }} + test_flags: + - "--keep_going" + # Without these cxxopts, BCR's Mac builds fail + - '--cxxopt=-std=c++14' + - '--host_cxxopt=-std=c++14' + build_targets: + - "//..." + test_targets: + - "//..." + + bcr_gazelle_test: + name: "Run test module" + platform: ${{ platform }} + bazel: ${{ bazel }} + working_directory: gazelle/examples/bzlmod_build_file_generation + shell_commands: + - "echo 'common --override_module=rules_python=' >> .bazelrc" + - "bazel run //:gazelle_python_manifest.update" + - "bazel run //:gazelle -- update" + batch_commands: + - "echo common --override_module=rules_python= >> .bazelrc" + - "bazel run //:gazelle_python_manifest.update" + - "bazel run //:gazelle -- update" + build_targets: + - "//..." + - ":modules_map" + test_targets: + - "//..." + gazelle_extension_min: <<: *common_workspace_flags_min_bazel <<: *minimum_supported_version @@ -262,113 +305,15 @@ tasks: working_directory: examples/build_file_generation platform: windows - integration_test_bzlmod_ubuntu_min: - <<: *minimum_supported_version - <<: *reusable_build_test_all - coverage_targets: ["//:test"] - name: "examples/bzlmod: Ubuntu, minimum Bazel" - working_directory: examples/bzlmod - platform: ubuntu2204 - bazel: 7.x - integration_test_bzlmod_ubuntu: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod - name: "examples/bzlmod: Ubuntu" - working_directory: examples/bzlmod - platform: ubuntu2204 - bazel: 7.x - integration_test_bzlmod_ubuntu_upcoming: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod - name: "examples/bzlmod: Ubuntu, upcoming Bazel" - working_directory: examples/bzlmod - platform: ubuntu2204 - bazel: last_rc - integration_test_bzlmod_debian: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod - name: "examples/bzlmod: Debian" - working_directory: examples/bzlmod - platform: debian11 - bazel: 7.x integration_test_bzlmod_ubuntu_vendor: <<: *reusable_build_test_all name: "examples/bzlmod: bazel vendor" working_directory: examples/bzlmod platform: ubuntu2204 shell_commands: - - "bazel vendor --vendor_dir=./vendor //..." - - "bazel build --vendor_dir=./vendor //..." - - "rm -rf ./vendor" - integration_test_bzlmod_macos: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod - name: "examples/bzlmod: macOS" - working_directory: examples/bzlmod - platform: macos_arm64 - bazel: 7.x - integration_test_bzlmod_macos_upcoming: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod - name: "examples/bzlmod: macOS, upcoming Bazel" - working_directory: examples/bzlmod - platform: macos_arm64 - bazel: last_rc - integration_test_bzlmod_windows: - <<: *reusable_build_test_all - # coverage is not supported on Windows - name: "examples/bzlmod: Windows" - working_directory: examples/bzlmod - platform: windows - bazel: 7.x - integration_test_bzlmod_windows_upcoming: - <<: *reusable_build_test_all - # coverage is not supported on Windows - name: "examples/bzlmod: Windows, upcoming Bazel" - working_directory: examples/bzlmod - platform: windows - bazel: last_rc - - integration_test_bzlmod_generate_build_file_generation_ubuntu_min: - <<: *minimum_supported_version - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod_build_file_generation - name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel" - working_directory: gazelle/examples/bzlmod_build_file_generation - platform: ubuntu2204 - bazel: 7.x - integration_test_bzlmod_generation_build_files_ubuntu: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod_build_file_generation - name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu" - working_directory: gazelle/examples/bzlmod_build_file_generation - platform: ubuntu2204 - integration_test_bzlmod_generation_build_files_ubuntu_run: - <<: *reusable_build_test_all - name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, Gazelle and pip" - working_directory: gazelle/examples/bzlmod_build_file_generation - platform: ubuntu2204 - shell_commands: - - "bazel run //:gazelle_python_manifest.update" - - "bazel run //:gazelle -- update" - integration_test_bzlmod_build_file_generation_debian: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod_build_file_generation - name: "gazelle/examples/bzlmod_build_file_generation: Debian" - working_directory: gazelle/examples/bzlmod_build_file_generation - platform: debian11 - integration_test_bzlmod_build_file_generation_macos: - <<: *reusable_build_test_all - <<: *coverage_targets_example_bzlmod_build_file_generation - name: "gazelle/examples/bzlmod_build_file_generation: MacOS" - working_directory: gazelle/examples/bzlmod_build_file_generation - platform: macos_arm64 - integration_test_bzlmod_build_file_generation_windows: - <<: *reusable_build_test_all - # coverage is not supported on Windows - name: "gazelle/examples/bzlmod_build_file_generation: Windows" - working_directory: gazelle/examples/bzlmod_build_file_generation - platform: windows + - "bazel vendor --vendor_dir=./vendor //..." + - "bazel build --vendor_dir=./vendor //..." + - "rm -rf ./vendor" integration_test_multi_python_versions_ubuntu_workspace: <<: *reusable_build_test_all diff --git a/.bcr/gazelle/presubmit.yml b/.bcr/gazelle/presubmit.yml index 3300f67f29..77ed360ced 100644 --- a/.bcr/gazelle/presubmit.yml +++ b/.bcr/gazelle/presubmit.yml @@ -15,8 +15,8 @@ bcr_test_module: module_path: "examples/bzlmod_build_file_generation" matrix: - platform: ["debian11", "macos", "ubuntu2004", "windows"] - bazel: [7.x, 8.x] + platform: ["debian11", "macos", "ubuntu2204", "windows"] + bazel: [7.x, 8.x, 9.x] tasks: run_tests: name: "Run test module" diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index b016dc9d6f..ceeab4090c 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -15,8 +15,8 @@ bcr_test_module: module_path: "examples/bzlmod" matrix: - platform: ["debian11", "macos", "ubuntu2004", "windows"] - bazel: [7.x, 8.x] + platform: ["debian11", "macos", "ubuntu2204", "windows"] + bazel: [7.x, 8.x, 9.x] tasks: run_tests: name: "Run test module" @@ -27,5 +27,7 @@ bcr_test_module: # Without these cxxopts, BCR's Mac builds fail - '--cxxopt=-std=c++14' - '--host_cxxopt=-std=c++14' + build_targets: + - "//..." test_targets: - "//..." From 732c4251e3ea63db3c47575468dffcbd985a4b5d Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:01:31 +0900 Subject: [PATCH 2/9] update rules_go, gazelle and java --- .bcr/gazelle/presubmit.yml | 4 ++++ MODULE.bazel | 4 ++-- examples/bzlmod/MODULE.bazel | 2 +- examples/multi_python_versions/MODULE.bazel | 2 +- gazelle/MODULE.bazel | 4 ++-- gazelle/examples/bzlmod_build_file_generation/MODULE.bazel | 4 ++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.bcr/gazelle/presubmit.yml b/.bcr/gazelle/presubmit.yml index 77ed360ced..9d03e93dba 100644 --- a/.bcr/gazelle/presubmit.yml +++ b/.bcr/gazelle/presubmit.yml @@ -24,8 +24,12 @@ bcr_test_module: bazel: ${{ bazel }} shell_commands: - "echo 'common --override_module=rules_python=' >> .bazelrc" + - "bazel run //:gazelle_python_manifest.update" + - "bazel run //:gazelle -- update" batch_commands: - "echo common --override_module=rules_python= >> .bazelrc" + - "bazel run //:gazelle_python_manifest.update" + - "bazel run //:gazelle -- update" build_targets: - "//..." - ":modules_map" diff --git a/MODULE.bazel b/MODULE.bazel index 6e9b725c53..83794187e7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -226,9 +226,9 @@ bazel_dep(name = "another_module", version = "0", dev_dependency = True) # Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests. # We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides. -bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go") +bazel_dep(name = "rules_go", version = "0.59.0", dev_dependency = True, repo_name = "io_bazel_rules_go") bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True) -bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True, repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.47.0", dev_dependency = True, repo_name = "bazel_gazelle") internal_dev_deps = use_extension( "//python/private:internal_dev_deps.bzl", diff --git a/examples/bzlmod/MODULE.bazel b/examples/bzlmod/MODULE.bazel index f5311fb4d1..14c490cb0d 100644 --- a/examples/bzlmod/MODULE.bazel +++ b/examples/bzlmod/MODULE.bazel @@ -17,7 +17,7 @@ bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf" # Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so # that --java_runtime_version=remotejdk_11 works with Bazel 8. -bazel_dep(name = "rules_java", version = "8.3.1") +bazel_dep(name = "rules_java", version = "8.16.1") # Only needed to make rules_python's CI happy. A test verifies that # MODULE.bazel.lock is cross-platform friendly, and there are transitive diff --git a/examples/multi_python_versions/MODULE.bazel b/examples/multi_python_versions/MODULE.bazel index 2ef09ade3e..82faaf8214 100644 --- a/examples/multi_python_versions/MODULE.bazel +++ b/examples/multi_python_versions/MODULE.bazel @@ -75,4 +75,4 @@ bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True) # Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so # that --java_runtime_version=remotejdk_11 works with Bazel 8. -bazel_dep(name = "rules_java", version = "8.3.1") +bazel_dep(name = "rules_java", version = "8.16.1") diff --git a/gazelle/MODULE.bazel b/gazelle/MODULE.bazel index add5986903..cff6341a2b 100644 --- a/gazelle/MODULE.bazel +++ b/gazelle/MODULE.bazel @@ -6,8 +6,8 @@ module( bazel_dep(name = "bazel_skylib", version = "1.8.2") bazel_dep(name = "rules_python", version = "0.18.0") -bazel_dep(name = "rules_go", version = "0.55.1", repo_name = "io_bazel_rules_go") -bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle") +bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go") +bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle") bazel_dep(name = "rules_cc", version = "0.0.16") local_path_override( diff --git a/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel b/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel index ce779627f5..1f92ea3826 100644 --- a/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel +++ b/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel @@ -31,7 +31,7 @@ local_path_override( # The following stanza defines the dependency for gazelle # See here https://github.com/bazelbuild/bazel-gazelle/releases/ for the # latest version. -bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle") # The following stanze returns a proxy object representing a module extension; # its methods can be invoked to create module extension tags. @@ -84,4 +84,4 @@ local_path_override( ) # Only needed to make rules_python's CI happy -bazel_dep(name = "rules_java", version = "8.3.1") +bazel_dep(name = "rules_java", version = "8.16.1") From e89a50b611a8c533f0b8719b9989ea17946d187a Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:03:19 +0900 Subject: [PATCH 3/9] fix the bazelrc --- gazelle/examples/bzlmod_build_file_generation/.bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gazelle/examples/bzlmod_build_file_generation/.bazelrc b/gazelle/examples/bzlmod_build_file_generation/.bazelrc index d58665596b..31097b41de 100644 --- a/gazelle/examples/bzlmod_build_file_generation/.bazelrc +++ b/gazelle/examples/bzlmod_build_file_generation/.bazelrc @@ -3,7 +3,7 @@ test --test_output=errors --enable_runfiles # Windows requires these for multi-python support: build --enable_runfiles -common --experimental_enable_bzlmod +common --enable_bzlmod coverage --java_runtime_version=remotejdk_11 common:bazel7.x --incompatible_python_disallow_native_rules From 1e4f22a00cd99f08b5d608ca69c7a851b88509f9 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:20:19 +0900 Subject: [PATCH 4/9] update C++ --- .bazelci/presubmit.yml | 6 +++--- .bcr/presubmit.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 066baf2310..ff5501350d 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -107,10 +107,10 @@ tasks: working_directory: examples/bzlmod bazel: ${{ bazel }} test_flags: + # Minimum bazel supported C++ - "--keep_going" - # Without these cxxopts, BCR's Mac builds fail - - '--cxxopt=-std=c++14' - - '--host_cxxopt=-std=c++14' + - '--cxxopt=-std=c++17' + - '--host_cxxopt=-std=c++17' build_targets: - "//..." test_targets: diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index ceeab4090c..a38c6bace5 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -23,10 +23,10 @@ bcr_test_module: platform: ${{ platform }} bazel: ${{ bazel }} test_flags: + # Minimum bazel supported C++ - "--keep_going" - # Without these cxxopts, BCR's Mac builds fail - - '--cxxopt=-std=c++14' - - '--host_cxxopt=-std=c++14' + - '--cxxopt=-std=c++17' + - '--host_cxxopt=-std=c++17' build_targets: - "//..." test_targets: From b39a19b77773beab70f2353fac27e7d7290ea60e Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:21:52 +0900 Subject: [PATCH 5/9] better job naming --- .bazelci/presubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index ff5501350d..c799b1c7ed 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -102,7 +102,7 @@ matrix: tasks: bcr_test: - name: BCR test module + name: BCR example - rules_python platform: ${{ platform }} working_directory: examples/bzlmod bazel: ${{ bazel }} @@ -117,7 +117,7 @@ tasks: - "//..." bcr_gazelle_test: - name: "Run test module" + name: BCR example - rules_python_gazelle_plugin platform: ${{ platform }} bazel: ${{ bazel }} working_directory: gazelle/examples/bzlmod_build_file_generation From 17a8e55e16a2bc7cc37197eba0531adeca500089 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:22:55 +0900 Subject: [PATCH 6/9] attempt bazel version in the job title --- .bazelci/presubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index c799b1c7ed..6f85c1a8cb 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -102,7 +102,7 @@ matrix: tasks: bcr_test: - name: BCR example - rules_python + name: BCR example (bazel ${{ bazel }}) - rules_python platform: ${{ platform }} working_directory: examples/bzlmod bazel: ${{ bazel }} @@ -117,7 +117,7 @@ tasks: - "//..." bcr_gazelle_test: - name: BCR example - rules_python_gazelle_plugin + name: BCR example (bazel ${{ bazel }}) - rules_python_gazelle_plugin platform: ${{ platform }} bazel: ${{ bazel }} working_directory: gazelle/examples/bzlmod_build_file_generation From 4f44c177a51ed12d9c59cb16d3a0f8e7449d53da Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:24:26 +0900 Subject: [PATCH 7/9] Revert "attempt bazel version in the job title" This reverts commit 17a8e55e16a2bc7cc37197eba0531adeca500089. --- .bazelci/presubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 6f85c1a8cb..c799b1c7ed 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -102,7 +102,7 @@ matrix: tasks: bcr_test: - name: BCR example (bazel ${{ bazel }}) - rules_python + name: BCR example - rules_python platform: ${{ platform }} working_directory: examples/bzlmod bazel: ${{ bazel }} @@ -117,7 +117,7 @@ tasks: - "//..." bcr_gazelle_test: - name: BCR example (bazel ${{ bazel }}) - rules_python_gazelle_plugin + name: BCR example - rules_python_gazelle_plugin platform: ${{ platform }} bazel: ${{ bazel }} working_directory: gazelle/examples/bzlmod_build_file_generation From b91a618b95d8608f0d2713ff6bb486ab6335202c Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:01:52 +0900 Subject: [PATCH 8/9] Only use bazel 7 and 8 --- .bazelci/presubmit.yml | 2 +- .bcr/gazelle/presubmit.yml | 2 +- .bcr/presubmit.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index c799b1c7ed..8cc1c2aac6 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -98,7 +98,7 @@ matrix: - debian11 - macos_arm64 - windows - bazel: [7.*, 8.*, 9.*] + bazel: [7.*, 8.*] tasks: bcr_test: diff --git a/.bcr/gazelle/presubmit.yml b/.bcr/gazelle/presubmit.yml index 9d03e93dba..021e28f3d5 100644 --- a/.bcr/gazelle/presubmit.yml +++ b/.bcr/gazelle/presubmit.yml @@ -16,7 +16,7 @@ bcr_test_module: module_path: "examples/bzlmod_build_file_generation" matrix: platform: ["debian11", "macos", "ubuntu2204", "windows"] - bazel: [7.x, 8.x, 9.x] + bazel: [7.*, 8.*] tasks: run_tests: name: "Run test module" diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index a38c6bace5..6217ad7ba2 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -16,7 +16,7 @@ bcr_test_module: module_path: "examples/bzlmod" matrix: platform: ["debian11", "macos", "ubuntu2204", "windows"] - bazel: [7.x, 8.x, 9.x] + bazel: [7.*, 8.*] tasks: run_tests: name: "Run test module" From cd86638927ed14819c9330c39ca87bc180611b2a Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 25 Nov 2025 14:06:48 -0800 Subject: [PATCH 9/9] revert rules_python to rules_go 41, gazelle 40 --- MODULE.bazel | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 83794187e7..2c2ed23577 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -226,9 +226,12 @@ bazel_dep(name = "another_module", version = "0", dev_dependency = True) # Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests. # We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides. -bazel_dep(name = "rules_go", version = "0.59.0", dev_dependency = True, repo_name = "io_bazel_rules_go") +bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go") + +##bazel_dep(name = "rules_go", version = "0.59.0", dev_dependency = True, repo_name = "io_bazel_rules_go") bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True) -bazel_dep(name = "gazelle", version = "0.47.0", dev_dependency = True, repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True, repo_name = "bazel_gazelle") +##bazel_dep(name = "gazelle", version = "0.47.0", dev_dependency = True, repo_name = "bazel_gazelle") internal_dev_deps = use_extension( "//python/private:internal_dev_deps.bzl",