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

go_repository: debug mode #1205

Merged
merged 1 commit into from
Mar 18, 2022
Merged

go_repository: debug mode #1205

merged 1 commit into from
Mar 18, 2022

Conversation

blico
Copy link
Contributor

@blico blico commented Mar 18, 2022

By design, go_repository rules download and run Gazelle on the entire external repo, even if the main repo only depends on a small portion of that repo. Meaning if Gazelle encounters issues on an unused portion of the repo, it will spam a benign warning whenever the corresponding go_repository rule is invoked.

For example:

$ bazel fetch @com_github_census_instrumentation_opencensus_proto//...
DEBUG: /Users/blico/sources/bazel-gazelle/internal/go_repository.bzl:263:18: com_github_census_instrumentation_opencensus_proto: gazelle: rule //gen-go/agent/metrics/v1:metrics imports "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1" which matches multiple rules: //gen-go/agent/common/v1:common and //src/opencensus/proto/agent/common/v1:common. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/agent/metrics/v1:metrics imports "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1" which matches multiple rules: //gen-go/metrics/v1:metrics and //src/opencensus/proto/metrics/v1:metrics. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/agent/metrics/v1:metrics imports "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" which matches multiple rules: //gen-go/resource/v1:resource and //src/opencensus/proto/resource/v1:resource. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/agent/trace/v1:trace imports "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1" which matches multiple rules: //gen-go/agent/common/v1:common and //src/opencensus/proto/agent/common/v1:common. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/agent/trace/v1:trace imports "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" which matches multiple rules: //gen-go/resource/v1:resource and //src/opencensus/proto/resource/v1:resource. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/agent/trace/v1:trace imports "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1" which matches multiple rules: //gen-go/trace/v1:trace and //src/opencensus/proto/trace/v1:trace. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/metrics/v1:metrics imports "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" which matches multiple rules: //gen-go/resource/v1:resource and //src/opencensus/proto/resource/v1:resource. # gazelle:resolve may be used to disambiguate
gazelle: rule //gen-go/trace/v1:trace imports "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" which matches multiple rules: //gen-go/resource/v1:resource and //src/opencensus/proto/resource/v1:resource. # gazelle:resolve may be used to disambiguate

We should suppress this log by default, given that it is only ever helpful when debugging a go_repository rule.

Relevant issues: #947, #859, #576, #1172, #1204

@blico blico requested a review from linzhp March 18, 2022 00:11
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

Successfully merging this pull request may close these issues.

2 participants