From ccb341d8a6e9f08b2666dbcc81f46d3055e33b8c Mon Sep 17 00:00:00 2001 From: mai93 Date: Fri, 17 Oct 2025 13:37:38 -0400 Subject: [PATCH 1/9] Update rules_cc and protobuf --- MODULE.bazel | 4 ++-- internal_dev_deps.bzl | 12 ++++++------ python/private/py_repositories.bzl | 12 ++++++------ tests/integration/local_toolchains/MODULE.bazel | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 5854595bed..ecfa5eb05a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,12 +6,12 @@ module( bazel_dep(name = "bazel_features", version = "1.21.0") bazel_dep(name = "bazel_skylib", version = "1.8.2") -bazel_dep(name = "rules_cc", version = "0.1.5") +bazel_dep(name = "rules_cc", version = "0.2.10") bazel_dep(name = "platforms", version = "0.0.11") # Those are loaded only when using py_proto_library # Use py_proto_library directly from protobuf repository -bazel_dep(name = "protobuf", version = "29.0-rc2", repo_name = "com_google_protobuf") +bazel_dep(name = "protobuf", version = "33.0", repo_name = "com_google_protobuf") rules_python_config = use_extension("//python/extensions:config.bzl", "config") use_repo( diff --git a/internal_dev_deps.bzl b/internal_dev_deps.bzl index 811240a06a..b74178faba 100644 --- a/internal_dev_deps.bzl +++ b/internal_dev_deps.bzl @@ -195,9 +195,9 @@ def rules_python_internal_deps(): http_archive( name = "com_google_protobuf", - sha256 = "23082dca1ca73a1e9c6cbe40097b41e81f71f3b4d6201e36c134acc30a1b3660", - url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.0-rc2/protobuf-29.0-rc2.zip", - strip_prefix = "protobuf-29.0-rc2", + sha256 = "aaddf29b205ed915100a5fd096e8252842b67da9accfb7ba91ec3680ea307e45", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v33.0/protobuf-33.0.zip", + strip_prefix = "protobuf-33.0", ) # Needed for stardoc @@ -238,9 +238,9 @@ def rules_python_internal_deps(): http_archive( name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.5/rules_cc-0.1.5.tar.gz"], - sha256 = "b8b918a85f9144c01f6cfe0f45e4f2838c7413961a8ff23bc0c6cdf8bb07a3b6", - strip_prefix = "rules_cc-0.1.5", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.10/rules_cc-0.2.10.tar.gz"], + sha256 = "774fd6cb9f90f98f1d26c776896b16a517a1af65337fcfaa705261df175f04a6", + strip_prefix = "rules_cc-0.2.10", ) http_archive( diff --git a/python/private/py_repositories.bzl b/python/private/py_repositories.bzl index e3ab11c561..c6dca922bc 100644 --- a/python/private/py_repositories.bzl +++ b/python/private/py_repositories.bzl @@ -68,9 +68,9 @@ def py_repositories(transition_settings = []): ) http_archive( name = "rules_cc", - sha256 = "b8b918a85f9144c01f6cfe0f45e4f2838c7413961a8ff23bc0c6cdf8bb07a3b6", - strip_prefix = "rules_cc-0.1.5", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.5/rules_cc-0.1.5.tar.gz"], + sha256 = "774fd6cb9f90f98f1d26c776896b16a517a1af65337fcfaa705261df175f04a6", + strip_prefix = "rules_cc-0.2.10", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.10/rules_cc-0.2.10.tar.gz"], ) # Needed by rules_cc, triggered by @rules_java_prebuilt in Bazel by using @rules_cc//cc:defs.bzl @@ -78,8 +78,8 @@ def py_repositories(transition_settings = []): # support; Bazel itself has references to com_google_protobuf. http_archive( name = "com_google_protobuf", - sha256 = "23082dca1ca73a1e9c6cbe40097b41e81f71f3b4d6201e36c134acc30a1b3660", - url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.0-rc2/protobuf-29.0-rc2.zip", - strip_prefix = "protobuf-29.0-rc2", + sha256 = "aaddf29b205ed915100a5fd096e8252842b67da9accfb7ba91ec3680ea307e45", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v33.0/protobuf-33.0.zip", + strip_prefix = "protobuf-33.0", ) pypi_deps() diff --git a/tests/integration/local_toolchains/MODULE.bazel b/tests/integration/local_toolchains/MODULE.bazel index 6c821c5bb0..52d5cee454 100644 --- a/tests/integration/local_toolchains/MODULE.bazel +++ b/tests/integration/local_toolchains/MODULE.bazel @@ -16,7 +16,7 @@ module(name = "module_under_test") bazel_dep(name = "rules_python", version = "0.0.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "platforms", version = "0.0.11") -bazel_dep(name = "rules_cc", version = "0.1.5") +bazel_dep(name = "rules_cc", version = "0.2.10") local_path_override( module_name = "rules_python", From ae3f8472341bbe85941535f5005a47621a9d30a1 Mon Sep 17 00:00:00 2001 From: mai93 Date: Fri, 17 Oct 2025 15:28:56 -0400 Subject: [PATCH 2/9] load compatibility_proxy_repo in WORKSPACE --- WORKSPACE | 4 ++++ examples/build_file_generation/WORKSPACE | 7 +++++++ examples/multi_python_versions/WORKSPACE | 7 +++++++ examples/pip_parse/WORKSPACE | 7 +++++++ examples/pip_parse_vendored/WORKSPACE | 7 +++++++ examples/pip_repository_annotations/WORKSPACE | 7 +++++++ examples/py_proto_library/WORKSPACE | 7 +++++++ gazelle/WORKSPACE | 7 +++++++ python/private/py_repositories.bzl | 10 ++++++++++ tests/integration/compile_pip_requirements/WORKSPACE | 7 +++++++ .../WORKSPACE | 7 +++++++ tests/integration/custom_commands/WORKSPACE | 7 +++++++ tests/integration/ignore_root_user_error/WORKSPACE | 7 +++++++ tests/integration/local_toolchains/WORKSPACE | 7 +++++++ tests/integration/pip_parse/WORKSPACE | 7 +++++++ tests/integration/py_cc_toolchain_registered/WORKSPACE | 7 +++++++ 16 files changed, 112 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index 077ddb5e68..2bd97f3308 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -68,6 +68,10 @@ load("//:internal_dev_setup.bzl", "rules_python_internal_setup") rules_python_internal_setup() +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load("@pythons_hub//:versions.bzl", "PYTHON_VERSIONS") load("//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains") diff --git a/examples/build_file_generation/WORKSPACE b/examples/build_file_generation/WORKSPACE index 27d0d13b7c..57eb8fb186 100644 --- a/examples/build_file_generation/WORKSPACE +++ b/examples/build_file_generation/WORKSPACE @@ -29,6 +29,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist # Perform general setup py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + # We now register a hermetic Python interpreter rather than relying on a system-installed interpreter. # This toolchain will allow bazel to download a specific python version, and use that version # for compilation. diff --git a/examples/multi_python_versions/WORKSPACE b/examples/multi_python_versions/WORKSPACE index 6b69e0a891..ef0276a207 100644 --- a/examples/multi_python_versions/WORKSPACE +++ b/examples/multi_python_versions/WORKSPACE @@ -9,6 +9,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + default_python_version = "3.9" python_register_multi_toolchains( diff --git a/examples/pip_parse/WORKSPACE b/examples/pip_parse/WORKSPACE index bb4714d941..b479387297 100644 --- a/examples/pip_parse/WORKSPACE +++ b/examples/pip_parse/WORKSPACE @@ -9,6 +9,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python_3_9", python_version = "3.9.13", diff --git a/examples/pip_parse_vendored/WORKSPACE b/examples/pip_parse_vendored/WORKSPACE index d7a11ea596..41127f6fbb 100644 --- a/examples/pip_parse_vendored/WORKSPACE +++ b/examples/pip_parse_vendored/WORKSPACE @@ -9,6 +9,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", python_version = "3.9", diff --git a/examples/pip_repository_annotations/WORKSPACE b/examples/pip_repository_annotations/WORKSPACE index 8540555084..44655d1599 100644 --- a/examples/pip_repository_annotations/WORKSPACE +++ b/examples/pip_repository_annotations/WORKSPACE @@ -9,6 +9,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", python_version = "3.9", diff --git a/examples/py_proto_library/WORKSPACE b/examples/py_proto_library/WORKSPACE index 9cda5b97f1..4a4199d85f 100644 --- a/examples/py_proto_library/WORKSPACE +++ b/examples/py_proto_library/WORKSPACE @@ -16,6 +16,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist # We install the rules_python dependencies using the function below. py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", python_version = "3.9", diff --git a/gazelle/WORKSPACE b/gazelle/WORKSPACE index f4a3abf36c..6111b6a19a 100644 --- a/gazelle/WORKSPACE +++ b/gazelle/WORKSPACE @@ -61,3 +61,10 @@ load("//:deps.bzl", _py_gazelle_deps = "gazelle_deps") # gazelle:repository_macro deps.bzl%go_deps _py_gazelle_deps() + +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() diff --git a/python/private/py_repositories.bzl b/python/private/py_repositories.bzl index c6dca922bc..989c3b3caf 100644 --- a/python/private/py_repositories.bzl +++ b/python/private/py_repositories.bzl @@ -66,6 +66,8 @@ def py_repositories(transition_settings = []): "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz", ], ) + + # For this version of rules_cc, loading compatibility_proxy_repo in WORKSPACE is needed http_archive( name = "rules_cc", sha256 = "774fd6cb9f90f98f1d26c776896b16a517a1af65337fcfaa705261df175f04a6", @@ -73,6 +75,14 @@ def py_repositories(transition_settings = []): urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.10/rules_cc-0.2.10.tar.gz"], ) + # Needed by rules_cc 0.2.10 + http_archive( + name = "bazel_features", + sha256 = "adc8ddf121917f197f75c5245dfa8d7b1619f10a1002e25062b093b7957f2798", + strip_prefix = "bazel_features-1.37.0", + url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.37.0/bazel_features-v1.37.0.tar.gz", + ) + # Needed by rules_cc, triggered by @rules_java_prebuilt in Bazel by using @rules_cc//cc:defs.bzl # NOTE: This name must be com_google_protobuf until Bazel drops WORKSPACE # support; Bazel itself has references to com_google_protobuf. diff --git a/tests/integration/compile_pip_requirements/WORKSPACE b/tests/integration/compile_pip_requirements/WORKSPACE index 0eeab2067c..70ff7588d6 100644 --- a/tests/integration/compile_pip_requirements/WORKSPACE +++ b/tests/integration/compile_pip_requirements/WORKSPACE @@ -7,6 +7,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", python_version = "3.9", diff --git a/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE b/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE index 7834000854..9699ea7ea7 100644 --- a/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE +++ b/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE @@ -7,6 +7,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", python_version = "3.9", diff --git a/tests/integration/custom_commands/WORKSPACE b/tests/integration/custom_commands/WORKSPACE index de908549c0..d3690235a6 100644 --- a/tests/integration/custom_commands/WORKSPACE +++ b/tests/integration/custom_commands/WORKSPACE @@ -7,6 +7,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python_3_11", python_version = "3.11", diff --git a/tests/integration/ignore_root_user_error/WORKSPACE b/tests/integration/ignore_root_user_error/WORKSPACE index 7ac0a609eb..603d604823 100644 --- a/tests/integration/ignore_root_user_error/WORKSPACE +++ b/tests/integration/ignore_root_user_error/WORKSPACE @@ -7,6 +7,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", ignore_root_user_error = True, diff --git a/tests/integration/local_toolchains/WORKSPACE b/tests/integration/local_toolchains/WORKSPACE index 159f16deab..e42796fb06 100644 --- a/tests/integration/local_toolchains/WORKSPACE +++ b/tests/integration/local_toolchains/WORKSPACE @@ -15,6 +15,13 @@ py_repositories( ], ) +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + load("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo", "local_runtime_toolchains_repo") # Step 1: Define the python runtime. diff --git a/tests/integration/pip_parse/WORKSPACE b/tests/integration/pip_parse/WORKSPACE index e31655dbe4..f4e151cca5 100644 --- a/tests/integration/pip_parse/WORKSPACE +++ b/tests/integration/pip_parse/WORKSPACE @@ -7,6 +7,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python39", python_version = "3.9", diff --git a/tests/integration/py_cc_toolchain_registered/WORKSPACE b/tests/integration/py_cc_toolchain_registered/WORKSPACE index de908549c0..d3690235a6 100644 --- a/tests/integration/py_cc_toolchain_registered/WORKSPACE +++ b/tests/integration/py_cc_toolchain_registered/WORKSPACE @@ -7,6 +7,13 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist py_repositories() +# Needed for rules_cc 0.2.10 +load("@bazel_features//:deps.bzl", "bazel_features_deps") +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +compatibility_proxy_repo() + python_register_toolchains( name = "python_3_11", python_version = "3.11", From 0cfc66308f0dbb94f9246533bf6859fe1a719064 Mon Sep 17 00:00:00 2001 From: mai93 Date: Fri, 17 Oct 2025 19:06:30 -0400 Subject: [PATCH 3/9] fix CI --- .bazelci/presubmit.yml | 6 ++++++ examples/py_proto_library/WORKSPACE | 13 ++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 119ad498b0..da3af4c7e6 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -43,9 +43,15 @@ buildifier: build_flags: - "--noenable_bzlmod" - "--build_tag_filters=-integration-test" + # recent abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" test_flags: - "--noenable_bzlmod" - "--test_tag_filters=-integration-test" + # recent abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" .common_workspace_flags: &common_workspace_flags skip_in_bazel_downstream_pipeline: "Bazel 9 doesn't support workspace" test_flags: diff --git a/examples/py_proto_library/WORKSPACE b/examples/py_proto_library/WORKSPACE index 4a4199d85f..ad8e1b1d8c 100644 --- a/examples/py_proto_library/WORKSPACE +++ b/examples/py_proto_library/WORKSPACE @@ -29,15 +29,10 @@ python_register_toolchains( ) # Then we need to setup dependencies in order to use py_proto_library -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "com_google_protobuf", - 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") protobuf_deps() + +# Needed to load @compatibility_proxy for rules_java +load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") +rules_java_dependencies() From 0512e6cb6c0edd2fe1f5e93989223937490e10e7 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Fri, 17 Oct 2025 16:42:33 -0700 Subject: [PATCH 4/9] add changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23e05f02a5..4300ba0d70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,7 +61,11 @@ END_UNRELEASED_TEMPLATE {#v1-7-0-changed} ### Changed -* (deps) bumped rules_cc dependency to `0.1.5`. +* (deps) bumped rules_cc dependency to `0.2.10`. +* (deps) bumped protobuf dependency to `33.0`. +* (deps) WORKSPACE should call + `@rules_python//python:repositories_deps.bzl%rules_python_deps` + to setup additional dependencies. * (bootstrap) For {obj}`--bootstrap_impl=system_python`, `PYTHONPATH` is no longer used to add import paths. The sys.path order has changed from `[app paths, stdlib, runtime site-packages]` to `[stdlib, app paths, runtime From fa196a55ec5616744ba4ad76feda6f88bde6769c Mon Sep 17 00:00:00 2001 From: mai93 Date: Sat, 18 Oct 2025 12:12:14 -0400 Subject: [PATCH 5/9] use C++17 for bazel7 --- .bazelci/presubmit.yml | 59 +++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 0ba76df078..26af5787da 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -18,10 +18,18 @@ buildifier: # Use a specific version to avoid skew issues when new versions are released. version: 6.1.0 warnings: "all" +.bazel_7_cxx_17_config: &bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" # 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 + build_flags: + <<: *bazel_7_cxx_17_config + test_flags: + <<: *bazel_7_cxx_17_config bazel: 7.x skip_in_bazel_downstream_pipeline: "Bazel 7 required" .reusable_config: &reusable_config @@ -39,29 +47,44 @@ buildifier: - "..." test_flags: - "--test_tag_filters=-integration-test" +.reusable_config_bazel_7: &reusable_config_bazel_7 + build_targets: + - "--" + - "..." + # As a regression test for #225, check that wheel targets still build when + # their package path is qualified with the repo name. + - "@rules_python//examples/wheel/..." + build_flags: + - "--keep_going" + - "--build_tag_filters=-integration-test" + <<: *bazel_7_cxx_17_config + test_targets: + - "--" + - "..." + test_flags: + - "--test_tag_filters=-integration-test" + <<: *bazel_7_cxx_17_config .common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel build_flags: - "--noenable_bzlmod" - "--build_tag_filters=-integration-test" - # recent abseil-cpp requires C++17 which is not used by default in Bazel 7 - - "--cxxopt=-std=c++17" - - "--host_cxxopt=-std=c++17" + <<: *bazel_7_cxx_17_config test_flags: - "--noenable_bzlmod" - "--test_tag_filters=-integration-test" - # recent abseil-cpp requires C++17 which is not used by default in Bazel 7 - - "--cxxopt=-std=c++17" - - "--host_cxxopt=-std=c++17" + <<: *bazel_7_cxx_17_config .common_workspace_flags: &common_workspace_flags skip_in_bazel_downstream_pipeline: "Bazel 9 doesn't support workspace" test_flags: - "--noenable_bzlmod" - "--enable_workspace" - "--test_tag_filters=-integration-test" + <<: *bazel_7_cxx_17_config build_flags: - "--noenable_bzlmod" - "--enable_workspace" - "--build_tag_filters=-integration-test" + <<: *bazel_7_cxx_17_config bazel: 7.x # NOTE: The Mac and Windows bazelinbazel jobs override parts of this config. .common_bazelinbazel_config: &common_bazelinbazel_config @@ -125,7 +148,7 @@ tasks: ubuntu_min_bzlmod: <<: *minimum_supported_version - <<: *reusable_config + <<: *reusable_config_bazel_7 name: "Default: Ubuntu, bzlmod, minimum Bazel" platform: ubuntu2204 bazel: 7.x @@ -204,7 +227,7 @@ tasks: - "--test_tag_filters=-integration-test,-fix-windows" rbe_min: <<: *minimum_supported_version - <<: *reusable_config + <<: *reusable_config_bazel_7 name: "RBE: Ubuntu, minimum Bazel" platform: rbe_ubuntu2204 build_flags: @@ -222,7 +245,7 @@ tasks: # build kite cc toolchain. - "--extra_toolchains=@buildkite_config//config:cc-toolchain" rbe: - <<: *reusable_config + <<: *reusable_config_bazel_7 name: "RBE: Ubuntu" platform: rbe_ubuntu2204 # TODO @aignas 2024-12-11: get the RBE working in CI for bazel 8.0 @@ -231,7 +254,7 @@ tasks: test_flags: - "--test_tag_filters=-integration-test,-acceptance-test" - "--extra_toolchains=@buildkite_config//config:cc-toolchain" - + <<: *bazel_7_cxx_17_config integration_test_build_file_generation_ubuntu_minimum_supported_workspace: <<: *minimum_supported_version <<: *reusable_build_test_all @@ -279,6 +302,10 @@ tasks: working_directory: examples/bzlmod platform: ubuntu2204 bazel: 7.x + build_flags: + <<: *bazel_7_cxx_17_config + test_flags: + <<: *bazel_7_cxx_17_config integration_test_bzlmod_ubuntu_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -293,6 +320,10 @@ tasks: working_directory: examples/bzlmod platform: debian11 bazel: 7.x + build_flags: + <<: *bazel_7_cxx_17_config + test_flags: + <<: *bazel_7_cxx_17_config integration_test_bzlmod_ubuntu_vendor: <<: *reusable_build_test_all name: "examples/bzlmod: bazel vendor" @@ -309,6 +340,10 @@ tasks: working_directory: examples/bzlmod platform: macos bazel: 7.x + build_flags: + <<: *bazel_7_cxx_17_config + test_flags: + <<: *bazel_7_cxx_17_config integration_test_bzlmod_macos_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -323,6 +358,10 @@ tasks: working_directory: examples/bzlmod platform: windows bazel: 7.x + build_flags: + <<: *bazel_7_cxx_17_config + test_flags: + <<: *bazel_7_cxx_17_config integration_test_bzlmod_windows_upcoming: <<: *reusable_build_test_all # coverage is not supported on Windows From 58b2ac1061954b0eedf42d85a28635ed6aec0940 Mon Sep 17 00:00:00 2001 From: mai93 Date: Sat, 18 Oct 2025 13:06:49 -0400 Subject: [PATCH 6/9] fix presubmit.yaml --- .bazelci/presubmit.yml | 62 ++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 26af5787da..9e2379fd99 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -18,18 +18,19 @@ buildifier: # Use a specific version to avoid skew issues when new versions are released. version: 6.1.0 warnings: "all" -.bazel_7_cxx_17_config: &bazel_7_cxx_17_config +.bazel_7_cxx_17_flags: &bazel_7_cxx_17_flags # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 - - "--cxxopt=-std=c++17" - - "--host_cxxopt=-std=c++17" + build_flags: + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" + test_flags: + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" # 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 - build_flags: - <<: *bazel_7_cxx_17_config - test_flags: - <<: *bazel_7_cxx_17_config + <<: *bazel_7_cxx_17_flags bazel: 7.x skip_in_bazel_downstream_pipeline: "Bazel 7 required" .reusable_config: &reusable_config @@ -57,34 +58,46 @@ buildifier: build_flags: - "--keep_going" - "--build_tag_filters=-integration-test" - <<: *bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" test_targets: - "--" - "..." test_flags: - "--test_tag_filters=-integration-test" - <<: *bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" .common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel build_flags: - "--noenable_bzlmod" - "--build_tag_filters=-integration-test" - <<: *bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" test_flags: - "--noenable_bzlmod" - "--test_tag_filters=-integration-test" - <<: *bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" .common_workspace_flags: &common_workspace_flags skip_in_bazel_downstream_pipeline: "Bazel 9 doesn't support workspace" test_flags: - "--noenable_bzlmod" - "--enable_workspace" - "--test_tag_filters=-integration-test" - <<: *bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" build_flags: - "--noenable_bzlmod" - "--enable_workspace" - "--build_tag_filters=-integration-test" - <<: *bazel_7_cxx_17_config + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" bazel: 7.x # NOTE: The Mac and Windows bazelinbazel jobs override parts of this config. .common_bazelinbazel_config: &common_bazelinbazel_config @@ -254,7 +267,8 @@ tasks: test_flags: - "--test_tag_filters=-integration-test,-acceptance-test" - "--extra_toolchains=@buildkite_config//config:cc-toolchain" - <<: *bazel_7_cxx_17_config + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" integration_test_build_file_generation_ubuntu_minimum_supported_workspace: <<: *minimum_supported_version <<: *reusable_build_test_all @@ -298,14 +312,11 @@ tasks: integration_test_bzlmod_ubuntu: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod + <<: *bazel_7_cxx_17_flags name: "examples/bzlmod: Ubuntu" working_directory: examples/bzlmod platform: ubuntu2204 bazel: 7.x - build_flags: - <<: *bazel_7_cxx_17_config - test_flags: - <<: *bazel_7_cxx_17_config integration_test_bzlmod_ubuntu_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -316,14 +327,11 @@ tasks: integration_test_bzlmod_debian: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod + <<: *bazel_7_cxx_17_flags name: "examples/bzlmod: Debian" working_directory: examples/bzlmod platform: debian11 bazel: 7.x - build_flags: - <<: *bazel_7_cxx_17_config - test_flags: - <<: *bazel_7_cxx_17_config integration_test_bzlmod_ubuntu_vendor: <<: *reusable_build_test_all name: "examples/bzlmod: bazel vendor" @@ -336,14 +344,11 @@ tasks: integration_test_bzlmod_macos: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod + <<: *bazel_7_cxx_17_flags name: "examples/bzlmod: macOS" working_directory: examples/bzlmod platform: macos bazel: 7.x - build_flags: - <<: *bazel_7_cxx_17_config - test_flags: - <<: *bazel_7_cxx_17_config integration_test_bzlmod_macos_upcoming: <<: *reusable_build_test_all <<: *coverage_targets_example_bzlmod @@ -353,15 +358,12 @@ tasks: bazel: last_rc integration_test_bzlmod_windows: <<: *reusable_build_test_all + <<: *bazel_7_cxx_17_flags # coverage is not supported on Windows name: "examples/bzlmod: Windows" working_directory: examples/bzlmod platform: windows bazel: 7.x - build_flags: - <<: *bazel_7_cxx_17_config - test_flags: - <<: *bazel_7_cxx_17_config integration_test_bzlmod_windows_upcoming: <<: *reusable_build_test_all # coverage is not supported on Windows From 490e7a8872c441a989d1bd84f7aa484288efb659 Mon Sep 17 00:00:00 2001 From: mai93 Date: Sat, 18 Oct 2025 14:40:44 -0400 Subject: [PATCH 7/9] fix ci --- .bazelci/presubmit.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 9e2379fd99..aeeb099755 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -26,6 +26,9 @@ buildifier: test_flags: - "--cxxopt=-std=c++17" - "--host_cxxopt=-std=c++17" + coverage_flags: + - "--cxxopt=-std=c++17" + - "--host_cxxopt=-std=c++17" # NOTE: Minimum supported version is 7.x .minimum_supported_version: &minimum_supported_version # For testing minimum supported version. @@ -339,7 +342,7 @@ tasks: platform: ubuntu2204 shell_commands: - "bazel vendor --vendor_dir=./vendor //..." - - "bazel build --vendor_dir=./vendor //..." + - "bazel build --vendor_dir=./vendor --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //..." - "rm -rf ./vendor" integration_test_bzlmod_macos: <<: *reusable_build_test_all From aac440a4d8282aae3c411e96f036c265ac6c1c8a Mon Sep 17 00:00:00 2001 From: mai93 Date: Sat, 18 Oct 2025 15:05:22 -0400 Subject: [PATCH 8/9] test windows c++17 --- .bazelci/presubmit.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index aeeb099755..e52efa4572 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -219,6 +219,8 @@ tasks: - "--enable_workspace" - "--keep_going" - "--build_tag_filters=-integration-test" + - "--cxxopt=/std=c++17" + - "--host_cxxopt=/std=c++17" test_targets: - "--" - "..." @@ -226,6 +228,8 @@ tasks: - "--noenable_bzlmod" - "--enable_workspace" - "--test_tag_filters=-integration-test" + - "--cxxopt=/std=c++17" + - "--host_cxxopt=/std=c++17" debian: <<: *reusable_config @@ -337,6 +341,7 @@ tasks: bazel: 7.x integration_test_bzlmod_ubuntu_vendor: <<: *reusable_build_test_all + <<: *bazel_7_cxx_17_flags name: "examples/bzlmod: bazel vendor" working_directory: examples/bzlmod platform: ubuntu2204 @@ -361,12 +366,17 @@ tasks: bazel: last_rc integration_test_bzlmod_windows: <<: *reusable_build_test_all - <<: *bazel_7_cxx_17_flags # coverage is not supported on Windows name: "examples/bzlmod: Windows" working_directory: examples/bzlmod platform: windows bazel: 7.x + build_flags: + - "--cxxopt=/std=c++17" + - "--host_cxxopt=/std=c++17" + test_flags: + - "--cxxopt=/std=c++17" + - "--host_cxxopt=/std=c++17" integration_test_bzlmod_windows_upcoming: <<: *reusable_build_test_all # coverage is not supported on Windows @@ -534,6 +544,20 @@ tasks: name: "examples/py_proto_library: Windows, workspace" working_directory: examples/py_proto_library platform: windows + test_flags: + - "--noenable_bzlmod" + - "--enable_workspace" + - "--test_tag_filters=-integration-test" + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=/std=c++17" + - "--host_cxxopt=/std=c++17" + build_flags: + - "--noenable_bzlmod" + - "--enable_workspace" + - "--build_tag_filters=-integration-test" + # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 + - "--cxxopt=/std=c++17" + - "--host_cxxopt=/std=c++17" integration_test_pip_repository_annotations_ubuntu_workspace: <<: *reusable_build_test_all From 1ed0a1ccad24fc6066363cdfe160c25bf31a4c44 Mon Sep 17 00:00:00 2001 From: mai93 Date: Sat, 18 Oct 2025 15:08:26 -0400 Subject: [PATCH 9/9] fix windows c++17 --- .bazelci/presubmit.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e52efa4572..4ce90b0db1 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -219,8 +219,8 @@ tasks: - "--enable_workspace" - "--keep_going" - "--build_tag_filters=-integration-test" - - "--cxxopt=/std=c++17" - - "--host_cxxopt=/std=c++17" + - "--cxxopt=/std:c++17" + - "--host_cxxopt=/std:c++17" test_targets: - "--" - "..." @@ -228,8 +228,8 @@ tasks: - "--noenable_bzlmod" - "--enable_workspace" - "--test_tag_filters=-integration-test" - - "--cxxopt=/std=c++17" - - "--host_cxxopt=/std=c++17" + - "--cxxopt=/std:c++17" + - "--host_cxxopt=/std:c++17" debian: <<: *reusable_config @@ -372,11 +372,11 @@ tasks: platform: windows bazel: 7.x build_flags: - - "--cxxopt=/std=c++17" - - "--host_cxxopt=/std=c++17" + - "--cxxopt=/std:c++17" + - "--host_cxxopt=/std:c++17" test_flags: - - "--cxxopt=/std=c++17" - - "--host_cxxopt=/std=c++17" + - "--cxxopt=/std:c++17" + - "--host_cxxopt=/std:c++17" integration_test_bzlmod_windows_upcoming: <<: *reusable_build_test_all # coverage is not supported on Windows @@ -549,15 +549,15 @@ tasks: - "--enable_workspace" - "--test_tag_filters=-integration-test" # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 - - "--cxxopt=/std=c++17" - - "--host_cxxopt=/std=c++17" + - "--cxxopt=/std:c++17" + - "--host_cxxopt=/std:c++17" build_flags: - "--noenable_bzlmod" - "--enable_workspace" - "--build_tag_filters=-integration-test" # recent protobuf and abseil-cpp requires C++17 which is not used by default in Bazel 7 - - "--cxxopt=/std=c++17" - - "--host_cxxopt=/std=c++17" + - "--cxxopt=/std:c++17" + - "--host_cxxopt=/std:c++17" integration_test_pip_repository_annotations_ubuntu_workspace: <<: *reusable_build_test_all