Skip to content

Commit 8d7645e

Browse files
authored
fix: add missing @bazel_tools files to bzl_library dependencies. (#1457)
This allows depending on just e.g. `//python:defs_bzl` without having to also depend on our internal //docs targets or manually including the extra bazel_tools files. The missing files were hidden by the doc tests because those tests manually include the extra files. Under the hood, it goes: * defs.bzl -> * py_runtime_pair.bzl -> * @bazel_tools//tools/python:toolchain.bzl -> * @bazel_tools//tools/python:private/defs.bzl -> (Note the relationshps within @bazel_tools are Bazel-version specific) Unfortunately, there isn't a public target for just the subset of files we need from @bazel_tools, so we have to use the larger glob of all of `@bazel_tools//tools`.
1 parent 961e233 commit 8d7645e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/private/BUILD.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ bzl_library(
157157
bzl_library(
158158
name = "bazel_tools_bzl",
159159
srcs = [
160-
"@bazel_tools//tools/python:srcs_version.bzl",
161-
"@bazel_tools//tools/python:toolchain.bzl",
162-
"@bazel_tools//tools/python:utils.bzl",
160+
# This set of sources is overly broad, but it's the only public
161+
# target available across Bazel versions that has all the necessary
162+
# sources.
163+
"@bazel_tools//tools:bzl_srcs",
163164
],
164165
visibility = ["//python:__pkg__"],
165166
)

0 commit comments

Comments
 (0)