Skip to content

Commit

Permalink
Fix Bazel buildtools dependency (#4980)
Browse files Browse the repository at this point in the history
* Fix Bazel module dependencies

* Import bazelbuild manually instead of through Gazelle
  • Loading branch information
AlejoAsd authored Nov 22, 2024
1 parent 5076a6b commit e800153
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ use_repo(
"org_golang_x_oauth2",
"org_golang_x_text",
)

non_module_deps = use_extension(":non_module_deps.bzl", "non_module_deps")
use_repo(
non_module_deps,
"com_github_bazelbuild_buildtools",
"org_golang_x_tools",
)
48 changes: 48 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions non_module_deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Module extension for non-module dependencies."""

load("@bazel_gazelle//:deps.bzl", "go_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def _non_module_deps_impl(
# buildifier: disable=unused-variable
mctx):
# TODO(bazelbuild/buildtools#1204): Remove when available as module.
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=",
version = "v0.21.1-0.20240508182429-e35e4ccd0d2d",
)
http_archive(
name = "com_github_bazelbuild_buildtools",
sha256 = "42968f9134ba2c75c03bb271bd7bb062afb7da449f9b913c96e5be4ce890030a",
strip_prefix = "buildtools-6.3.3",
urls = ["https://github.com/bazelbuild/buildtools/archive/v6.3.3.tar.gz"],
)

non_module_deps = module_extension(
implementation = _non_module_deps_impl,
)

0 comments on commit e800153

Please sign in to comment.