From d16fc424cfcfdbd8893a267e500ec5d04ec0bbf0 Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Mon, 23 Sep 2024 02:27:05 -0400 Subject: [PATCH] Add gazelle overrides to enable building rclone (#1933) I was just toying around with Gazelle and the rclone project (see https://github.com/rclone/rclone/issues/8093). These changes were necessary, but not sufficient, to build `//:rclone` with Gazelle-generated BUILD files. I also needed to make a change for hdfs in my MODULE.bazel, but someone already beat me to it in https://github.com/bazelbuild/bazel-gazelle/pull/1867. I solved my problem with `gazelle:proto legacy`, but it looks like the existing override does something different. **What type of PR is this?** > Uncomment one line below and remove others. > > Bug fix > Feature > Documentation Other **What package or component does this PR mostly affect?** > For example: > > language/go > cmd/gazelle > go_repository > all bzlmod **What does this PR do? Why is it needed?** Adds default overrides for some Go dependencies of the rclone project. **Which issues(s) does this PR fix?** Fixes # **Other notes for review** --- internal/bzlmod/default_gazelle_overrides.bzl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/bzlmod/default_gazelle_overrides.bzl b/internal/bzlmod/default_gazelle_overrides.bzl index b6cc0d70e..2283f5d33 100644 --- a/internal/bzlmod/default_gazelle_overrides.bzl +++ b/internal/bzlmod/default_gazelle_overrides.bzl @@ -102,10 +102,23 @@ DEFAULT_DIRECTIVES_BY_PATH = { "gazelle:go_generate_proto false", "gazelle:proto_import_prefix k8s.io/apimachinery", ], + "storj.io/common": [ + "gazelle:proto legacy", + ], + "storj.io/eventkit": [ + "gazelle:proto legacy", + ], + "storj.io/picobuf": [ + "gazelle:proto legacy", + ], } DEFAULT_BUILD_EXTRA_ARGS_BY_PATH = { "github.com/census-instrumentation/opencensus-proto": [ "-exclude=src", ], + "github.com/cronokirby/saferith": [ + # This test file declares `package big` rather than `package saferith`. + "-exclude=arith_s390x_test.go", + ], }