Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 79 additions & 5 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@ buildifier:
# Use a specific version to avoid skew issues when new versions are released.
version: 6.1.0
warnings: "all"
.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
build_flags:
- "--cxxopt=-std=c++17"
- "--host_cxxopt=-std=c++17"
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.
# NOTE: Keep in sync with //:version.bzl
<<: *bazel_7_cxx_17_flags
bazel: 7.x
skip_in_bazel_downstream_pipeline: "Bazel 7 required"
.reusable_config: &reusable_config
Expand All @@ -39,23 +51,56 @@ 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"
# 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"
# 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"
# 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"
# 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"
# 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"
bazel: 7.x
# NOTE: The Mac and Windows bazelinbazel jobs override parts of this config.
.common_bazelinbazel_config: &common_bazelinbazel_config
Expand Down Expand Up @@ -119,7 +164,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
Expand Down Expand Up @@ -174,13 +219,17 @@ tasks:
- "--enable_workspace"
- "--keep_going"
- "--build_tag_filters=-integration-test"
- "--cxxopt=/std:c++17"
- "--host_cxxopt=/std:c++17"
test_targets:
- "--"
- "..."
test_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
- "--test_tag_filters=-integration-test"
- "--cxxopt=/std:c++17"
- "--host_cxxopt=/std:c++17"

debian:
<<: *reusable_config
Expand All @@ -198,7 +247,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:
Expand All @@ -216,7 +265,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
Expand All @@ -225,7 +274,8 @@ tasks:
test_flags:
- "--test_tag_filters=-integration-test,-acceptance-test"
- "--extra_toolchains=@buildkite_config//config:cc-toolchain"

- "--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
Expand Down Expand Up @@ -269,6 +319,7 @@ 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
Expand All @@ -283,22 +334,25 @@ 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
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
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
<<: *coverage_targets_example_bzlmod
<<: *bazel_7_cxx_17_flags
name: "examples/bzlmod: macOS"
working_directory: examples/bzlmod
platform: macos
Expand All @@ -317,6 +371,12 @@ tasks:
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
Expand Down Expand Up @@ -484,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
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
7 changes: 7 additions & 0 deletions examples/build_file_generation/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions examples/multi_python_versions/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 7 additions & 0 deletions examples/pip_parse/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions examples/pip_parse_vendored/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions examples/pip_repository_annotations/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 11 additions & 9 deletions examples/py_proto_library/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ 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",
)

# 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()
7 changes: 7 additions & 0 deletions gazelle/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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()
12 changes: 6 additions & 6 deletions internal_dev_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Loading