-
Notifications
You must be signed in to change notification settings - Fork 387
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
rules_cc & rules_java pulled in by github.com/envoyproxy/protoc-gen-validate/validate
BUILD file cause build to fail
#1980
Comments
For vendored go dependencies this can be address by tricks like #1982 (comment) to force gazelle to regenerate all build files, but for non-vendored mode, I think we need an option for gazelle to always regenerate build files for the go dependencies (e.g. ignore existing build files and treat all go dependencies as they don't have existing build files). |
This exists as |
Verified that setting |
@fishy Can you provide the relevant gazelle override/gazelle default overrides which worked for you? Getting the same error and something like this does not work for me.
It only works when the gazelle_default_attributes is set to |
@bennettzhu1 something like this in go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
go_deps.gazelle_default_attributes(
build_file_generation = "clean",
)
use_repo(
go_deps,
...,
) see https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md#gazelle-directives |
What version of gazelle are you using?
0.40.0
What version of rules_go are you using?
0.50.1
What version of Bazel are you using?
7.4.1
Does this issue reproduce with the latest releases of all the above?
Those are latest releases
What operating system and processor architecture are you using?
linux/amd64
What did you do?
When
github.com/envoyproxy/protoc-gen-validate/validate
is imported by some go code, itsBUILD
file references torules_cc
andrules_java
, which would cause build to fail if I disablegazelle:proto
, even if I added them toMODULES.bazel
. here is a minimal reproducer:We only need to go lib there, I was hoping there's a way to ignore
rules_cc
andrules_java
that's not really used by thego_library
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: