-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
GitHub Action Bazel caching does not seem to work rules_proto_grpc #161
Comments
I see this sometimes too and it's really difficult to track. Essentially Bazel thinks something has changed that requires rebuilding protobuf and the reasons can be many. First off, try running with The de-facto way of tracing this sort of thing is using Realistically, if it's protobuf getting spuriously rebuilt, it's probably an issue with the protobuf repo rather than here. Having a check of their issues, this one may be related: protocolbuffers/protobuf#6886. Basically, by using that Therefore, an interesting experiment to run would be to manually strip your env vars to a bare minimum before calling Bazel to build. Something like (pinched from here):
|
I've sent bazelbuild/rules_proto#206 to fix this finally upstream, so we don't need to compile |
Excellent, is there anything that needs changing here to support this or is it just a drop-in replacement? I ask because we have a toolchain for protoc here, for reasons that I do not remember. Presumably this can be ditched and replaced with the official toolchain now in rules_proto? |
Under bzlmod, the toolchain registration will be automatic so there's nothing to do. WORKSPACE users might have to add a line. I still have to argue with Google about why this is the right way to do it. They seem to want to go the other direction and make the protobuf repo even more load-bearing. |
Hi, I'm using the following and am still seeing recompiles, could somebody kindly clarify what the current state of this issue / solution is?
Is there something I need to do to avoid the protoc compilation every time? |
Description
Hi. When I use rules_proto_grpc with a GitHub Action cache, it looks like the protobuf library is rebuilt each time (which is most of the build). I'm not sure why. I'm guessing the protobuf compiler output directory is not cached. I'm guessing it's saved to a special directory. I tried looking through rules_proto_grpc to see if the code was doing anything special but the code base is large. One weird thing is that I did not hit this issue when building protos directly (not using rules_proto_grpc).
Q - what's the directory that the compiled files are in for rules_proto_grpc? I can try to hack around this to cache the outputs.
I'm using rules_proto_grpc-3.1.0.
Here's the cache step of my GitHub Action.
The text was updated successfully, but these errors were encountered: