-
-
Notifications
You must be signed in to change notification settings - Fork 656
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/go_repository build_file_generation=on should ignore existing BUILD files #865
Comments
This is kind of an unfortunate situation. Bazel doesn't do well when you have a dependency with preexisting but incompatible build files. When build file generation is turned on in Vendoring is a good option for this case, since it requires local modifications to the repository. Another option is to set The root cause of this issue seems to be dependency on the |
I tagged a new release on Monday. Kubernetes is working on updating to a newer Bazel and a newer rules_go. I'll have another update next week. |
👋 I'm hitting this error, but I haven't found a clear way to solve it. I'm using Bazel 0.10.0 and current master for
Ideas? |
Sorry for not coming back to this sooner. We've had a lot going on. @justinsb Did you find an adequate workaround? I can fix this on the Gazelle / I'd like to understand the problem in apimachinery though. Is there a simple way to reproduce this? Ideally the problem would be fixed there by adding a set of correctly versioned dependencies instead of blowing away build files. |
I can repro this with
and then depending on You'll get an error like:
|
Ah, maybe this is an unrelated bug. I will take it to a new issue. |
Closing this old issue. I think this was ultimately resolved in kubernetes/publishing-bot#49. |
@jayconrod I've stumbled upon this problem in 2021 when trying to import one of k8s kops packages that pulls "k8s.io/kops/upup/models". The latter has a genrule defined in the build file: genrule(
name = "bindata",
srcs = glob(
[
"cloudup/**",
"nodeup/**",
],
),
outs = ["bindata.go"],
cmd = """
$(location //vendor/github.com/go-bindata/go-bindata/v3/go-bindata:go-bindata) \
-o "$(OUTS)" -pkg models \
-nometadata \
-nocompress \
-prefix $$(pwd) \
-prefix upup/models $(SRCS)
""",
tools = [
"//vendor/github.com/go-bindata/go-bindata/v3/go-bindata",
],
) While it's not needed for building the package, it makes analysis fail with:
The full repro is here: https://github.com/be9/kopsexample/ |
@be9 It looks like you're downloading that project with |
I have a dependency on kubernetes apimachinery https://github.com/kubernetes/apimachinery and it has a bazel build which is invalid for that repo in isolation - it requires me to add the dependency
'@io_kubernetes_build//defs:go.bzl'
and then fails because of version skew:So I try adding
build_file_generation="on"
to the import, but ... it still does the same thing - still requires theio_kubernetes_build
dependency, and still gives the GoSource error after I do.I believe this means it is still consider the existing BUILD files, but I would have expected
build_file_generation=on
to ignore them.The good news is that I did get this working by vendoring the files and stripping the
BUILD
files, but it would be nice to be able to usego_repository
so I don't have to "manually" vendor.The text was updated successfully, but these errors were encountered: