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

bazel issue #99

Closed
loeffel-io opened this issue Apr 11, 2023 · 5 comments
Closed

bazel issue #99

loeffel-io opened this issue Apr 11, 2023 · 5 comments

Comments

@loeffel-io
Copy link

ERROR: /private/var/tmp/_bazel_loeffel/4a10d11c1eb568e40670f7e7808d4db4/external/org_golang_google_api/internal/BUILD.bazel:3:11: no such target '@com_github_google_s2a_go//:s2a-go': target 's2a-go' not declared in package '' defined by /private/var/tmp/_bazel_loeffel/4a10d11c1eb568e40670f7e7808d4db4/external/com_github_google_s2a_go/BUILD (did you mean 's2a.go'? Tip: use `query "@com_github_google_s2a_go//:*"` to see all the targets in that package) and referenced by '@org_golang_google_api//internal:internal'
ERROR: /private/var/tmp/_bazel_loeffel/4a10d11c1eb568e40670f7e7808d4db4/external/org_golang_google_api/internal/BUILD.bazel:3:11: no such target '@com_github_google_s2a_go//fallback:fallback': target 'fallback' not declared in package 'fallback' defined by /private/var/tmp/_bazel_loeffel/4a10d11c1eb568e40670f7e7808d4db4/external/com_github_google_s2a_go/fallback/BUILD (Tip: use `query "@com_github_google_s2a_go//fallback:*"` to see all the targets in that package) and referenced by '@org_golang_google_api//internal:internal'
@xmenxk
Copy link
Collaborator

xmenxk commented Apr 13, 2023

Thanks for reporting!
I'll update google-api-go-client to use the new release, which should fix the target naming issue.

@ankurcha
Copy link

ankurcha commented Apr 14, 2023

Reporting something that may be related:

Attempting to upgrade library: https://github.com/googleapis/google-api-go-client/releases/tag/v0.118.0 in a bazel-go project with gazelle causes this error

ERROR: /home/project_name/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/BUILD:23:11: no such package 'internal/v2/tlsconfigstore/example_cert_key': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /home/project_name/internal/v2/tlsconfigstore/example_cert_key and referenced by '//vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore:tlsconfigstore'
ERROR: Analysis of target '//apps/cell_manager/cmd:cmd' failed; build aborted: no such package 'internal/v2/tlsconfigstore/example_cert_key': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /home/project_name/internal/v2/tlsconfigstore/example_cert_key
INFO: Elapsed time: 0.355s
I

@xmenxk
Copy link
Collaborator

xmenxk commented Apr 15, 2023

gazelle doesn't work well with pre-existing BUILD files, especially in vendor mode.
You can delete existing BUILD files, and let gazelle regenerate them, or add a directive # gazelle:build_file_name BUILD.bazel to your project, which will tell gazelle to ignore existing BUILD files and generate BUILD.bazel files and use those instead.

@loeffel-io
Copy link
Author

v0.1.1 is working for me btw ❤️

@xmenxk
Copy link
Collaborator

xmenxk commented Apr 19, 2023

@ankurcha created a new release v0.1.2, which should work with bazel/gazelle now

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

No branches or pull requests

3 participants