Skip to content

feat: demonstrate python grpc #58

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: demonstrate python grpc #58

wants to merge 1 commit into from

Conversation

alexeagle
Copy link
Member

Ported from https://github.com/chrisirhc/precompiled-grpc-in-bazel-python

FYI @chrisirhc - I haven't gotten it working here since it overrides the protoc toolchain for all languages, breaking the non-python ones.

@amol-mandhane
Copy link

I've managed to get this working in a different way. It requires some changes to grpc's python_rules which I have forked and modified here, and needs a release of grpc python plugin which I've put in the same repo.

@alexeagle
Copy link
Member Author

@amol-mandhane that's neat.

I'm not keen on signing up for long-term maintainence of a fork of something so complex though. We could propose this to the grpc team, I doubt they'll accept PRs but it would be great if they did.

My philosophy here is basically "why does Bazel have to be weird". proto/gRPC can work with other build tools, without the protobuf or gRPC teams owning special plugins. So I'd like to make design decisions that are motivated exclusively by "how does this work in the mainstream use case".

@amol-mandhane
Copy link

amol-mandhane commented Apr 4, 2025

As far as the bazel part goes, I reckon I can get it upstream in grpc since the patch is relatively small. However, it needs prebuilt plugins, which are not released by grpc properly, and I don't think that will change.

Using protoc from grpcio-tools package as shown in the example repo above is a bit too breaking for non-Python things.

How do you feel about users building and caching grpc plugins on their own? It's not a particularly great option, but I don't see anything better.

@chrisirhc
Copy link

chrisirhc commented Apr 15, 2025

FYI @chrisirhc - I haven't gotten it working here since it overrides the protoc toolchain for all languages, breaking the non-python ones.

In my testing (#60), it was able to run the protoc compiler from Python (grpcio_tools) and still pass. But I understand that it is indeed overriding the protoc for these other languages which is not desirable.

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