From 472f7ed425bc3a71d999a2f6b2890979e61c38d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Desgroppes?= Date: Tue, 24 Mar 2026 10:56:53 +0100 Subject: [PATCH] Remove `gazelle:exclude`s awaiting Bazel 9 Now lifted by #48455. --- .gitlab/build/bazel/lint.yml | 2 +- BUILD.bazel | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.gitlab/build/bazel/lint.yml b/.gitlab/build/bazel/lint.yml index 020de817d2f571..c06529876b7b37 100644 --- a/.gitlab/build/bazel/lint.yml +++ b/.gitlab/build/bazel/lint.yml @@ -43,7 +43,7 @@ bazel:run-buildifier-test: bazel:run-gazelle: extends: [ .bazel:lint, .bazel:runner:linux-amd64 ] script: - - bazel run //:gazelle -- -mode=diff -strict + - bazel run //:gazelle -- -mode=diff variables: FIX_COMMAND: "bazel run //:gazelle" diff --git a/BUILD.bazel b/BUILD.bazel index a6dbedb8936e46..1cf1c4106af35e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -489,11 +489,6 @@ ALL_BUILD_TAGS = [ # gazelle:exclude pkg/util/workqueue # gazelle:exclude pkg/util/xc # gazelle:exclude pkg/windowsdriver -# TODO(agent-build): This exclusion is ready for removal, blocked by issues caused by the interaction of -# Bazel with directories named `build` created by the CMake builds. We can remove this once we remove CMake -# support or we upgrade to a Bazel version containing a fix: https://github.com/bazelbuild/bazel/pull/26842 -# In the meantime, temporarily remove this exclusion locally if regeneration of BUILD files is required -# gazelle:exclude rtloader # gazelle:exclude tasks # gazelle:exclude test # gazelle:exclude tools/NamedPipeCmd @@ -505,16 +500,16 @@ ALL_BUILD_TAGS = [ # gazelle:exclude tools/host-profiler # gazelle:exclude tools/retry_file_dump # gazelle:exclude tools/windows -# gazelle:exclude .gitlab -# gazelle:prefix github.com/DataDog/datadog-agent gazelle( name = "gazelle", - args = [ + build_tags = ALL_BUILD_TAGS, + external = "static", # don't use the network: https://github.com/bazel-contrib/bazel-gazelle/issues/1385 + extra_args = [ "-build_file_name=BUILD.bazel", # avoid BUILD/build mess: https://github.com/docker/desktop-feedback/issues/251 - "-external=static", # don't use the network: https://github.com/bazel-contrib/bazel-gazelle/issues/1385 + "-strict", # don't swallow syntax errors or unknown directives ], - build_tags = ALL_BUILD_TAGS, gazelle = ":gazelle_binary", + prefix = "github.com/DataDog/datadog-agent", ) gazelle_binary(