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.
bazelbuild/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
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.

None yet

3 participants