Skip to content

Commit

Permalink
Fix support for --incompatible_disallow_empty_glob (#331)
Browse files Browse the repository at this point in the history
This allows downstream repos to set this flag
  • Loading branch information
keith authored Jun 24, 2024
1 parent d8474a1 commit 1d685a9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions tests/.bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
common --incompatible_disallow_empty_glob
build --features=layering_check
2 changes: 1 addition & 1 deletion tests/openssl/openssl.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ cc_library(
"crypto/**/*.h",
"crypto/include/*.h",
"include/internal/*.h",
]),
], allow_empty = True),
hdrs = HDRS + [
# These are not independent compile units, but are included in other .c files.
"crypto/LPdir_unix.c",
Expand Down
26 changes: 18 additions & 8 deletions toolchain/BUILD.llvm_repo
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
package(default_visibility = ["//visibility:public"])

# Some targets may need to directly depend on these files.
exports_files(glob([
"bin/*",
"lib/*",
"include/*",
]))
exports_files(glob(
[
"bin/*",
"lib/*",
"include/*",
],
allow_empty = True,
))

## LLVM toolchain files

Expand All @@ -34,7 +37,10 @@ filegroup(

filegroup(
name = "ld",
srcs = glob(["bin/ld.lld", "bin/ld64.lld"]),
srcs = [
"bin/ld.lld",
"bin/ld64.lld",
],
)

filegroup(
Expand All @@ -46,8 +52,11 @@ filegroup(
)

filegroup(
name = "all_includes",
srcs = glob(["include/**"]),
name = "all_includes",
srcs = glob(
["include/**"],
allow_empty = True,
),
)

filegroup(
Expand All @@ -65,6 +74,7 @@ filegroup(
# clang_rt.*.o supply crtbegin and crtend sections.
"lib/**/clang_rt.*.o",
],
allow_empty = True,
exclude = [
"lib/libLLVM*.a",
"lib/libclang*.a",
Expand Down

0 comments on commit 1d685a9

Please sign in to comment.