bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.36k stars 638 forks source link

Error when nogo vet = True and deps = TOOLS_NOGO #3737

Closed joe-dipilato closed 4 days ago

joe-dipilato commented 9 months ago

https://github.com/bazelbuild/rules_go/blob/37ae8b3afc0a1d7e4a14c6b5df34f260931ec0fa/go/private/rules/nogo.bzl#L142

load("@io_bazel_rules_go//go:def.bzl", "TOOLS_NOGO", "nogo")
nogo(
    name = "nogo",
    vet = True,
    config = "nogo.json",
    visibility = ["//visibility:public"],
    deps = TOOLS_NOGO,
)
ERROR: Label '@org_golang_x_tools//go/analysis/passes/buildtag:go_default_library' is duplicated in the 'deps' attribute of rule 'nogo_actual'
ERROR: Label '@org_golang_x_tools//go/analysis/passes/atomic:go_default_library' is duplicated in the 'deps' attribute of rule 'nogo_actual'
ERROR: Label '@org_golang_x_tools//go/analysis/passes/printf:go_default_library' is duplicated in the 'deps' attribute of rule 'nogo_actual'
ERROR: Label '@org_golang_x_tools//go/analysis/passes/bools:go_default_library' is duplicated in the 'deps' attribute of rule 'nogo_actual'
ERROR: Label '@org_golang_x_tools//go/analysis/passes/nilfunc:go_default_library' is duplicated in the 'deps' attribute of rule 'nogo_actual'
phst commented 7 months ago

Right now TOOLS_NOGO is a proper superset of the checks run by vet = True, so it's safe to remove the vet attribute for now. But probably the nogo wrapper should just filter out duplicate deps.

albertocavalcante commented 4 days ago

Duplicate of https://github.com/bazelbuild/rules_go/issues/3592 ?

joe-dipilato commented 4 days ago

Yep