Skip to content

Commit 2dca754

Browse files
committed
allow empty headers/libs
1 parent a0c5739 commit 2dca754

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

python/private/local_runtime_repo_setup.bzl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,26 @@ def define_local_runtime_toolchain_impl(
6161
cc_library(
6262
name = "_python_headers",
6363
# NOTE: Keep in sync with watch_tree() called in local_runtime_repo
64-
srcs = native.glob(["include/**/*.h"]),
64+
srcs = native.glob(
65+
["include/**/*.h"],
66+
# A Python install may not have C headers
67+
allow_empty = True,
68+
),
6569
includes = ["include"],
6670
)
6771

6872
cc_library(
6973
name = "_libpython",
7074
# Don't use a recursive glob because the lib/ directory usually contains
7175
# a subdirectory of the stdlib -- lots of unrelated files
72-
srcs = native.glob([
73-
"lib/*{}".format(lib_ext), # Match libpython*.so
74-
"lib/*{}*".format(lib_ext), # Also match libpython*.so.1.0
75-
]),
76+
srcs = native.glob(
77+
[
78+
"lib/*{}".format(lib_ext), # Match libpython*.so
79+
"lib/*{}*".format(lib_ext), # Also match libpython*.so.1.0
80+
],
81+
# A Python install may not have shared libraries.
82+
allow_empty = True,
83+
),
7684
hdrs = [":_python_headers"],
7785
)
7886

0 commit comments

Comments
 (0)