From 62374d9188593aea7a81473b59b230478a0dc963 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:38:24 +0900 Subject: [PATCH 01/21] ci: remove bzlmod CI config for pip_parse_vendored --- .bazelci/presubmit.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 8c0252c3c8..b90396065e 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -412,25 +412,21 @@ tasks: name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel" working_directory: examples/pip_parse_vendored platform: ubuntu2004 - integration_test_pip_parse_vendored_ubuntu_min_bzlmod: - <<: *minimum_supported_version - <<: *reusable_build_test_all - name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel" - working_directory: examples/pip_parse_vendored - platform: ubuntu2004 - bazel: 7.x integration_test_pip_parse_vendored_ubuntu: <<: *reusable_build_test_all + <<: *common_workspace_flags name: "examples/pip_parse_vendored: Ubuntu" working_directory: examples/pip_parse_vendored platform: ubuntu2004 integration_test_pip_parse_vendored_debian: <<: *reusable_build_test_all + <<: *common_workspace_flags name: "examples/pip_parse_vendored: Debian" working_directory: examples/pip_parse_vendored platform: debian11 integration_test_pip_parse_vendored_macos: <<: *reusable_build_test_all + <<: *common_workspace_flags name: "examples/pip_parse_vendored: MacOS" working_directory: examples/pip_parse_vendored platform: macos From 46856f373fb0a04851a692e5e1f622b7c12f8c1d Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:44:31 +0900 Subject: [PATCH 02/21] update .bazelrc for examples --- examples/build_file_generation/.bazelrc | 3 ++- examples/pip_parse_vendored/.bazelrc | 4 +++- examples/pip_repository_annotations/.bazelrc | 4 +++- examples/py_proto_library/.bazelrc | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/build_file_generation/.bazelrc b/examples/build_file_generation/.bazelrc index fd0f731d2f..dc9ab8c5df 100644 --- a/examples/build_file_generation/.bazelrc +++ b/examples/build_file_generation/.bazelrc @@ -5,6 +5,7 @@ build --enable_runfiles # The bzlmod version of this example is in examples/bzlmod_build_file_generation # Once WORKSPACE support is dropped, this example can be entirely deleted. -build --experimental_enable_bzlmod=false +common --noenable_bzlmod +common --enable_workspace common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse_vendored/.bazelrc b/examples/pip_parse_vendored/.bazelrc index be3555d1eb..d5a69f7efb 100644 --- a/examples/pip_parse_vendored/.bazelrc +++ b/examples/pip_parse_vendored/.bazelrc @@ -5,5 +5,7 @@ build --enable_runfiles # Vendoring requirements.bzl files isn't necessary under bzlmod # When workspace support is dropped, this example can be removed. -build --noexperimental_enable_bzlmod +common --noenable_bzlmod +common --enable_workspace + common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_repository_annotations/.bazelrc b/examples/pip_repository_annotations/.bazelrc index d893227946..1cdd89deb9 100644 --- a/examples/pip_repository_annotations/.bazelrc +++ b/examples/pip_repository_annotations/.bazelrc @@ -3,5 +3,7 @@ try-import %workspace%/user.bazelrc # This example is WORKSPACE specific. The equivalent functionality # is in examples/bzlmod as the `whl_mods` feature. -build --experimental_enable_bzlmod=false --enable_workspace=true +common --noenable_bzlmod +common --enable_workspace + common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/py_proto_library/.bazelrc b/examples/py_proto_library/.bazelrc index d73fc5387a..bd8a2b3031 100644 --- a/examples/py_proto_library/.bazelrc +++ b/examples/py_proto_library/.bazelrc @@ -1,3 +1,5 @@ # The equivalent bzlmod behavior is covered by examples/bzlmod/py_proto_library -common --noenable_bzlmod --enable_workspace=true +common --noenable_bzlmod +common --enable_workspace + common:bazel7.x --incompatible_python_disallow_native_rules From 226eb917195b806f63731ec73ea749435de1e710 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:50:35 +0900 Subject: [PATCH 03/21] bump the minimum tested version to 7.x --- .bazelci/presubmit.yml | 18 ++++-------------- .bazelversion | 2 +- examples/build_file_generation/.bazelrc | 2 +- examples/bzlmod/.bazelrc | 3 ++- examples/bzlmod_build_file_generation/.bazelrc | 2 +- examples/multi_python_versions/.bazelrc | 2 +- examples/pip_parse/.bazelrc | 2 +- examples/pip_parse_vendored/.bazelrc | 2 +- examples/pip_repository_annotations/.bazelrc | 2 +- examples/py_proto_library/.bazelrc | 2 +- version.bzl | 4 ++-- 11 files changed, 16 insertions(+), 25 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index b90396065e..afdaa186a8 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -18,11 +18,13 @@ buildifier: # Use a specific version to avoid skew issues when new versions are released. version: 6.1.0 warnings: "all" -# NOTE: Minimum supported version is 6.x for workspace; 7.x for bzlmod +# NOTE: Minimum tested version is 7.4.1 for workspace and bzlmod, patches +# for 6.x for workspace are welcome as long as they don't add maintenance +# overhead. .minimum_supported_version: &minimum_supported_version # For testing minimum supported version. # NOTE: Keep in sync with //:version.bzl - bazel: 6.4.0 + bazel: 7.4.1 skip_in_bazel_downstream_pipeline: "Bazel 6 required" .reusable_config: &reusable_config build_targets: @@ -34,7 +36,6 @@ buildifier: build_flags: - "--keep_going" - "--build_tag_filters=-integration-test" - - "--config=bazel7.x" test_targets: - "--" - "..." @@ -121,7 +122,6 @@ tasks: <<: *reusable_config name: "Default: Ubuntu, bzlmod, minimum Bazel" platform: ubuntu2004 - bazel: 7.x ubuntu: <<: *reusable_config name: "Default: Ubuntu" @@ -159,7 +159,6 @@ tasks: - "--enable_workspace" - "--keep_going" - "--build_tag_filters=-integration-test" - - "--config=bazel7.x" test_targets: - "--" - "..." @@ -187,7 +186,6 @@ tasks: <<: *reusable_config name: "RBE: Ubuntu, minimum Bazel" platform: rbe_ubuntu2004 - bazel: 7.x build_flags: # BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1, # which prevents cc toolchain autodetection from working correctly @@ -249,14 +247,12 @@ tasks: name: "examples/bzlmod: Ubuntu, minimum Bazel" working_directory: examples/bzlmod platform: ubuntu2004 - bazel: 7.x integration_test_bzlmod_ubuntu: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod name: "examples/bzlmod: Ubuntu" working_directory: examples/bzlmod platform: ubuntu2004 - bazel: 7.x integration_test_bzlmod_ubuntu_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -270,14 +266,12 @@ tasks: name: "examples/bzlmod: Debian" working_directory: examples/bzlmod platform: debian11 - bazel: 7.x integration_test_bzlmod_macos: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod name: "examples/bzlmod: macOS" working_directory: examples/bzlmod platform: macos - bazel: 7.x integration_test_bzlmod_macos_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -291,7 +285,6 @@ tasks: 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 @@ -307,7 +300,6 @@ tasks: name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel" working_directory: examples/bzlmod_build_file_generation platform: ubuntu2004 - bazel: 7.x integration_test_bzlmod_generation_build_files_ubuntu: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod_build_file_generation @@ -383,7 +375,6 @@ tasks: name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version" working_directory: examples/pip_parse platform: ubuntu2004 - bazel: 7.x integration_test_pip_parse_ubuntu: <<: *reusable_build_test_all name: "examples/pip_parse: Ubuntu" @@ -595,7 +586,6 @@ tasks: name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel" working_directory: tests/integration/compile_pip_requirements_test_from_external_repo platform: ubuntu2004 - bazel: 7.x shell_commands: # Assert that @compile_pip_requirements//:requirements_test does the right thing. - "bazel test @compile_pip_requirements//..." diff --git a/.bazelversion b/.bazelversion index 35907cd9ca..c6b7980b68 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.x +8.x diff --git a/examples/build_file_generation/.bazelrc b/examples/build_file_generation/.bazelrc index dc9ab8c5df..a66113123a 100644 --- a/examples/build_file_generation/.bazelrc +++ b/examples/build_file_generation/.bazelrc @@ -8,4 +8,4 @@ build --enable_runfiles common --noenable_bzlmod common --enable_workspace -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/examples/bzlmod/.bazelrc b/examples/bzlmod/.bazelrc index ca83047ccc..576d284a2a 100644 --- a/examples/bzlmod/.bazelrc +++ b/examples/bzlmod/.bazelrc @@ -7,4 +7,5 @@ test --test_output=errors --enable_runfiles # Windows requires these for multi-python support: build --enable_runfiles -common:bazel7.x --incompatible_python_disallow_native_rules + +common --incompatible_python_disallow_native_rules diff --git a/examples/bzlmod_build_file_generation/.bazelrc b/examples/bzlmod_build_file_generation/.bazelrc index 0289886d4d..b3f67ff167 100644 --- a/examples/bzlmod_build_file_generation/.bazelrc +++ b/examples/bzlmod_build_file_generation/.bazelrc @@ -6,4 +6,4 @@ build --enable_runfiles common --experimental_enable_bzlmod coverage --java_runtime_version=remotejdk_11 -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/examples/multi_python_versions/.bazelrc b/examples/multi_python_versions/.bazelrc index 97a973bd85..7744e0a821 100644 --- a/examples/multi_python_versions/.bazelrc +++ b/examples/multi_python_versions/.bazelrc @@ -4,4 +4,4 @@ test --test_output=errors build --enable_runfiles coverage --java_runtime_version=remotejdk_11 -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse/.bazelrc b/examples/pip_parse/.bazelrc index a56904803c..f263a1744d 100644 --- a/examples/pip_parse/.bazelrc +++ b/examples/pip_parse/.bazelrc @@ -1,3 +1,3 @@ # https://docs.bazel.build/versions/main/best-practices.html#using-the-bazelrc-file try-import %workspace%/user.bazelrc -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse_vendored/.bazelrc b/examples/pip_parse_vendored/.bazelrc index d5a69f7efb..584cd3b65d 100644 --- a/examples/pip_parse_vendored/.bazelrc +++ b/examples/pip_parse_vendored/.bazelrc @@ -8,4 +8,4 @@ build --enable_runfiles common --noenable_bzlmod common --enable_workspace -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/examples/pip_repository_annotations/.bazelrc b/examples/pip_repository_annotations/.bazelrc index 1cdd89deb9..9315b7b43c 100644 --- a/examples/pip_repository_annotations/.bazelrc +++ b/examples/pip_repository_annotations/.bazelrc @@ -6,4 +6,4 @@ try-import %workspace%/user.bazelrc common --noenable_bzlmod common --enable_workspace -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/examples/py_proto_library/.bazelrc b/examples/py_proto_library/.bazelrc index bd8a2b3031..50d7fef04c 100644 --- a/examples/py_proto_library/.bazelrc +++ b/examples/py_proto_library/.bazelrc @@ -2,4 +2,4 @@ common --noenable_bzlmod common --enable_workspace -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules diff --git a/version.bzl b/version.bzl index 61fb81efd4..4d85b5c420 100644 --- a/version.bzl +++ b/version.bzl @@ -17,11 +17,11 @@ # against. # This version should be updated together with the version of Bazel # in .bazelversion. -BAZEL_VERSION = "7.x" +BAZEL_VERSION = "8.x" # NOTE: Keep in sync with .bazelci/presubmit.yml # This is the minimum supported bazel version, that we have some tests for. -MINIMUM_BAZEL_VERSION = "6.4.0" +MINIMUM_BAZEL_VERSION = "7.4.1" # Versions of Bazel which users should be able to use. # Ensures we don't break backwards-compatibility, From 26291176137877e77cf0e3c9ebf5413324af4951 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:22:33 +0900 Subject: [PATCH 04/21] ci: use bazel 7.4.1 for workspace examples --- .bazelci/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index afdaa186a8..7e61bc05ab 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -56,6 +56,7 @@ buildifier: build_flags: - "--noenable_bzlmod" - "--enable_workspace" + bazel: 7.4.1 .common_bazelinbazel_config: &common_bazelinbazel_config build_flags: - "--build_tag_filters=integration-test" From 6e843f79e22487fb98200763ab927211575fb693 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:23:25 +0900 Subject: [PATCH 05/21] Revert "bump the minimum tested version to 7.x" This reverts commit 226eb917195b806f63731ec73ea749435de1e710. --- .bazelci/presubmit.yml | 18 ++++++++++++++---- .bazelversion | 2 +- examples/build_file_generation/.bazelrc | 2 +- examples/bzlmod/.bazelrc | 3 +-- examples/bzlmod_build_file_generation/.bazelrc | 2 +- examples/multi_python_versions/.bazelrc | 2 +- examples/pip_parse/.bazelrc | 2 +- examples/pip_parse_vendored/.bazelrc | 2 +- examples/pip_repository_annotations/.bazelrc | 2 +- examples/py_proto_library/.bazelrc | 2 +- version.bzl | 4 ++-- 11 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 7e61bc05ab..11d4c060a5 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -18,13 +18,11 @@ buildifier: # Use a specific version to avoid skew issues when new versions are released. version: 6.1.0 warnings: "all" -# NOTE: Minimum tested version is 7.4.1 for workspace and bzlmod, patches -# for 6.x for workspace are welcome as long as they don't add maintenance -# overhead. +# NOTE: Minimum supported version is 6.x for workspace; 7.x for bzlmod .minimum_supported_version: &minimum_supported_version # For testing minimum supported version. # NOTE: Keep in sync with //:version.bzl - bazel: 7.4.1 + bazel: 6.4.0 skip_in_bazel_downstream_pipeline: "Bazel 6 required" .reusable_config: &reusable_config build_targets: @@ -36,6 +34,7 @@ buildifier: build_flags: - "--keep_going" - "--build_tag_filters=-integration-test" + - "--config=bazel7.x" test_targets: - "--" - "..." @@ -123,6 +122,7 @@ tasks: <<: *reusable_config name: "Default: Ubuntu, bzlmod, minimum Bazel" platform: ubuntu2004 + bazel: 7.x ubuntu: <<: *reusable_config name: "Default: Ubuntu" @@ -160,6 +160,7 @@ tasks: - "--enable_workspace" - "--keep_going" - "--build_tag_filters=-integration-test" + - "--config=bazel7.x" test_targets: - "--" - "..." @@ -187,6 +188,7 @@ tasks: <<: *reusable_config name: "RBE: Ubuntu, minimum Bazel" platform: rbe_ubuntu2004 + bazel: 7.x build_flags: # BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1, # which prevents cc toolchain autodetection from working correctly @@ -248,12 +250,14 @@ tasks: name: "examples/bzlmod: Ubuntu, minimum Bazel" working_directory: examples/bzlmod platform: ubuntu2004 + bazel: 7.x integration_test_bzlmod_ubuntu: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod name: "examples/bzlmod: Ubuntu" working_directory: examples/bzlmod platform: ubuntu2004 + bazel: 7.x integration_test_bzlmod_ubuntu_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -267,12 +271,14 @@ tasks: name: "examples/bzlmod: Debian" working_directory: examples/bzlmod platform: debian11 + bazel: 7.x integration_test_bzlmod_macos: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod name: "examples/bzlmod: macOS" working_directory: examples/bzlmod platform: macos + bazel: 7.x integration_test_bzlmod_macos_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -286,6 +292,7 @@ tasks: 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 @@ -301,6 +308,7 @@ tasks: name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel" working_directory: examples/bzlmod_build_file_generation platform: ubuntu2004 + bazel: 7.x integration_test_bzlmod_generation_build_files_ubuntu: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod_build_file_generation @@ -376,6 +384,7 @@ tasks: name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version" working_directory: examples/pip_parse platform: ubuntu2004 + bazel: 7.x integration_test_pip_parse_ubuntu: <<: *reusable_build_test_all name: "examples/pip_parse: Ubuntu" @@ -587,6 +596,7 @@ tasks: name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel" working_directory: tests/integration/compile_pip_requirements_test_from_external_repo platform: ubuntu2004 + bazel: 7.x shell_commands: # Assert that @compile_pip_requirements//:requirements_test does the right thing. - "bazel test @compile_pip_requirements//..." diff --git a/.bazelversion b/.bazelversion index c6b7980b68..35907cd9ca 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.x +7.x diff --git a/examples/build_file_generation/.bazelrc b/examples/build_file_generation/.bazelrc index a66113123a..dc9ab8c5df 100644 --- a/examples/build_file_generation/.bazelrc +++ b/examples/build_file_generation/.bazelrc @@ -8,4 +8,4 @@ build --enable_runfiles common --noenable_bzlmod common --enable_workspace -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/bzlmod/.bazelrc b/examples/bzlmod/.bazelrc index 576d284a2a..ca83047ccc 100644 --- a/examples/bzlmod/.bazelrc +++ b/examples/bzlmod/.bazelrc @@ -7,5 +7,4 @@ test --test_output=errors --enable_runfiles # Windows requires these for multi-python support: build --enable_runfiles - -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/bzlmod_build_file_generation/.bazelrc b/examples/bzlmod_build_file_generation/.bazelrc index b3f67ff167..0289886d4d 100644 --- a/examples/bzlmod_build_file_generation/.bazelrc +++ b/examples/bzlmod_build_file_generation/.bazelrc @@ -6,4 +6,4 @@ build --enable_runfiles common --experimental_enable_bzlmod coverage --java_runtime_version=remotejdk_11 -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/multi_python_versions/.bazelrc b/examples/multi_python_versions/.bazelrc index 7744e0a821..97a973bd85 100644 --- a/examples/multi_python_versions/.bazelrc +++ b/examples/multi_python_versions/.bazelrc @@ -4,4 +4,4 @@ test --test_output=errors build --enable_runfiles coverage --java_runtime_version=remotejdk_11 -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse/.bazelrc b/examples/pip_parse/.bazelrc index f263a1744d..a56904803c 100644 --- a/examples/pip_parse/.bazelrc +++ b/examples/pip_parse/.bazelrc @@ -1,3 +1,3 @@ # https://docs.bazel.build/versions/main/best-practices.html#using-the-bazelrc-file try-import %workspace%/user.bazelrc -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse_vendored/.bazelrc b/examples/pip_parse_vendored/.bazelrc index 584cd3b65d..d5a69f7efb 100644 --- a/examples/pip_parse_vendored/.bazelrc +++ b/examples/pip_parse_vendored/.bazelrc @@ -8,4 +8,4 @@ build --enable_runfiles common --noenable_bzlmod common --enable_workspace -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_repository_annotations/.bazelrc b/examples/pip_repository_annotations/.bazelrc index 9315b7b43c..1cdd89deb9 100644 --- a/examples/pip_repository_annotations/.bazelrc +++ b/examples/pip_repository_annotations/.bazelrc @@ -6,4 +6,4 @@ try-import %workspace%/user.bazelrc common --noenable_bzlmod common --enable_workspace -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/py_proto_library/.bazelrc b/examples/py_proto_library/.bazelrc index 50d7fef04c..bd8a2b3031 100644 --- a/examples/py_proto_library/.bazelrc +++ b/examples/py_proto_library/.bazelrc @@ -2,4 +2,4 @@ common --noenable_bzlmod common --enable_workspace -common --incompatible_python_disallow_native_rules +common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/version.bzl b/version.bzl index 4d85b5c420..61fb81efd4 100644 --- a/version.bzl +++ b/version.bzl @@ -17,11 +17,11 @@ # against. # This version should be updated together with the version of Bazel # in .bazelversion. -BAZEL_VERSION = "8.x" +BAZEL_VERSION = "7.x" # NOTE: Keep in sync with .bazelci/presubmit.yml # This is the minimum supported bazel version, that we have some tests for. -MINIMUM_BAZEL_VERSION = "7.4.1" +MINIMUM_BAZEL_VERSION = "6.4.0" # Versions of Bazel which users should be able to use. # Ensures we don't break backwards-compatibility, From c89f900c85e59fa20708497b95ac06b99a04d20e Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:23:26 +0900 Subject: [PATCH 06/21] Revert "update .bazelrc for examples" This reverts commit 46856f373fb0a04851a692e5e1f622b7c12f8c1d. --- examples/build_file_generation/.bazelrc | 3 +-- examples/pip_parse_vendored/.bazelrc | 4 +--- examples/pip_repository_annotations/.bazelrc | 4 +--- examples/py_proto_library/.bazelrc | 4 +--- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/examples/build_file_generation/.bazelrc b/examples/build_file_generation/.bazelrc index dc9ab8c5df..fd0f731d2f 100644 --- a/examples/build_file_generation/.bazelrc +++ b/examples/build_file_generation/.bazelrc @@ -5,7 +5,6 @@ build --enable_runfiles # The bzlmod version of this example is in examples/bzlmod_build_file_generation # Once WORKSPACE support is dropped, this example can be entirely deleted. -common --noenable_bzlmod -common --enable_workspace +build --experimental_enable_bzlmod=false common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse_vendored/.bazelrc b/examples/pip_parse_vendored/.bazelrc index d5a69f7efb..be3555d1eb 100644 --- a/examples/pip_parse_vendored/.bazelrc +++ b/examples/pip_parse_vendored/.bazelrc @@ -5,7 +5,5 @@ build --enable_runfiles # Vendoring requirements.bzl files isn't necessary under bzlmod # When workspace support is dropped, this example can be removed. -common --noenable_bzlmod -common --enable_workspace - +build --noexperimental_enable_bzlmod common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/pip_repository_annotations/.bazelrc b/examples/pip_repository_annotations/.bazelrc index 1cdd89deb9..d893227946 100644 --- a/examples/pip_repository_annotations/.bazelrc +++ b/examples/pip_repository_annotations/.bazelrc @@ -3,7 +3,5 @@ try-import %workspace%/user.bazelrc # This example is WORKSPACE specific. The equivalent functionality # is in examples/bzlmod as the `whl_mods` feature. -common --noenable_bzlmod -common --enable_workspace - +build --experimental_enable_bzlmod=false --enable_workspace=true common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/examples/py_proto_library/.bazelrc b/examples/py_proto_library/.bazelrc index bd8a2b3031..d73fc5387a 100644 --- a/examples/py_proto_library/.bazelrc +++ b/examples/py_proto_library/.bazelrc @@ -1,5 +1,3 @@ # The equivalent bzlmod behavior is covered by examples/bzlmod/py_proto_library -common --noenable_bzlmod -common --enable_workspace - +common --noenable_bzlmod --enable_workspace=true common:bazel7.x --incompatible_python_disallow_native_rules From 845fb6bbc6557c436ffc714f1afec8bb06f0d4a2 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:23:27 +0900 Subject: [PATCH 07/21] Revert "ci: remove bzlmod CI config for pip_parse_vendored" This reverts commit 62374d9188593aea7a81473b59b230478a0dc963. --- .bazelci/presubmit.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 11d4c060a5..25510fce40 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -413,21 +413,25 @@ tasks: name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel" working_directory: examples/pip_parse_vendored platform: ubuntu2004 + integration_test_pip_parse_vendored_ubuntu_min_bzlmod: + <<: *minimum_supported_version + <<: *reusable_build_test_all + name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel" + working_directory: examples/pip_parse_vendored + platform: ubuntu2004 + bazel: 7.x integration_test_pip_parse_vendored_ubuntu: <<: *reusable_build_test_all - <<: *common_workspace_flags name: "examples/pip_parse_vendored: Ubuntu" working_directory: examples/pip_parse_vendored platform: ubuntu2004 integration_test_pip_parse_vendored_debian: <<: *reusable_build_test_all - <<: *common_workspace_flags name: "examples/pip_parse_vendored: Debian" working_directory: examples/pip_parse_vendored platform: debian11 integration_test_pip_parse_vendored_macos: <<: *reusable_build_test_all - <<: *common_workspace_flags name: "examples/pip_parse_vendored: MacOS" working_directory: examples/pip_parse_vendored platform: macos From ca810a40e57c99298d5ec41d058d1e9e30c202c5 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:23:48 +0900 Subject: [PATCH 08/21] Reapply "ci: remove bzlmod CI config for pip_parse_vendored" This reverts commit 845fb6bbc6557c436ffc714f1afec8bb06f0d4a2. --- .bazelci/presubmit.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 25510fce40..11d4c060a5 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -413,25 +413,21 @@ tasks: name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel" working_directory: examples/pip_parse_vendored platform: ubuntu2004 - integration_test_pip_parse_vendored_ubuntu_min_bzlmod: - <<: *minimum_supported_version - <<: *reusable_build_test_all - name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel" - working_directory: examples/pip_parse_vendored - platform: ubuntu2004 - bazel: 7.x integration_test_pip_parse_vendored_ubuntu: <<: *reusable_build_test_all + <<: *common_workspace_flags name: "examples/pip_parse_vendored: Ubuntu" working_directory: examples/pip_parse_vendored platform: ubuntu2004 integration_test_pip_parse_vendored_debian: <<: *reusable_build_test_all + <<: *common_workspace_flags name: "examples/pip_parse_vendored: Debian" working_directory: examples/pip_parse_vendored platform: debian11 integration_test_pip_parse_vendored_macos: <<: *reusable_build_test_all + <<: *common_workspace_flags name: "examples/pip_parse_vendored: MacOS" working_directory: examples/pip_parse_vendored platform: macos From b1f3d30b084b01c94ba69783f4cd52baa5f75380 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:23:58 +0900 Subject: [PATCH 09/21] fix bazel 8.x workspace init --- WORKSPACE | 15 +++++++++++++++ internal_dev_deps.bzl | 5 ++--- internal_dev_setup.bzl | 4 ---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c0d9f33a9b..6e9e85ac1e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -21,6 +21,21 @@ load("//:internal_dev_deps.bzl", "rules_python_internal_deps") rules_python_internal_deps() +load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") + +rules_java_dependencies() + +# note that the following line is what is minimally required from protobuf for the java rules +# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl +load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility + +proto_bazel_features(name = "proto_bazel_features") + +# register toolchains +load("@rules_java//java:repositories.bzl", "rules_java_toolchains") + +rules_java_toolchains() + load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() diff --git a/internal_dev_deps.bzl b/internal_dev_deps.bzl index e76ee48e83..0304fb16b7 100644 --- a/internal_dev_deps.bzl +++ b/internal_dev_deps.bzl @@ -195,10 +195,9 @@ def rules_python_internal_deps(): http_archive( name = "rules_java", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/8.3.1/rules_java-8.3.1.tar.gz", - "https://github.com/bazelbuild/rules_java/releases/download/8.3.1/rules_java-8.3.1.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/8.6.2/rules_java-8.6.2.tar.gz", ], - sha256 = "ee786b943e00da4fea7c233e70e5f5b8a01cc69b9341b3f49169f174fe0df1c5", + sha256 = "a64ab04616e76a448c2c2d8165d836f0d2fb0906200d0b7c7376f46dd62e59cc", ) RULES_JVM_EXTERNAL_TAG = "5.2" diff --git a/internal_dev_setup.bzl b/internal_dev_setup.bzl index d6e95e22ce..fc38e3f9c5 100644 --- a/internal_dev_setup.bzl +++ b/internal_dev_setup.bzl @@ -20,7 +20,6 @@ load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies") load("@rules_bazel_integration_test//bazel_integration_test:repo_defs.bzl", "bazel_binaries") -load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains") load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains") load("//:version.bzl", "SUPPORTED_BAZEL_VERSIONS") load("//python:versions.bzl", "MINOR_MAPPING", "TOOL_VERSIONS") @@ -47,9 +46,6 @@ def rules_python_internal_setup(): protobuf_deps() - rules_java_dependencies() - rules_java_toolchains() - bazel_integration_test_rules_dependencies() bazel_starlib_dependencies() bazel_binaries(versions = SUPPORTED_BAZEL_VERSIONS) From ab6d83950965170f54199064c3cfe6d6d131a779 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:27:36 +0900 Subject: [PATCH 10/21] drop bazel 6 support for pip_parse_vendored --- examples/pip_parse_vendored/.bazelrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/pip_parse_vendored/.bazelrc b/examples/pip_parse_vendored/.bazelrc index be3555d1eb..a6ea2d9138 100644 --- a/examples/pip_parse_vendored/.bazelrc +++ b/examples/pip_parse_vendored/.bazelrc @@ -5,5 +5,6 @@ build --enable_runfiles # Vendoring requirements.bzl files isn't necessary under bzlmod # When workspace support is dropped, this example can be removed. -build --noexperimental_enable_bzlmod -common:bazel7.x --incompatible_python_disallow_native_rules +common --noenable_bzlmod +common --enable_workspace +common --incompatible_python_disallow_native_rules From 598b89cd770dac0747dfccdec97f1f342ad298e7 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:28:14 +0900 Subject: [PATCH 11/21] drop bazel 6 support for build_file_generation --- examples/build_file_generation/.bazelrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/build_file_generation/.bazelrc b/examples/build_file_generation/.bazelrc index fd0f731d2f..306954d7be 100644 --- a/examples/build_file_generation/.bazelrc +++ b/examples/build_file_generation/.bazelrc @@ -5,6 +5,6 @@ build --enable_runfiles # The bzlmod version of this example is in examples/bzlmod_build_file_generation # Once WORKSPACE support is dropped, this example can be entirely deleted. -build --experimental_enable_bzlmod=false - -common:bazel7.x --incompatible_python_disallow_native_rules +common --noenable_bzlmod +common --enable_workspace +common --incompatible_python_disallow_native_rules From ae7365a1e2d0a816f8bde87e654e458100cdc492 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:29:48 +0900 Subject: [PATCH 12/21] drop bazel 6 for pip_parse example --- examples/pip_parse/.bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pip_parse/.bazelrc b/examples/pip_parse/.bazelrc index a56904803c..f263a1744d 100644 --- a/examples/pip_parse/.bazelrc +++ b/examples/pip_parse/.bazelrc @@ -1,3 +1,3 @@ # https://docs.bazel.build/versions/main/best-practices.html#using-the-bazelrc-file try-import %workspace%/user.bazelrc -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules From 7c07625afad5713b4375aa8f2d52465af4ab4232 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:29:58 +0900 Subject: [PATCH 13/21] drop bazel 6 for pip_parse example --- examples/pip_repository_annotations/.bazelrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/pip_repository_annotations/.bazelrc b/examples/pip_repository_annotations/.bazelrc index d893227946..c16c5a24f2 100644 --- a/examples/pip_repository_annotations/.bazelrc +++ b/examples/pip_repository_annotations/.bazelrc @@ -3,5 +3,6 @@ try-import %workspace%/user.bazelrc # This example is WORKSPACE specific. The equivalent functionality # is in examples/bzlmod as the `whl_mods` feature. -build --experimental_enable_bzlmod=false --enable_workspace=true -common:bazel7.x --incompatible_python_disallow_native_rules +common --noenable_bzlmod +common --enable_workspace +common --incompatible_python_disallow_native_rules From 9800e07bcafdf51bcc26ccfd457cd8f7b802fb02 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:30:35 +0900 Subject: [PATCH 14/21] drop bazel 6 support for py_proto_library example --- examples/py_proto_library/.bazelrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/py_proto_library/.bazelrc b/examples/py_proto_library/.bazelrc index d73fc5387a..2ed86f591e 100644 --- a/examples/py_proto_library/.bazelrc +++ b/examples/py_proto_library/.bazelrc @@ -1,3 +1,4 @@ # The equivalent bzlmod behavior is covered by examples/bzlmod/py_proto_library -common --noenable_bzlmod --enable_workspace=true -common:bazel7.x --incompatible_python_disallow_native_rules +common --noenable_bzlmod +common --enable_workspace +common --incompatible_python_disallow_native_rules From 7db5b7460ae09a9dcce6c9836604d6d9403aba9d Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:36:35 +0900 Subject: [PATCH 15/21] use bazel 8.x everywhere and bump the CI minimum bazel version to 7.x --- .bazelci/presubmit.yml | 8 +++----- .bazelversion | 2 +- version.bzl | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 11d4c060a5..1ab4821855 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -18,12 +18,12 @@ buildifier: # Use a specific version to avoid skew issues when new versions are released. version: 6.1.0 warnings: "all" -# NOTE: Minimum supported version is 6.x for workspace; 7.x for bzlmod +# NOTE: Minimum supported version is 7.x .minimum_supported_version: &minimum_supported_version # For testing minimum supported version. # NOTE: Keep in sync with //:version.bzl - bazel: 6.4.0 - skip_in_bazel_downstream_pipeline: "Bazel 6 required" + bazel: 7.4.1 + skip_in_bazel_downstream_pipeline: "Bazel 7 required" .reusable_config: &reusable_config build_targets: - "--" @@ -34,7 +34,6 @@ buildifier: build_flags: - "--keep_going" - "--build_tag_filters=-integration-test" - - "--config=bazel7.x" test_targets: - "--" - "..." @@ -160,7 +159,6 @@ tasks: - "--enable_workspace" - "--keep_going" - "--build_tag_filters=-integration-test" - - "--config=bazel7.x" test_targets: - "--" - "..." diff --git a/.bazelversion b/.bazelversion index 35907cd9ca..c6b7980b68 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.x +8.x diff --git a/version.bzl b/version.bzl index 61fb81efd4..4d85b5c420 100644 --- a/version.bzl +++ b/version.bzl @@ -17,11 +17,11 @@ # against. # This version should be updated together with the version of Bazel # in .bazelversion. -BAZEL_VERSION = "7.x" +BAZEL_VERSION = "8.x" # NOTE: Keep in sync with .bazelci/presubmit.yml # This is the minimum supported bazel version, that we have some tests for. -MINIMUM_BAZEL_VERSION = "6.4.0" +MINIMUM_BAZEL_VERSION = "7.4.1" # Versions of Bazel which users should be able to use. # Ensures we don't break backwards-compatibility, From 879db634d11d704dffcfcf8d9b51372bc5e2986d Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:04:18 +0900 Subject: [PATCH 16/21] start updating for integration tests --- .bazelrc | 4 ++-- .pre-commit-config.yaml | 2 +- MODULE.bazel | 8 ++++---- tests/integration/BUILD.bazel | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.bazelrc b/.bazelrc index c44124d961..ada5c5a0a7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -23,7 +23,7 @@ common --incompatible_disallow_struct_provider_syntax # Windows makes use of runfiles for some rules build --enable_runfiles -# Make Bazel 6 use bzlmod by default +# Make Bazel 7 use bzlmod by default common --enable_bzlmod # Additional config to use for readthedocs builds. @@ -33,6 +33,6 @@ build:rtd --stamp # Some bzl files contain repos only available under bzlmod build:rtd --enable_bzlmod -common:bazel7.x --incompatible_python_disallow_native_rules +common --incompatible_python_disallow_native_rules build --lockfile_mode=update diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 707a8d78aa..c0e33c2a8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,6 +46,6 @@ repos: - id: update-deleted-packages name: Update deleted packages language: system - entry: bazel run @rules_bazel_integration_test//tools:update_deleted_packages + entry: env USE_BAZEL_VERSION=7.x bazel run @rules_bazel_integration_test//tools:update_deleted_packages files: ^((examples|tests)/.*/(MODULE.bazel|WORKSPACE|WORKSPACE.bzlmod|BUILD.bazel)|.bazelrc)$ pass_filenames: false diff --git a/MODULE.bazel b/MODULE.bazel index e4b113e785..57780b2369 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -150,8 +150,8 @@ bazel_binaries.local( name = "self", path = "tests/integration/bazel_from_env", ) -bazel_binaries.download(version = "6.4.0") -bazel_binaries.download(version = "7.4.0") +bazel_binaries.download(version = "7.4.1") +bazel_binaries.download(version = "8.0.0") # For now, don't test with rolling, because that's Bazel 9, which is a ways # away. @@ -162,8 +162,8 @@ use_repo( # These don't appear necessary, but are reported as direct dependencies # that should be use_repo()'d, so we add them as requested "bazel_binaries_bazelisk", - "build_bazel_bazel_6_4_0", - "build_bazel_bazel_7_4_0", + "build_bazel_bazel_7_4_1", + "build_bazel_bazel_8_0_0", # "build_bazel_bazel_rolling", "build_bazel_bazel_self", ) diff --git a/tests/integration/BUILD.bazel b/tests/integration/BUILD.bazel index 289c85d38a..6a894d0faa 100644 --- a/tests/integration/BUILD.bazel +++ b/tests/integration/BUILD.bazel @@ -36,7 +36,7 @@ _GAZELLE_PLUGIN_FLAGS = [ ] default_test_runner( - name = "bazel_6_4_workspace_test_runner", + name = "bazel_7_4_workspace_test_runner", bazel_cmds = [ "info {}".format(" ".join(_LEGACY_WORKSPACE_FLAGS)), "test {} //...".format(" ".join(_LEGACY_WORKSPACE_FLAGS)), @@ -45,7 +45,7 @@ default_test_runner( ) default_test_runner( - name = "bazel_6_4_workspace_test_runner_gazelle_plugin", + name = "bazel_7_4_workspace_test_runner_gazelle_plugin", bazel_cmds = [ "info {}".format(" ".join(_LEGACY_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)), "test {} //...".format(" ".join(_LEGACY_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)), From 71f40a5551377f5c9341d628c0520bc10bbda89e Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:17:32 +0900 Subject: [PATCH 17/21] remove the defunct runner --- .bazelci/presubmit.yml | 3 +-- tests/integration/BUILD.bazel | 23 +---------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 1ab4821855..47c8f26578 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -22,7 +22,7 @@ buildifier: .minimum_supported_version: &minimum_supported_version # For testing minimum supported version. # NOTE: Keep in sync with //:version.bzl - bazel: 7.4.1 + bazel: 7.x skip_in_bazel_downstream_pipeline: "Bazel 7 required" .reusable_config: &reusable_config build_targets: @@ -186,7 +186,6 @@ tasks: <<: *reusable_config name: "RBE: Ubuntu, minimum Bazel" platform: rbe_ubuntu2004 - bazel: 7.x build_flags: # BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1, # which prevents cc toolchain autodetection from working correctly diff --git a/tests/integration/BUILD.bazel b/tests/integration/BUILD.bazel index 6a894d0faa..d178e0f01c 100644 --- a/tests/integration/BUILD.bazel +++ b/tests/integration/BUILD.bazel @@ -19,11 +19,8 @@ load(":integration_test.bzl", "rules_python_integration_test") licenses(["notice"]) -_LEGACY_WORKSPACE_FLAGS = [ +_WORKSPACE_FLAGS = [ "--noenable_bzlmod", -] - -_WORKSPACE_FLAGS = _LEGACY_WORKSPACE_FLAGS + [ "--enable_workspace", ] @@ -35,24 +32,6 @@ _GAZELLE_PLUGIN_FLAGS = [ "--override_module=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin", ] -default_test_runner( - name = "bazel_7_4_workspace_test_runner", - bazel_cmds = [ - "info {}".format(" ".join(_LEGACY_WORKSPACE_FLAGS)), - "test {} //...".format(" ".join(_LEGACY_WORKSPACE_FLAGS)), - ], - visibility = ["//visibility:public"], -) - -default_test_runner( - name = "bazel_7_4_workspace_test_runner_gazelle_plugin", - bazel_cmds = [ - "info {}".format(" ".join(_LEGACY_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)), - "test {} //...".format(" ".join(_LEGACY_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)), - ], - visibility = ["//visibility:public"], -) - default_test_runner( name = "workspace_test_runner", bazel_cmds = [ From aa1b0fda555e6295e839a12030fcd6ce39e98e1d Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:27:04 +0900 Subject: [PATCH 18/21] add a missing BUILD.bazel file for integration tests --- python/BUILD.bazel | 1 + python/runtime_env_toolchains/BUILD.bazel | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/python/BUILD.bazel b/python/BUILD.bazel index 3422ef14fa..b747e2fbc7 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -43,6 +43,7 @@ filegroup( "//python/pip_install:distribution", "//python/private:distribution", "//python/runfiles:distribution", + "//python/runtime_env_toolchains:distribution", "//python/uv:distribution", ], visibility = ["//:__pkg__"], diff --git a/python/runtime_env_toolchains/BUILD.bazel b/python/runtime_env_toolchains/BUILD.bazel index 21355ac939..5001d12556 100644 --- a/python/runtime_env_toolchains/BUILD.bazel +++ b/python/runtime_env_toolchains/BUILD.bazel @@ -17,3 +17,9 @@ load("//python/private:runtime_env_toolchain.bzl", "define_runtime_env_toolchain package(default_visibility = ["//:__subpackages__"]) define_runtime_env_toolchain(name = "runtime_env_toolchain") + +filegroup( + name = "distribution", + srcs = glob(["**"]), + visibility = ["//python:__pkg__"], +) From ba1f574f48f3c4405087068a45663885ea341ab7 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:49:44 +0900 Subject: [PATCH 19/21] add a note on CI changes --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10a2be4edf..6bfb5028b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,7 +52,9 @@ Unreleased changes template. {#v0-0-0-changed} ### Changed -* Nothing changed. +* The earliest version that is tested in our CI for `WORKSPACE` support now + is `7.4.1`, which is in line with our bazel version support matrix - only the + two latest bazel versions are supported at a time. {#v0-0-0-fixed} ### Fixed From 730a5665e7af3780ed2c0accb23c418a90b4aacf Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:54:52 +0900 Subject: [PATCH 20/21] skip RBE --- .bazelci/presubmit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 47c8f26578..2de29cbd02 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -204,6 +204,8 @@ tasks: <<: *reusable_config name: "RBE: Ubuntu" platform: rbe_ubuntu2004 + # TODO @aignas 2024-12-11: get the RBE working in CI for bazel 8.0 + bazel: 7.x test_flags: - "--test_tag_filters=-integration-test,-acceptance-test" - "--extra_toolchains=@buildkite_config//config:cc-toolchain" From 47c87d288b28b19f271d555595260d7d1e90ac02 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Wed, 11 Dec 2024 09:02:34 -0800 Subject: [PATCH 21/21] Apply suggestions from code review --- .bazelci/presubmit.yml | 3 ++- .pre-commit-config.yaml | 2 ++ CHANGELOG.md | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 2de29cbd02..f1a912cf80 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -54,7 +54,7 @@ buildifier: build_flags: - "--noenable_bzlmod" - "--enable_workspace" - bazel: 7.4.1 + bazel: 7.x .common_bazelinbazel_config: &common_bazelinbazel_config build_flags: - "--build_tag_filters=integration-test" @@ -205,6 +205,7 @@ tasks: name: "RBE: Ubuntu" platform: rbe_ubuntu2004 # TODO @aignas 2024-12-11: get the RBE working in CI for bazel 8.0 + # See https://github.com/bazelbuild/rules_python/issues/2499 bazel: 7.x test_flags: - "--test_tag_filters=-integration-test,-acceptance-test" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0e33c2a8a..2b451e89fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,6 +46,8 @@ repos: - id: update-deleted-packages name: Update deleted packages language: system + # 7.x is necessary until https://github.com/bazel-contrib/rules_bazel_integration_test/pull/414 + # is merged and released entry: env USE_BAZEL_VERSION=7.x bazel run @rules_bazel_integration_test//tools:update_deleted_packages files: ^((examples|tests)/.*/(MODULE.bazel|WORKSPACE|WORKSPACE.bzlmod|BUILD.bazel)|.bazelrc)$ pass_filenames: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bfb5028b6..2cea8ba48c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,9 +52,9 @@ Unreleased changes template. {#v0-0-0-changed} ### Changed -* The earliest version that is tested in our CI for `WORKSPACE` support now - is `7.4.1`, which is in line with our bazel version support matrix - only the - two latest bazel versions are supported at a time. +* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported + version, per our Bazel support matrix. Earlier versions are not + tested by CI, so functionality cannot be guaranteed. {#v0-0-0-fixed} ### Fixed