-
Notifications
You must be signed in to change notification settings - Fork 380
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
Gazelle fails to build with 'no such package' after some dependencies got upgraded #1289
Comments
Can you provide a sample repo that demonstrates this issue? |
Hey @achew22, Thank you for the quick reply and sorry about the delay. I've been working on creating a minimal-reproducible-project to help with the debugging. It was a little bit complicated to extract a small version of a huge project. Anyways, here's the project I created to reproduce these issues: https://github.com/flakrimjusufi/bazel-minimal-example While setting-up the project, I've encountered the following: The first issue:
Was resolved by adding this line in the WORKSPACE file:
=============================================================================== The second issue: Running the following command:
I'm getting this output:
============================================================================== Tried to bypass this one so I can reproduce the other issues that I mentioned above, but unfortunately I wasn't able to do so. Please let me know if I can help you with something else to resolve this issue. |
Any update on this? |
why was this closed? I'm hitting the same exact issue:
|
Hey @cristifalcas, If you are still experiencing this issue, I'd recommend you to update the bazel_gazelle to version NOTE: Since every project has a different file-structure, this might not fully resolve your issue. What you might still have to do is updating the goolge-related dependencies and potentially some spf13 dependencies but I can show you a list of the dependencies that I've updated and their current version that resolved the issues I was having:
I hope to have helped you a bit. |
What version of gazelle are you using?
v0.25
What version of rules_go are you using?
v0.33.0
What version of Bazel are you using?
v.5.1.1
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
Linux Ubuntu 20.04.4 LTS - amd x86_64
What did you do?
Google related dependencies got upgraded in go.mod file:
What did you expect to see?
A successful build.
What did you see instead?
ERROR:: /home/flakrim/.cache/bazel/_bazel_flakrim/4e21cc02f33d087c8327a1f6e4bda3af/external/com_google_cloud_go_pubsub/BUILD.bazel:3:11: no such package '@com_google_cloud_go//internal/pubsub': BUILD file not found in directory 'internal/pubsub' of external repository @com_google_cloud_go. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_google_cloud_go_pubsub//:pubsub'
Things I've tried so far
Researching the problem and going through open-issues from engineers that are experiencing the same issue in desperate to find a solution, I've tried the following:
All of this in hope to resolve the problem, but I'm still seeing the same output.
What's the command that is causing this failure?
Does the build succeeds with the run commands?
Yes. I'm able to build successfully the dependencies with the following commands:
bazelisk run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //:gazelle
bazelisk run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //:gazelle -- update;
bazelisk run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //:gazelle -- update-repos -from_file=go.mod;
NOTE
I'd also like to emphasize that I've tried everything that was available in the open-issues to get through this issue but after so many wasted hours, I thought this needs to be reported.
Possible related issues:
golang/x/net
version #1021internal
package import in third party dependency #1117ASSUMPTION
I may be completely wrong in here, but I think this is happening because gazelle, rules or bazelisk is still using an old version of those google related dependencies and when one of these dependencies gets upgraded, this causes the build to fail.
That's because the upgrade may be silently ignored and Bazel still relies in this older version which doesn’t contain any feature that one of these upgraded dependencies is trying to use.
The text was updated successfully, but these errors were encountered: