Skip to content

Commit

Permalink
fix: Remove transitive legacy struct provider usage (#1957)
Browse files Browse the repository at this point in the history
Makes `rules_python` compatible with
`--incompatible_disallow_struct_provider_syntax`.

Fixes #1956
  • Loading branch information
fmeum authored Jun 13, 2024
1 parent b07525c commit e682cd0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ test --test_output=errors
# Python targets as required.
build --incompatible_default_to_explicit_init_py

# Ensure ongoing compatibility with this flag.
common --incompatible_disallow_struct_provider_syntax

# Windows makes use of runfiles for some rules
build --enable_runfiles

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A brief description of the categories of changes:
[x.x.x]: /~https://github.com/bazelbuild/rules_python/releases/tag/x.x.x

### Changed
* Nothing yet
* `protobuf`/`com_google_protobuf` dependency bumped to `v24.4`

### Fixed
* Nothing yet
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bazel_dep(name = "platforms", version = "0.0.4")

# Those are loaded only when using py_proto_library
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")

internal_deps = use_extension("//python/private/bzlmod:internal_deps.bzl", "internal_deps")
use_repo(
Expand Down
2 changes: 1 addition & 1 deletion examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local_path_override(
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")

# (py_proto_library specific) Add the protobuf library for well-known types (e.g. `Any`, `Timestamp`, etc)
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")

# We next initialize the python toolchain using the extension.
# You can set different Python versions in this block.
Expand Down
7 changes: 3 additions & 4 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ def rules_python_internal_deps():

http_archive(
name = "com_google_protobuf",
sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
strip_prefix = "protobuf-21.7",
sha256 = "616bb3536ac1fff3fb1a141450fa28b875e985712170ea7f1bfe5e5fc41e2cd8",
strip_prefix = "protobuf-24.4",
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
"/~https://github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz",
"/~https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protobuf-24.4.tar.gz",
],
)

Expand Down

0 comments on commit e682cd0

Please sign in to comment.