Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: toolchainize py_proto_library #1577

Merged
merged 10 commits into from
Apr 11, 2024

Conversation

thesayyn
Copy link
Contributor

@thesayyn thesayyn commented Nov 23, 2023

Enables use of --incompatible_enable_proto_toolchain_resolution flag that launched in Bazel 7. This allows users to choose a pre-built protoc or use the runtime from https://pypi.org/project/protobuf/ rather than be forced to use hard-coded values in Bazel core.

This change is also happening in other language rulesets that provide first-class protobuf support, e.g.
bazel-contrib/rules_go#3895

No update to CHANGELOG.md in this PR as the feature is not yet documented for end-users, this just makes it possible to enable the flag. A follow-up PR will provide user instructions.

@thesayyn
Copy link
Contributor Author

Not ready yet; waiting for bazelbuild/rules_proto#194 to gate this feature.

@thesayyn
Copy link
Contributor Author

fixes #1080 consequently.

@thesayyn thesayyn marked this pull request as ready for review December 5, 2023 00:14
thesayyn and others added 6 commits March 18, 2024 17:35
Relies on bazelbuild/rules_proto#207 landing and being available in a rules_proto release.
It has a bug with bzlmod where it tries to reference the label of the users toolchain_type,
leading to an error like
com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package '@@[unknown repo 'rules_python' requested from @@rules_proto~]//python/proto': The repository '@@[unknown repo 'rules_python' requested from @@rules_proto~]' could not be resolved: No repository visible as '@rules_python' from repository '@@rules_proto~'
@thesayyn
Copy link
Contributor Author

Okay this is green now. had to rename the workspace because bazelbuild/bazel#18683 (comment)

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@alexeagle alexeagle added this pull request to the merge queue Apr 11, 2024
Merged via the queue into bazelbuild:main with commit 4be00a6 Apr 11, 2024
4 checks passed
alexeagle added a commit to alexeagle/protobuf that referenced this pull request Jun 7, 2024
This was originally landed in bazelbuild/rules_python#1577
However the fork of py_proto_library brought to the protobuf repo was from an earlier commit:
protocolbuffers@8257c44
(cl/623401031 for googlers)
Thus the fix was lost. This PR simply cherry-picks that change.
alexeagle added a commit to alexeagle/protobuf that referenced this pull request Jun 7, 2024
This was originally landed in bazelbuild/rules_python#1577
However the fork of py_proto_library brought to the protobuf repo was from an earlier commit:
protocolbuffers@8257c44
(cl/623401031 for googlers)
Thus the fix was lost. This PR simply cherry-picks that change.
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Jun 11, 2024
…7078)

This was originally landed in bazelbuild/rules_python#1577 However the fork of py_proto_library brought to the protobuf repo was from an earlier commit: 8257c44 (cl/623401031 for googlers)
Thus the fix was lost. This PR simply cherry-picks that change.

Closes #17078

COPYBARA_INTEGRATE_REVIEW=#17078 from alexeagle:py_proto_toolchain 226540e
PiperOrigin-RevId: 642123868
TinyTinni pushed a commit to TinyTinni/protobuf that referenced this pull request Jun 15, 2024
…otocolbuffers#17078)

This was originally landed in bazelbuild/rules_python#1577 However the fork of py_proto_library brought to the protobuf repo was from an earlier commit: protocolbuffers@8257c44 (cl/623401031 for googlers)
Thus the fix was lost. This PR simply cherry-picks that change.

Closes protocolbuffers#17078

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#17078 from alexeagle:py_proto_toolchain 226540e
PiperOrigin-RevId: 642123868
deannagarcia pushed a commit to deannagarcia/protobuf that referenced this pull request Jun 20, 2024
…otocolbuffers#17078)

This was originally landed in bazelbuild/rules_python#1577 However the fork of py_proto_library brought to the protobuf repo was from an earlier commit: protocolbuffers@8257c44 (cl/623401031 for googlers)
Thus the fix was lost. This PR simply cherry-picks that change.

Closes protocolbuffers#17078

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#17078 from alexeagle:py_proto_toolchain 226540e
PiperOrigin-RevId: 642123868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants