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

build_external=vendored does not generated BUILD files for vendor directories #1610

Closed
hugelgupf opened this issue Aug 17, 2023 · 3 comments
Closed

Comments

@hugelgupf
Copy link

What version of gazelle are you using?

Just updated to 0.30.0

What version of rules_go are you using?

Just updated to 0.40.1

What version of Bazel are you using?

6.3.2

Does this issue reproduce with the latest releases of all the above?

yes

What operating system and processor architecture are you using?

linux / amd64

What did you do?

go_repository(                                                                                                                                                       
     name = "com_github_u_root_u_root",                                                                                                                               
     importpath = "github.com/u-root/u-root",                                                                                                                          
     sum = "h1:6gCZLOeRyevw7gbTwMj3fKxnr9+yHFlgF3N7udUVNO8=",                                                                                                         
     version = "v0.11.0",                                                                                                                                             
     build_external = "vendored",                                                                                                                                     
     build_file_generation = "on",                                                                                                                                    
)

and

go_binary(
  name = "truncate",
  srcs = ["@com_github_u_root_u_root//cmds/core/truncate"],
)
bazel build :truncate

produces:

ERROR: /usr/local/google/home/chrisko/.cache/bazel/_bazel_chrisko/9c6102c63dcce3ba37133cceee0f9e68/external/com_github_u_root_u_root/cmds/core/truncate/BUILD.bazel:3:11: no such package '@com_github_u_root_u_root//vendor/github.com/rck/unit': BUILD file not found in directory 'vendor/github.com/rck/unit' of external repository @com_github_u_root_u_root. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_github_u_root_u_root//cmds/core/truncate:truncate_lib'

instead of a working Go binary.

This used to work -- with rules_go @ 0.31.0, gazelle @ 0.24.0, Go @ 1.17. No need to even specify build_external = "vendored". In some sense this is what #1585 is mentioning: They want the ability to build a Go executable from another repository, which used to just work.

Note that the reproducer does not reflect my actual use case, but is a smaller version to be more easily debuggable for folks here. The actual use case is https://github.com/u-root/gobusybox & u-root/gobusybox#95, where I'm updating from the previously mentioned old versions to these new ones.

@fmeum
Copy link
Member

fmeum commented Aug 17, 2023

Could you try this with intermediate versions to narrow down the range that contains the regression?

@hugelgupf
Copy link
Author

hugelgupf commented Aug 17, 2023 via email

@hugelgupf
Copy link
Author

It seems my actual underlying issue actually happens not with upgrading rules_go and gazelle. Having rules_go @ 40.1 and gazelle at 30 is fine when combined with Go 1.19.8, but not with Go 1.20. I'll do some more debugging and likely head on over to the rules_go repo...

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

2 participants