-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Can't build a project that depends on gocloud.dev v0.24.0 and some other packages #2981
Comments
@robfig , @jayconrod, BTW, I also tried it with the latest Gazelle (v0.24.0). |
Avoiding Conflicts has some info on resolving conflicts like this. If you want to use pre-generated .pb.go files and not generate them at build time, use |
Hello @jayconrod , thank you for your quick reply! Regarding using disable_global, please note that I stated it in number (2) of "Additional information" above:
I actually also tried adding BTW, I can manually change the Am I missing something? Thank you again. |
Do you mean If you want to use |
I mean both the go_proto_library, and the go_library embedding it, just as you noted that. My use case is somewhat simple: I have Go code, and a bunch I've updated the example https://github.com/mishas/bazel-cross-compile-rebuild/tree/example/gocloud.dev_v0.24.0 to make it closer to my actual code:
As you can see here: https://github.com/mishas/bazel-cross-compile-rebuild/runs/3864702501?check_suite_focus=true, the build still fails with:
I understand that it's difficult for Gazelle to generate correct builds for every different customized way of organizing .proto files, but I feel like the example above is pretty "standard". Another thing that I don't understand is - why did it work with gocloud.dev v0.23.0, but doesn't work with v0.24.0? What have changed? I looked at the diff of the Bottom line is:
Also, is it possible that solving #1986 will make this better? if yes, maybe it makes sense to prioritize it? |
You could use a set of I'm supportive of having things work out of the box, but gocloud.dev does have a ton of dependencies, so it's not surprising that it pulls in something that doesn't "just work". We don't have much development bandwidth, but in the ideal scenario there could be a set of overrides or patches for popular libraries that allow the community to share the tweaks to make them "just work" with gazelle. They would need some way to target specific versions of the dependency though. It does seem like this particular error would be resolved by solving #1986. Maybe that would do the trick. Nice find. |
@robfig, I tried the
Am I missing something? Regarding #1986 , is there any progress there? I know @jayconrod said "I'd rather not take PRs from anyone else", but - can I help with it in any way? (Not sure I have the skill though...) Thank you again for all the help! |
No, that's what I would have tried. I don't personally use |
I just experienced a similar problem. We do not use I ran into the error mentioned by this issue as well as:
After reading this issue, I tried to downgrade to |
Thanks for sharing, it indeed might help us zero-in on what actually needs fixing. Regarding your problem with I used to have the same problem before, but as long as I make sure that the version in (make sure that you have v0.58.0 in your |
I ran into this problem again recently, using the latest version of Gazelle, rules_go, etc, and the only solution that worked for me was to downgrade As that version is getting increasingly old, I imagine it will eventually cause compatibility problems, are there any other workarounds that have worked for folks? |
In case this helps shed some light on it we were having a similar issue on old rules_go and bazel. That error led me to this bazel-contrib/bazel-gazelle#1153 which I commented on. Following a Slack thread, it seemed the only way to resolve was to update rules_go (and most everything else along with it bazel, gazelle, etc...). However, after getting everything working and turning back to trying to upgrade gocloud.dev from 0.23 to 0.24 I'm getting one of the errors above reported by tux21b.
bazel - 5.0.0 |
What can we do to get eyes on this issue? I was the original reporter of bazel-contrib/bazel-gazelle#1153. I'm at the point where I am considering abandoning bazel. We rely heavily on google apis to connect to gcp and I can't keep backing my versions down because of my build system. |
Ran into this issue too and downgrading google storage to v1.15.0 really does the magic... ❤️ |
@pwaterz, have you considered filing a bug with https://github.com/googleapis/google-cloud-go ? |
Looks like googleapis/google-cloud-go#6266 fixed the issue for google storage, verified that the issue is present before this PR and vanishes after this PR. This fix is not released yet, but 1.24 release is being prepared from what I see: googleapis/google-cloud-go#6336. You can try the pre 1.24 release to see whether it works:
|
Can anyone shed light on what the actual issue is? googleapis/google-cloud-go#6266 appears to move a dependency to an internal folder. Why does that fix this? Asking because I am now running into a similar problem with a unrelated library now. |
We had the same issue at one point. The issue is basically version drift between the When something like this comes up, Gazelle can be taught to always resolve to
|
Thank you! I was able to resolve an issue with another repo using this method. |
Does anyone else find this error message could be more explicit about the suggested corrections and diagnostic commands?
|
What version of rules_go are you using?
Tried with both v0.28.0 and v0.29.0
What version of gazelle are you using?
Tried with both v0.23.0 and Master
What version of Bazel are you using?
v4.2.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Tried both Mac and Linux (amd64 on both)
Any other potentially useful information about your toolchain?
Nothing special.
What did you do?
gocloud.dev v0.24.0
andfirebase.google.com/go/v4 v4.6.0
(it happens withgocloud.dev v0.24.0
and other packages as well. firebase is just a simple example).go mod tidy
and thenbazel run //:gazelle -- update-repos -to_macro=repositories.bzl%go_repositories -from_file=./go.mod
(I also tried running with-build_file_proto_mode=disable
, same problem)(Example can be found here: https://github.com/mishas/bazel-cross-compile-rebuild/tree/example/gocloud.dev_v0.24.0)
(Run output can be found here: https://github.com/mishas/bazel-cross-compile-rebuild/runs/3830586153?check_suite_focus=true)
What did you expect to see?
Successful build
What did you see instead?
Additional information
gocloud.dev v0.23.0
, but I believe it's because v0.24.0 added a bunch of new dependencies...build_file_proto_mode = "disable_global"
to a bunch ofgo_repository
targets, and made it work (specifically tocom_github_googleapis_gax_go_v2
,com_google_cloud_go
,com_google_cloud_go_firestore
,com_google_cloud_go_storage
,org_golang_google_grpc
). But in my real code it wasn't enough: I have .proto files that hasimport "google/rpc/status.proto"
, which still created the problem :(.The text was updated successfully, but these errors were encountered: