diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 2ba092701a..80e7bc5d6d 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -24,7 +24,6 @@ default_macos_targets: &default_macos_targets default_windows_targets: &default_windows_targets - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245 - "//..." - - "-//bindgen/..." - "-//test/proto/..." - "-//test/unit/pipelined_compilation/..." crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets @@ -349,9 +348,6 @@ tasks: - "-//sys/..." # See https://github.com/bazelbuild/bazel/issues/9987 - "-//ffi/rust_calling_c:matrix_dylib_test" - # The bindgen rules currently do not work on RBE - # see: https://github.com/bazelbuild/rules_rust/issues/919 - - "-//bindgen/..." shell_commands: - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel @@ -378,9 +374,6 @@ tasks: windows_targets: &windows_targets - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245 - "//..." - # The bindgen rules currently do not work on windows - # see: https://github.com/bazelbuild/rules_rust/issues/919 - - "-//bindgen/..." # The proto rules do not work on windows - "-//proto/..." # The wasm rules do not work on windows diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 6c3f8511c9..97c1167848 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -24,6 +24,10 @@ rust_bindgen_dependencies() rust_bindgen_register_toolchains() +load("@rules_rust//bindgen:transitive_repositories.bzl", "rust_bindgen_transitive_dependencies") + +rust_bindgen_transitive_dependencies() + load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies") rust_analyzer_dependencies() diff --git a/bindgen/3rdparty/BUILD.bazel b/bindgen/3rdparty/BUILD.bazel index b0fe5911c1..b133264940 100644 --- a/bindgen/3rdparty/BUILD.bazel +++ b/bindgen/3rdparty/BUILD.bazel @@ -14,20 +14,25 @@ crates_vendor( "indexmap": [crate.annotation( gen_build_script = True, )], - "libloading": [crate.annotation( - gen_build_script = True, - )], "log": [crate.annotation( rustc_flags = ["--cfg=atomic_cas"], )], + "winapi": [crate.annotation( + gen_build_script = True, + )], }, cargo_lockfile = "Cargo.Bazel.lock", generate_build_scripts = False, mode = "remote", packages = { "bindgen": crate.spec( + features = ["runtime"], version = "0.60.1", ), + "clang-sys": crate.spec( + # Should match the version of llvm-project being used. + features = ["clang_14_0"], + ), "libloading": crate.spec( version = "0.7.3", ), diff --git a/bindgen/3rdparty/Cargo.Bazel.lock b/bindgen/3rdparty/Cargo.Bazel.lock index 6deff98c59..916386b29e 100644 --- a/bindgen/3rdparty/Cargo.Bazel.lock +++ b/bindgen/3rdparty/Cargo.Bazel.lock @@ -112,6 +112,7 @@ name = "direct-cargo-bazel-deps" version = "0.0.1" dependencies = [ "bindgen", + "clang-sys", "libloading", ] diff --git a/bindgen/3rdparty/crates/BUILD.aho-corasick-0.7.20.bazel b/bindgen/3rdparty/crates/BUILD.aho-corasick-0.7.20.bazel index b2fe2d21ea..5e43e3d55d 100644 --- a/bindgen/3rdparty/crates/BUILD.aho-corasick-0.7.20.bazel +++ b/bindgen/3rdparty/crates/BUILD.aho-corasick-0.7.20.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=aho-corasick", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.atty-0.2.14.bazel b/bindgen/3rdparty/crates/BUILD.atty-0.2.14.bazel index 0beb5bac8f..604e4f6553 100644 --- a/bindgen/3rdparty/crates/BUILD.atty-0.2.14.bazel +++ b/bindgen/3rdparty/crates/BUILD.atty-0.2.14.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=atty", "manual", "noclippy", "norustfmt", @@ -47,6 +48,9 @@ rust_library( "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ "@rules_rust_bindgen__libc-0.2.139//:libc", # cfg(unix) ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@rules_rust_bindgen__libc-0.2.139//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:aarch64-linux-android": [ "@rules_rust_bindgen__libc-0.2.139//:libc", # cfg(unix) ], @@ -92,6 +96,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-apple-ios": [ "@rules_rust_bindgen__libc-0.2.139//:libc", # cfg(unix) ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@rules_rust_bindgen__libc-0.2.139//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:x86_64-linux-android": [ "@rules_rust_bindgen__libc-0.2.139//:libc", # cfg(unix) ], diff --git a/bindgen/3rdparty/crates/BUILD.autocfg-1.1.0.bazel b/bindgen/3rdparty/crates/BUILD.autocfg-1.1.0.bazel index 2077aa0917..1965b546e4 100644 --- a/bindgen/3rdparty/crates/BUILD.autocfg-1.1.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.autocfg-1.1.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=autocfg", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.bazel b/bindgen/3rdparty/crates/BUILD.bazel index a8a25b7307..d6239649a5 100644 --- a/bindgen/3rdparty/crates/BUILD.bazel +++ b/bindgen/3rdparty/crates/BUILD.bazel @@ -31,6 +31,12 @@ alias( tags = ["manual"], ) +alias( + name = "clang-sys", + actual = "@rules_rust_bindgen__clang-sys-1.4.0//:clang_sys", + tags = ["manual"], +) + alias( name = "libloading", actual = "@rules_rust_bindgen__libloading-0.7.4//:libloading", diff --git a/bindgen/3rdparty/crates/BUILD.bindgen-0.60.1.bazel b/bindgen/3rdparty/crates/BUILD.bindgen-0.60.1.bazel index a0797739f3..14131e02bc 100644 --- a/bindgen/3rdparty/crates/BUILD.bindgen-0.60.1.bazel +++ b/bindgen/3rdparty/crates/BUILD.bindgen-0.60.1.bazel @@ -47,6 +47,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=bindgen", "manual", "noclippy", "norustfmt", @@ -100,6 +101,7 @@ rust_binary( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=bindgen", "manual", "noclippy", "norustfmt", @@ -157,6 +159,7 @@ cargo_build_script( ], tags = [ "cargo-bazel", + "crate-name=bindgen", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.bitflags-1.3.2.bazel b/bindgen/3rdparty/crates/BUILD.bitflags-1.3.2.bazel index 7c73f5646e..f554e709d9 100644 --- a/bindgen/3rdparty/crates/BUILD.bitflags-1.3.2.bazel +++ b/bindgen/3rdparty/crates/BUILD.bitflags-1.3.2.bazel @@ -27,12 +27,15 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["default"], + crate_features = [ + "default", + ], crate_root = "src/lib.rs", edition = "2018", rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=bitflags", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.cexpr-0.6.0.bazel b/bindgen/3rdparty/crates/BUILD.cexpr-0.6.0.bazel index f2571b820a..5666065b73 100644 --- a/bindgen/3rdparty/crates/BUILD.cexpr-0.6.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.cexpr-0.6.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=cexpr", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.cfg-if-1.0.0.bazel b/bindgen/3rdparty/crates/BUILD.cfg-if-1.0.0.bazel index efe7f67c74..a19ddb172f 100644 --- a/bindgen/3rdparty/crates/BUILD.cfg-if-1.0.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.cfg-if-1.0.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=cfg-if", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.clang-sys-1.4.0.bazel b/bindgen/3rdparty/crates/BUILD.clang-sys-1.4.0.bazel index 4db6f980f5..ec3fac0b15 100644 --- a/bindgen/3rdparty/crates/BUILD.clang-sys-1.4.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.clang-sys-1.4.0.bazel @@ -29,6 +29,11 @@ rust_library( ], ), crate_features = [ + "clang_10_0", + "clang_11_0", + "clang_12_0", + "clang_13_0", + "clang_14_0", "clang_3_5", "clang_3_6", "clang_3_7", @@ -37,6 +42,9 @@ rust_library( "clang_4_0", "clang_5_0", "clang_6_0", + "clang_7_0", + "clang_8_0", + "clang_9_0", "libloading", "runtime", ], @@ -45,6 +53,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=clang-sys", "manual", "noclippy", "norustfmt", @@ -62,6 +71,11 @@ cargo_build_script( name = "clang-sys_build_script", srcs = glob(["**/*.rs"]), crate_features = [ + "clang_10_0", + "clang_11_0", + "clang_12_0", + "clang_13_0", + "clang_14_0", "clang_3_5", "clang_3_6", "clang_3_7", @@ -70,6 +84,9 @@ cargo_build_script( "clang_4_0", "clang_5_0", "clang_6_0", + "clang_7_0", + "clang_8_0", + "clang_9_0", "libloading", "runtime", ], @@ -92,6 +109,7 @@ cargo_build_script( ], tags = [ "cargo-bazel", + "crate-name=clang-sys", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.clap-3.2.23.bazel b/bindgen/3rdparty/crates/BUILD.clap-3.2.23.bazel index 4acc20a947..7d818f7b9f 100644 --- a/bindgen/3rdparty/crates/BUILD.clap-3.2.23.bazel +++ b/bindgen/3rdparty/crates/BUILD.clap-3.2.23.bazel @@ -41,6 +41,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=clap", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.clap_lex-0.2.4.bazel b/bindgen/3rdparty/crates/BUILD.clap_lex-0.2.4.bazel index 557a99136b..44faa10e43 100644 --- a/bindgen/3rdparty/crates/BUILD.clap_lex-0.2.4.bazel +++ b/bindgen/3rdparty/crates/BUILD.clap_lex-0.2.4.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=clap_lex", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.either-1.8.0.bazel b/bindgen/3rdparty/crates/BUILD.either-1.8.0.bazel index 0470d3b9a0..15c27c4348 100644 --- a/bindgen/3rdparty/crates/BUILD.either-1.8.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.either-1.8.0.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=either", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.env_logger-0.9.3.bazel b/bindgen/3rdparty/crates/BUILD.env_logger-0.9.3.bazel index 02db083b19..ddc9e41174 100644 --- a/bindgen/3rdparty/crates/BUILD.env_logger-0.9.3.bazel +++ b/bindgen/3rdparty/crates/BUILD.env_logger-0.9.3.bazel @@ -39,6 +39,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=env_logger", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.glob-0.3.0.bazel b/bindgen/3rdparty/crates/BUILD.glob-0.3.0.bazel index 1b412e8c87..87323a8e9a 100644 --- a/bindgen/3rdparty/crates/BUILD.glob-0.3.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.glob-0.3.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=glob", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.hashbrown-0.12.3.bazel b/bindgen/3rdparty/crates/BUILD.hashbrown-0.12.3.bazel index cf3349b6f3..eb5621a77c 100644 --- a/bindgen/3rdparty/crates/BUILD.hashbrown-0.12.3.bazel +++ b/bindgen/3rdparty/crates/BUILD.hashbrown-0.12.3.bazel @@ -27,12 +27,15 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["raw"], + crate_features = [ + "raw", + ], crate_root = "src/lib.rs", edition = "2021", rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=hashbrown", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.hermit-abi-0.1.19.bazel b/bindgen/3rdparty/crates/BUILD.hermit-abi-0.1.19.bazel index 5d80dd07df..faeb6a3962 100644 --- a/bindgen/3rdparty/crates/BUILD.hermit-abi-0.1.19.bazel +++ b/bindgen/3rdparty/crates/BUILD.hermit-abi-0.1.19.bazel @@ -27,12 +27,12 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["default"], crate_root = "src/lib.rs", edition = "2018", rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=hermit-abi", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.humantime-2.1.0.bazel b/bindgen/3rdparty/crates/BUILD.humantime-2.1.0.bazel index f688d2d99f..87b8c00d63 100644 --- a/bindgen/3rdparty/crates/BUILD.humantime-2.1.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.humantime-2.1.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=humantime", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.indexmap-1.9.2.bazel b/bindgen/3rdparty/crates/BUILD.indexmap-1.9.2.bazel index bf453869f3..38bb23b69d 100644 --- a/bindgen/3rdparty/crates/BUILD.indexmap-1.9.2.bazel +++ b/bindgen/3rdparty/crates/BUILD.indexmap-1.9.2.bazel @@ -28,12 +28,15 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["std"], + crate_features = [ + "std", + ], crate_root = "src/lib.rs", edition = "2021", rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=indexmap", "manual", "noclippy", "norustfmt", @@ -48,7 +51,9 @@ rust_library( cargo_build_script( name = "indexmap_build_script", srcs = glob(["**/*.rs"]), - crate_features = ["std"], + crate_features = [ + "std", + ], crate_name = "build_script_build", crate_root = "build.rs", data = glob( @@ -67,6 +72,7 @@ cargo_build_script( ], tags = [ "cargo-bazel", + "crate-name=indexmap", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.lazy_static-1.4.0.bazel b/bindgen/3rdparty/crates/BUILD.lazy_static-1.4.0.bazel index 641205a4c7..168e211423 100644 --- a/bindgen/3rdparty/crates/BUILD.lazy_static-1.4.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.lazy_static-1.4.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=lazy_static", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.lazycell-1.3.0.bazel b/bindgen/3rdparty/crates/BUILD.lazycell-1.3.0.bazel index abd3e84a76..b609a9b5dc 100644 --- a/bindgen/3rdparty/crates/BUILD.lazycell-1.3.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.lazycell-1.3.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=lazycell", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.libc-0.2.139.bazel b/bindgen/3rdparty/crates/BUILD.libc-0.2.139.bazel index 3cc0d01948..c71b3ff401 100644 --- a/bindgen/3rdparty/crates/BUILD.libc-0.2.139.bazel +++ b/bindgen/3rdparty/crates/BUILD.libc-0.2.139.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=libc", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.libloading-0.7.4.bazel b/bindgen/3rdparty/crates/BUILD.libloading-0.7.4.bazel index 1e726837c1..df794b5353 100644 --- a/bindgen/3rdparty/crates/BUILD.libloading-0.7.4.bazel +++ b/bindgen/3rdparty/crates/BUILD.libloading-0.7.4.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=libloading", "manual", "noclippy", "norustfmt", @@ -47,6 +48,9 @@ rust_library( "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ "@rules_rust_bindgen__cfg-if-1.0.0//:cfg_if", # cfg(unix) ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@rules_rust_bindgen__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], "@rules_rust//rust/platform:aarch64-linux-android": [ "@rules_rust_bindgen__cfg-if-1.0.0//:cfg_if", # cfg(unix) ], @@ -92,6 +96,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-apple-ios": [ "@rules_rust_bindgen__cfg-if-1.0.0//:cfg_if", # cfg(unix) ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@rules_rust_bindgen__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], "@rules_rust//rust/platform:x86_64-linux-android": [ "@rules_rust_bindgen__cfg-if-1.0.0//:cfg_if", # cfg(unix) ], diff --git a/bindgen/3rdparty/crates/BUILD.log-0.4.17.bazel b/bindgen/3rdparty/crates/BUILD.log-0.4.17.bazel index 62a4e0342c..f977d12263 100644 --- a/bindgen/3rdparty/crates/BUILD.log-0.4.17.bazel +++ b/bindgen/3rdparty/crates/BUILD.log-0.4.17.bazel @@ -27,7 +27,9 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["std"], + crate_features = [ + "std", + ], crate_root = "src/lib.rs", edition = "2015", rustc_flags = [ @@ -36,6 +38,7 @@ rust_library( ], tags = [ "cargo-bazel", + "crate-name=log", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.memchr-2.5.0.bazel b/bindgen/3rdparty/crates/BUILD.memchr-2.5.0.bazel index b3f9262837..de0afb2672 100644 --- a/bindgen/3rdparty/crates/BUILD.memchr-2.5.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.memchr-2.5.0.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=memchr", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.minimal-lexical-0.2.1.bazel b/bindgen/3rdparty/crates/BUILD.minimal-lexical-0.2.1.bazel index 9f8c47dc05..548ce64001 100644 --- a/bindgen/3rdparty/crates/BUILD.minimal-lexical-0.2.1.bazel +++ b/bindgen/3rdparty/crates/BUILD.minimal-lexical-0.2.1.bazel @@ -27,12 +27,15 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["std"], + crate_features = [ + "std", + ], crate_root = "src/lib.rs", edition = "2018", rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=minimal-lexical", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.nom-7.1.2.bazel b/bindgen/3rdparty/crates/BUILD.nom-7.1.2.bazel index 5bccb08bc9..eb4fa03857 100644 --- a/bindgen/3rdparty/crates/BUILD.nom-7.1.2.bazel +++ b/bindgen/3rdparty/crates/BUILD.nom-7.1.2.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=nom", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.once_cell-1.17.0.bazel b/bindgen/3rdparty/crates/BUILD.once_cell-1.17.0.bazel index 865af1bb58..c8724ff72b 100644 --- a/bindgen/3rdparty/crates/BUILD.once_cell-1.17.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.once_cell-1.17.0.bazel @@ -38,6 +38,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=once_cell", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.os_str_bytes-6.4.1.bazel b/bindgen/3rdparty/crates/BUILD.os_str_bytes-6.4.1.bazel index 39181ecfb1..489cae5d6a 100644 --- a/bindgen/3rdparty/crates/BUILD.os_str_bytes-6.4.1.bazel +++ b/bindgen/3rdparty/crates/BUILD.os_str_bytes-6.4.1.bazel @@ -27,12 +27,15 @@ rust_library( "WORKSPACE.bazel", ], ), - crate_features = ["raw_os_str"], + crate_features = [ + "raw_os_str", + ], crate_root = "src/lib.rs", edition = "2021", rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=os_str_bytes", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.peeking_take_while-0.1.2.bazel b/bindgen/3rdparty/crates/BUILD.peeking_take_while-0.1.2.bazel index fdc5e07130..a93708a723 100644 --- a/bindgen/3rdparty/crates/BUILD.peeking_take_while-0.1.2.bazel +++ b/bindgen/3rdparty/crates/BUILD.peeking_take_while-0.1.2.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=peeking_take_while", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.proc-macro2-1.0.49.bazel b/bindgen/3rdparty/crates/BUILD.proc-macro2-1.0.49.bazel index 4e5cfd7a02..bc27416a13 100644 --- a/bindgen/3rdparty/crates/BUILD.proc-macro2-1.0.49.bazel +++ b/bindgen/3rdparty/crates/BUILD.proc-macro2-1.0.49.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=proc-macro2", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.quote-1.0.23.bazel b/bindgen/3rdparty/crates/BUILD.quote-1.0.23.bazel index 105dfef1d7..4f5cece282 100644 --- a/bindgen/3rdparty/crates/BUILD.quote-1.0.23.bazel +++ b/bindgen/3rdparty/crates/BUILD.quote-1.0.23.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=quote", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.regex-1.7.0.bazel b/bindgen/3rdparty/crates/BUILD.regex-1.7.0.bazel index ae529334df..2d0be79e0e 100644 --- a/bindgen/3rdparty/crates/BUILD.regex-1.7.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.regex-1.7.0.bazel @@ -50,6 +50,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=regex", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.regex-syntax-0.6.28.bazel b/bindgen/3rdparty/crates/BUILD.regex-syntax-0.6.28.bazel index 887fb13ecc..ab3ae85f62 100644 --- a/bindgen/3rdparty/crates/BUILD.regex-syntax-0.6.28.bazel +++ b/bindgen/3rdparty/crates/BUILD.regex-syntax-0.6.28.bazel @@ -42,6 +42,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=regex-syntax", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.rustc-hash-1.1.0.bazel b/bindgen/3rdparty/crates/BUILD.rustc-hash-1.1.0.bazel index cbf83480dc..afa456ccd1 100644 --- a/bindgen/3rdparty/crates/BUILD.rustc-hash-1.1.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.rustc-hash-1.1.0.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=rustc-hash", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.shlex-1.1.0.bazel b/bindgen/3rdparty/crates/BUILD.shlex-1.1.0.bazel index d2bc163589..8923931f95 100644 --- a/bindgen/3rdparty/crates/BUILD.shlex-1.1.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.shlex-1.1.0.bazel @@ -36,6 +36,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=shlex", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.strsim-0.10.0.bazel b/bindgen/3rdparty/crates/BUILD.strsim-0.10.0.bazel index a145db7be3..8e8529d8ce 100644 --- a/bindgen/3rdparty/crates/BUILD.strsim-0.10.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.strsim-0.10.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=strsim", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.termcolor-1.1.3.bazel b/bindgen/3rdparty/crates/BUILD.termcolor-1.1.3.bazel index ae5f1f1e73..17ed89c566 100644 --- a/bindgen/3rdparty/crates/BUILD.termcolor-1.1.3.bazel +++ b/bindgen/3rdparty/crates/BUILD.termcolor-1.1.3.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=termcolor", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.textwrap-0.16.0.bazel b/bindgen/3rdparty/crates/BUILD.textwrap-0.16.0.bazel index 3dee368b82..24e00f36ff 100644 --- a/bindgen/3rdparty/crates/BUILD.textwrap-0.16.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.textwrap-0.16.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=textwrap", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.unicode-ident-1.0.6.bazel b/bindgen/3rdparty/crates/BUILD.unicode-ident-1.0.6.bazel index f9df5f26fa..d783e0d48e 100644 --- a/bindgen/3rdparty/crates/BUILD.unicode-ident-1.0.6.bazel +++ b/bindgen/3rdparty/crates/BUILD.unicode-ident-1.0.6.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=unicode-ident", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.which-4.3.0.bazel b/bindgen/3rdparty/crates/BUILD.which-4.3.0.bazel index 343896d1c4..894dc8854c 100644 --- a/bindgen/3rdparty/crates/BUILD.which-4.3.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.which-4.3.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=which", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.winapi-0.3.9.bazel b/bindgen/3rdparty/crates/BUILD.winapi-0.3.9.bazel index 3237972799..ca62304eaf 100644 --- a/bindgen/3rdparty/crates/BUILD.winapi-0.3.9.bazel +++ b/bindgen/3rdparty/crates/BUILD.winapi-0.3.9.bazel @@ -6,6 +6,7 @@ # bazel run @//bindgen/3rdparty:crates_vendor ############################################################################### +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") load("@rules_rust//rust:defs.bzl", "rust_library") package(default_visibility = ["//visibility:public"]) @@ -46,9 +47,63 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=winapi", "manual", "noclippy", "norustfmt", ], version = "0.3.9", + deps = [ + "@rules_rust_bindgen__winapi-0.3.9//:build_script_build", + ], +) + +cargo_build_script( + name = "winapi_build_script", + srcs = glob(["**/*.rs"]), + crate_features = [ + "consoleapi", + "errhandlingapi", + "fileapi", + "libloaderapi", + "minwinbase", + "minwindef", + "processenv", + "std", + "winbase", + "wincon", + "winerror", + "winnt", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + exclude = [ + "**/* *", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.9", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = "winapi_build_script", + tags = ["manual"], ) diff --git a/bindgen/3rdparty/crates/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel b/bindgen/3rdparty/crates/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel index 0885eb21d3..8f0fb85d0b 100644 --- a/bindgen/3rdparty/crates/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=winapi-i686-pc-windows-gnu", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.winapi-util-0.1.5.bazel b/bindgen/3rdparty/crates/BUILD.winapi-util-0.1.5.bazel index 7a5394ec0f..4d1de69f55 100644 --- a/bindgen/3rdparty/crates/BUILD.winapi-util-0.1.5.bazel +++ b/bindgen/3rdparty/crates/BUILD.winapi-util-0.1.5.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=winapi-util", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel b/bindgen/3rdparty/crates/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel index 00cd312e9f..c231695c09 100644 --- a/bindgen/3rdparty/crates/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel +++ b/bindgen/3rdparty/crates/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel @@ -32,6 +32,7 @@ rust_library( rustc_flags = ["--cap-lints=allow"], tags = [ "cargo-bazel", + "crate-name=winapi-x86_64-pc-windows-gnu", "manual", "noclippy", "norustfmt", diff --git a/bindgen/3rdparty/crates/defs.bzl b/bindgen/3rdparty/crates/defs.bzl index 174ec01d03..b9498e75b7 100644 --- a/bindgen/3rdparty/crates/defs.bzl +++ b/bindgen/3rdparty/crates/defs.bzl @@ -292,6 +292,7 @@ _NORMAL_DEPENDENCIES = { "": { _COMMON_CONDITION: { "bindgen": "@rules_rust_bindgen__bindgen-0.60.1//:bindgen", + "clang-sys": "@rules_rust_bindgen__clang-sys-1.4.0//:clang_sys", "libloading": "@rules_rust_bindgen__libloading-0.7.4//:libloading", }, }, @@ -356,7 +357,7 @@ _BUILD_PROC_MACRO_ALIASES = { _CONDITIONS = { "cfg(target_os = \"hermit\")": [], - "cfg(unix)": ["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-apple-ios-sim", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabi", "armv7-linux-androideabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "s390x-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-linux-android", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu"], + "cfg(unix)": ["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-apple-ios-sim", "aarch64-fuchsia", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabi", "armv7-linux-androideabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "s390x-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-fuchsia", "x86_64-linux-android", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu"], "cfg(windows)": ["aarch64-pc-windows-msvc", "i686-pc-windows-msvc", "x86_64-pc-windows-msvc"], "i686-pc-windows-gnu": [], "x86_64-pc-windows-gnu": [], diff --git a/bindgen/3rdparty/patches/BUILD.bazel b/bindgen/3rdparty/patches/BUILD.bazel new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bindgen/3rdparty/patches/README.md b/bindgen/3rdparty/patches/README.md new file mode 100644 index 0000000000..6191ecf288 --- /dev/null +++ b/bindgen/3rdparty/patches/README.md @@ -0,0 +1,25 @@ +# Patches + +All patches pair with the versions of the referenced repositories defined in `@rules_rust//bindgen:repositories.bzl`. + +## [llvm-project.cxx17](./llvm-project.cxx17.patch) + +The llvm-project requires a compiler that builds with at least C++14 but there's no configuration +for this on the targets defined in the repo. This patch plumbs through flags for setting the C++ +version on targets to avoid any need for bazel configuration flags. If this patch causes issues +for users with their current toolchain or toolchain definitions then simply defining the `llvm-raw` +repository before loading `rust_bindgen_dependencies` should avoid this. + +## [llvm-project.incompatible_disallow_empty_glob](./llvm-project.incompatible_disallow_empty_glob.patch) + +Uses of `glob` are updated to have `allow_empty = True` added so the llvm-project repo is compatible +with consumers building with [--incompatible_disallow_empty_glob](https://bazel.build/reference/command-line-reference#flag--incompatible_disallow_empty_glob). + +Most of this patch is generated using the following regex and replace patterns. There are a handful +of additional modifications for more extravagant globs. + +| regex | replace | +| --- | --- | +| `glob\(([\[\w\d_\-\*\/\.\],=\n\s"]+)\) \+` | `glob($1, allow_empty = True) +` | +| `glob\(([\[\w\d_\-\*\/\.\],=\n\s"]+)\),` | `glob($1, allow_empty = True),` | +| `(,[\s\n]+), ` | `$1` | diff --git a/bindgen/3rdparty/patches/llvm-project.cxx17.patch b/bindgen/3rdparty/patches/llvm-project.cxx17.patch new file mode 100644 index 0000000000..fba538489f --- /dev/null +++ b/bindgen/3rdparty/patches/llvm-project.cxx17.patch @@ -0,0 +1,537 @@ +diff --git a/utils/bazel/configure.bzl b/utils/bazel/configure.bzl +index 4c5ab8bd0972..44de2da1a136 100644 +--- a/utils/bazel/configure.bzl ++++ b/utils/bazel/configure.bzl +@@ -70,6 +70,11 @@ def _overlay_directories(repository_ctx): + )) + + def _llvm_configure_impl(repository_ctx): ++ # Force this repository rule to update if any of the overlay ++ # sources change. ++ for target in repository_ctx.attr._srcs: ++ repository_ctx.path(target) ++ + _overlay_directories(repository_ctx) + + # Create a starlark file with the requested LLVM targets. +@@ -86,6 +91,16 @@ llvm_configure = repository_rule( + configure = True, + attrs = { + "targets": attr.string_list(default = DEFAULT_TARGETS), ++ "_srcs": attr.label_list(default = [ ++ Label("//utils/bazel/llvm-project-overlay/clang:BUILD.bazel"), ++ Label("//utils/bazel/llvm-project-overlay/libunwind:BUILD.bazel"), ++ Label("//utils/bazel/llvm-project-overlay/llvm:binary_alias.bzl"), ++ Label("//utils/bazel/llvm-project-overlay/llvm:BUILD.bazel"), ++ Label("//utils/bazel/llvm-project-overlay/llvm:cc_plugin_library.bzl"), ++ Label("//utils/bazel/llvm-project-overlay/llvm:config.bzl"), ++ Label("//utils/bazel/llvm-project-overlay/llvm:tblgen.bzl"), ++ Label("//utils/bazel/llvm-project-overlay/llvm:template_rule.bzl"), ++ ]), + }, + ) + +diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +index a2b1e0f33073..0c1abe607b58 100644 +--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +@@ -5,6 +5,7 @@ + load("//llvm:tblgen.bzl", "gentbl") + load("//llvm:binary_alias.bzl", "binary_alias") + load("//llvm:cc_plugin_library.bzl", "cc_plugin_library") ++load("//llvm:config.bzl", "llvm_stdcxx_copts") + + package( + default_visibility = ["//visibility:public"], +@@ -28,7 +29,7 @@ cc_binary( + ]), + copts = [ + "$(STACK_FRAME_UNLIMITED)", +- ], ++ ] + llvm_stdcxx_copts, + stamp = 0, + deps = [ + "//llvm:Support", +@@ -391,8 +392,8 @@ cc_library( + cc_library( + name = "basic", + srcs = [ +- "include/clang/Basic/Version.inc", + "include/VCSVersion.inc", ++ "include/clang/Basic/Version.inc", + ] + glob([ + "lib/Basic/*.cpp", + "lib/Basic/*.c", +@@ -406,7 +407,7 @@ cc_library( + copts = [ + "-DHAVE_VCS_VERSION_INC", + "$(STACK_FRAME_UNLIMITED)", +- ], ++ ] + llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = [ + "include/clang/Basic/arm_fp16.inc", +@@ -471,6 +472,7 @@ cc_library( + hdrs = glob([ + "include/clang/Lex/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":basic", +@@ -711,7 +713,7 @@ cc_library( + # headers such as `CXXABI.h`. + "-I$(GENDIR)/external/llvm-project/clang/lib/AST", + "-I$(GENDIR)/external/llvm-project/clang/lib/AST/Interp", +- ], ++ ] + llvm_stdcxx_copts, + textual_hdrs = [ + "include/clang/AST/AttrImpl.inc", + "include/clang/AST/AttrNodeTraverse.inc", +@@ -763,6 +765,7 @@ cc_library( + "include/clang/Index/*.h", + "include/clang-c/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -786,6 +789,7 @@ cc_library( + hdrs = glob([ + "include/clang/Analysis/**/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/clang/Analysis/**/*.def", +@@ -844,7 +848,7 @@ cc_library( + "include/clang/Sema/*.h", + "include/clang-c/*.h", + ]), +- copts = ["$(STACK_FRAME_UNLIMITED)"], ++ copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = [ + "include/clang/Sema/AttrParsedAttrImpl.inc", +@@ -911,6 +915,7 @@ cc_library( + "include/clang/Parse/AttrParserStringSwitches.inc", + "include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc", + ] + glob(["include/clang/Parse/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -932,6 +937,7 @@ cc_library( + "lib/ASTMatchers/*.h", + ]), + hdrs = glob(["include/clang/ASTMatchers/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -948,7 +954,7 @@ cc_library( + "lib/ASTMatchers/Dynamic/*.h", + ]), + hdrs = glob(["include/clang/ASTMatchers/Dynamic/*.h"]), +- copts = ["$(STACK_FRAME_UNLIMITED)"], ++ copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -966,6 +972,7 @@ cc_library( + "lib/Rewrite/*.h", + ]), + hdrs = glob(["include/clang/Rewrite/Core/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -982,6 +989,7 @@ cc_library( + "lib/Testing/*.cpp", + ]), + hdrs = glob(["include/clang/Testing/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":basic", +@@ -996,6 +1004,7 @@ cc_library( + "lib/Tooling/Core/*.h", + ]), + hdrs = glob(["include/clang/Tooling/Core/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -1018,6 +1027,7 @@ cc_library( + hdrs = glob([ + "include/clang/Tooling/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -1042,6 +1052,7 @@ cc_library( + hdrs = glob([ + "include/clang/Tooling/Inclusions/**/*.h", + ]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":basic", + ":lex", +@@ -1061,6 +1072,7 @@ cc_library( + "include/clang/Tooling/Refactoring/**/*.h", + "include/clang/Tooling/Refactoring/**/*.def", + ]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":ast", + ":ast_matchers", +@@ -1094,6 +1106,7 @@ cc_library( + name = "tooling_syntax", + srcs = glob(["lib/Tooling/Syntax/**/*.cpp"]), + hdrs = glob(["include/clang/Tooling/Syntax/**/*.h"]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":ast", + ":basic", +@@ -1108,6 +1121,7 @@ cc_library( + name = "tooling_dependency_scanning", + srcs = glob(["lib/Tooling/DependencyScanning/**/*.cpp"]), + hdrs = glob(["include/clang/Tooling/DependencyScanning/**/*.h"]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":basic", + ":codegen", +@@ -1123,6 +1137,7 @@ cc_library( + name = "transformer", + srcs = glob(["lib/Tooling/Transformer/**/*.cpp"]), + hdrs = glob(["include/clang/Tooling/Transformer/**/*.h"]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":ast", + ":ast_matchers", +@@ -1138,6 +1153,7 @@ cc_library( + name = "ast-diff", + srcs = glob(["lib/Tooling/ASTDiff/*.cpp"]), + hdrs = glob(["include/clang/Tooling/ASTDiff/*.h"]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":ast", + ":basic", +@@ -1150,6 +1166,7 @@ cc_library( + name = "crosstu", + srcs = glob(["lib/CrossTU/*.cpp"]), + hdrs = glob(["include/clang/CrossTU/*.h"]), ++ copts = llvm_stdcxx_copts, + deps = [ + ":ast", + ":basic", +@@ -1174,6 +1191,7 @@ cc_library( + ] + glob([ + "include/clang/Format/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":basic", +@@ -1188,6 +1206,7 @@ cc_library( + name = "edit", + srcs = glob(["lib/Edit/*.cpp"]), + hdrs = glob(["include/clang/Edit/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -1222,6 +1241,7 @@ cc_library( + hdrs = glob([ + "include/clang/StaticAnalyzer/Core/**/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/clang/StaticAnalyzer/Core/**/*.def", +@@ -1268,7 +1288,7 @@ cc_library( + ] + glob([ + "include/clang/StaticAnalyzer/Checkers/**/*.h", + ]), +- copts = ["$(STACK_FRAME_UNLIMITED)"], ++ copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":analysis", +@@ -1316,7 +1336,7 @@ cc_library( + hdrs = glob([ + "include/clang/Driver/*.h", + ]), +- copts = ["$(STACK_FRAME_UNLIMITED)"], ++ copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = [ + "include", + # TODO: This is likely a layering issue, but files in Arch are currently +@@ -1479,7 +1499,7 @@ cc_library( + hdrs = glob([ + "include/clang/Frontend/*.h", + ]), +- copts = ["$(STACK_FRAME_UNLIMITED)"], ++ copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + data = [":builtin_headers_gen"], + includes = ["include"], + textual_hdrs = glob([ +@@ -1519,6 +1539,7 @@ cc_library( + "lib/Frontend/Rewrite/*.h", + ]), + hdrs = glob(["include/clang/Rewrite/Frontend/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":ast", +@@ -1541,6 +1562,7 @@ cc_library( + "lib/Interpreter/*.h", + ]), + hdrs = glob(["include/clang/Interpreter/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":analysis", +@@ -1573,7 +1595,7 @@ cc_library( + "lib/CodeGen/*.h", + ]), + hdrs = glob(["include/clang/CodeGen/*.h"]), +- copts = ["$(STACK_FRAME_UNLIMITED)"], ++ copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":analysis", +@@ -1624,6 +1646,7 @@ cc_library( + "lib/StaticAnalyzer/Frontend/**/*.h", + ]), + hdrs = glob(["include/clang/StaticAnalyzer/Frontend/**/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":analysis", +@@ -1678,6 +1701,7 @@ cc_library( + hdrs = glob([ + "include/clang/Serialization/*.h", + ]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/clang/Serialization/*.def", +@@ -1705,6 +1729,7 @@ cc_library( + "lib/FrontendTool/*.h", + ]), + hdrs = glob(["include/clang/FrontendTool/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":arc_migrate", +@@ -1726,6 +1751,7 @@ cc_library( + "lib/ARCMigrate/*.h", + ]), + hdrs = glob(["include/clang/ARCMigrate/*.h"]), ++ copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ + ":analysis", +@@ -1752,6 +1778,7 @@ cc_library( + "tools/libclang/*.h", + ]), + hdrs = glob(["include/clang-c/*.h"]), ++ copts = llvm_stdcxx_copts, + defines = ["CINDEX_NO_EXPORTS"], + deps = [ + ":arc_migrate", +@@ -1783,7 +1810,7 @@ cc_plugin_library( + copts = select({ + "@bazel_tools//src/conditions:windows": ["-D_CINDEX_LIB_"], + "//conditions:default": [], +- }), ++ }) + llvm_stdcxx_copts, + strip_include_prefix = "include", + deps = [ + ":arc_migrate", +@@ -1912,7 +1939,7 @@ cc_library( + # Disable stack frame size checks in the driver because + # clang::ensureStackAddressSpace allocates a large array on the stack. + "$(STACK_FRAME_UNLIMITED)", +- ], ++ ] + llvm_stdcxx_copts, + deps = [ + ":analysis", + ":ast", +@@ -1947,6 +1974,7 @@ cc_library( + cc_binary( + name = "clang", + srcs = [], ++ copts = llvm_stdcxx_copts, + stamp = 0, + deps = [ + ":clang-driver", +diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +index 85d79a29b571..716d7f5d9645 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +@@ -4,7 +4,7 @@ + + load(":template_rule.bzl", "template_rule") + load(":tblgen.bzl", "gentbl") +-load(":config.bzl", "llvm_config_defines") ++load(":config.bzl", "llvm_config_defines", "llvm_stdcxx_copts") + load(":targets.bzl", "llvm_targets") + load(":enum_targets_gen.bzl", "enum_targets_gen") + load(":binary_alias.bzl", "binary_alias") +@@ -21,10 +21,12 @@ exports_files(["LICENSE.TXT"]) + # toolchain or the `.bazelrc` file. This is just a workaround until we have a + # widely available feature to enable unlimited stack frame instead of using + # this `Make` variable. +-llvm_copts = [ ++llvm_c_only_opts = [ + "$(STACK_FRAME_UNLIMITED)", + ] + ++llvm_copts = llvm_c_only_opts + llvm_stdcxx_copts ++ + enum_targets_gen( + name = "targets_def_gen", + src = "include/llvm/Config/Targets.def.in", +@@ -167,10 +169,69 @@ genrule( + "echo -e '#undef HANDLE_EXTENSION' >> $@\n", + ) + ++# TODO: This separation is required to separate out C++ and C opts ++# https://github.com/bazelbuild/bazel/issues/16551 + cc_library( +- name = "Support", ++ name = "Support-c", + srcs = glob([ + "lib/Support/*.c", ++ ]), ++ hdrs = glob([ ++ "include/llvm/Support/**/*.h", ++ "include/llvm/ADT/*.h", ++ ]) + [ ++ "include/llvm-c/Core.h", ++ "include/llvm-c/DataTypes.h", ++ "include/llvm-c/Deprecated.h", ++ "include/llvm-c/DisassemblerTypes.h", ++ "include/llvm-c/Error.h", ++ "include/llvm-c/ErrorHandling.h", ++ "include/llvm-c/ExternC.h", ++ "include/llvm-c/Support.h", ++ "include/llvm-c/Types.h", ++ "include/llvm/ExecutionEngine/JITSymbol.h", ++ "include/llvm/Support/Extension.def", ++ "include/llvm/Support/VCSRevision.h", ++ ], ++ copts = llvm_c_only_opts, ++ includes = ["include"], ++ linkopts = select({ ++ "@bazel_tools//src/conditions:windows": [], ++ "@bazel_tools//src/conditions:freebsd": [ ++ "-pthread", ++ "-lexecinfo", ++ "-ldl", ++ "-lm", ++ ], ++ "//conditions:default": [ ++ "-pthread", ++ "-ldl", ++ "-lm", ++ ], ++ }), ++ textual_hdrs = glob([ ++ "include/llvm/Support/*.def", ++ "lib/Support/*.h", ++ "lib/Support/*.inc", ++ ]), ++ deps = [ ++ ":config", ++ ":Demangle", ++ # We unconditionally depend on the custom LLVM terminfo wrapper. This ++ # will be an empty library unless terminfo is enabled, in which case it ++ # will both provide the necessary dependencies and configuration ++ # defines. ++ "@llvm_terminfo//:terminfo", ++ # We unconditionally depend on the custom LLVM zlib wrapper. This will ++ # be an empty library unless zlib is enabled, in which case it will ++ # both provide the necessary dependencies and configuration defines. ++ "@llvm_zlib//:zlib", ++ ], ++) ++ ++cc_library( ++ name = "Support", ++ srcs = glob([ + "lib/Support/*.cpp", + "lib/Support/*.h", + "lib/Support/*.inc", +@@ -223,6 +284,7 @@ cc_library( + "include/llvm/Support/*.def", + ]), + deps = [ ++ ":Support-c", + ":config", + ":Demangle", + # We unconditionally depend on the custom LLVM terminfo wrapper. This +diff --git a/utils/bazel/llvm-project-overlay/llvm/cc_plugin_library.bzl b/utils/bazel/llvm-project-overlay/llvm/cc_plugin_library.bzl +index 2ebd39c630dc..e45bd8a1ce92 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/cc_plugin_library.bzl ++++ b/utils/bazel/llvm-project-overlay/llvm/cc_plugin_library.bzl +@@ -16,6 +16,7 @@ configure generic aspects of all generated rules such as `testonly`. Lastly, + """ + + load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_import", "cc_library") ++load(":config.bzl", "llvm_stdcxx_copts") + + def cc_plugin_library(name, srcs, hdrs, include_prefix = None, strip_include_prefix = None, alwayslink = False, features = [], tags = [], testonly = False, **kwargs): + # Neither the name of the plugin binary nor tags on whether it is built are +@@ -29,6 +30,7 @@ def cc_plugin_library(name, srcs, hdrs, include_prefix = None, strip_include_pre + dylib_name = name + ".dylib" + interface_output_name = name + "_interface_output" + import_name = name + "_import" ++ copts = kwargs.pop("copts", []) + for impl_name in [dll_name, dylib_name, so_name]: + cc_binary( + name = impl_name, +@@ -38,6 +40,7 @@ def cc_plugin_library(name, srcs, hdrs, include_prefix = None, strip_include_pre + features = features, + tags = ["manual"] + tags, + testonly = testonly, ++ copts = copts + llvm_stdcxx_copts, + **kwargs + ) + native.filegroup( +diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl +index 2046b2645362..736844bfc2d0 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl ++++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl +@@ -97,3 +97,8 @@ llvm_config_defines = os_defines + select({ + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + ] ++ ++llvm_stdcxx_copts = select({ ++ "@platforms//os:windows": ["/std:c++17"], ++ "//conditions:default": ["-std=c++17"], ++}) +diff --git a/utils/bazel/llvm-project-overlay/llvm/tblgen.bzl b/utils/bazel/llvm-project-overlay/llvm/tblgen.bzl +index d43390918e39..e0482a6fd4fa 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/tblgen.bzl ++++ b/utils/bazel/llvm-project-overlay/llvm/tblgen.bzl +@@ -12,6 +12,8 @@ TODO(chandlerc): Currently this expresses include-based dependencies as + correctly understood by the build system. + """ + ++load(":config.bzl", "llvm_stdcxx_copts") ++ + def gentbl( + name, + tblgen, +@@ -77,5 +79,6 @@ def gentbl( + # distinction between these two. + hdrs = [f for (_, f) in tbl_outs], + features = ["-parse_headers", "-header_modules"], ++ copts = llvm_stdcxx_copts, + **kwargs + ) diff --git a/bindgen/3rdparty/patches/llvm-project.incompatible_disallow_empty_glob.patch b/bindgen/3rdparty/patches/llvm-project.incompatible_disallow_empty_glob.patch new file mode 100644 index 0000000000..001affa6a0 --- /dev/null +++ b/bindgen/3rdparty/patches/llvm-project.incompatible_disallow_empty_glob.patch @@ -0,0 +1,2191 @@ +diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +index 0c1abe607b58..a382a3bc3d69 100644 +--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +@@ -26,7 +26,7 @@ cc_binary( + srcs = glob([ + "utils/TableGen/*.cpp", + "utils/TableGen/*.h", +- ]), ++ ], allow_empty = True), + copts = [ + "$(STACK_FRAME_UNLIMITED)", + ] + llvm_stdcxx_copts, +@@ -68,7 +68,7 @@ gentbl( + ], + tblgen = ":clang-tblgen", + td_file = "include/clang/Basic/Diagnostic.td", +- td_srcs = glob(["include/clang/Basic/*.td"]), ++ td_srcs = glob(["include/clang/Basic/*.td"], allow_empty = True), + ) + + gentbl( +@@ -333,11 +333,11 @@ gentbl( + # Table definition files can be used for documentation: + filegroup( + name = "all_table_defs", +- srcs = glob(["include/**/*.td"]), ++ srcs = glob(["include/**/*.td"], allow_empty = True), + ) + + exports_files( +- glob(["include/**/*.td"]), ++ glob(["include/**/*.td"], allow_empty = True), + ) + + genrule( +@@ -384,7 +384,7 @@ cc_library( + name = "basic_internal_headers", + hdrs = glob([ + "lib/Basic/*.h", +- ]), ++ ], allow_empty = True), + features = ["-header_modules"], + strip_include_prefix = "lib/Basic", + ) +@@ -400,10 +400,10 @@ cc_library( + "lib/Basic/*.h", + "lib/Basic/Targets/*.cpp", + "lib/Basic/Targets/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Basic/*.h", +- ]), ++ ], allow_empty = True), + copts = [ + "-DHAVE_VCS_VERSION_INC", + "$(STACK_FRAME_UNLIMITED)", +@@ -435,7 +435,7 @@ cc_library( + "include/clang/Basic/DiagnosticIndexName.inc", + ] + glob([ + "include/clang/Basic/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":basic_arm_cde_gen", + ":basic_arm_fp16_inc_gen", +@@ -468,10 +468,10 @@ cc_library( + srcs = glob([ + "lib/Lex/*.cpp", + "lib/Lex/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Lex/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -694,13 +694,13 @@ cc_library( + "lib/AST/*.h", + "lib/AST/Interp/*.cpp", + "lib/AST/Interp/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "lib/AST/AttrDocTable.inc", + "lib/AST/Interp/Opcodes.inc", + ], + hdrs = glob([ + "include/clang/AST/*.h", +- ]), ++ ], allow_empty = True), + copts = [ + # FIXME: This is necessary to allow "file relative" include paths from + # non-generated `srcs` to find generated `srcs` above. Bazel should +@@ -731,7 +731,7 @@ cc_library( + "include/clang/AST/StmtNodes.inc", + ] + glob([ + "include/clang/AST/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":ast_attr_gen", + ":ast_comment_command_info_gen", +@@ -760,7 +760,7 @@ cc_library( + srcs = glob([ + "lib/Index/*.cpp", + "lib/Index/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Index/*.h", + "include/clang-c/*.h", +@@ -785,15 +785,15 @@ cc_library( + srcs = glob([ + "lib/Analysis/*.cpp", + "lib/Analysis/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Analysis/**/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/clang/Analysis/**/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":ast", + ":ast_matchers", +@@ -843,7 +843,7 @@ cc_library( + srcs = glob([ + "lib/Sema/*.cpp", + "lib/Sema/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Sema/*.h", + "include/clang-c/*.h", +@@ -910,11 +910,11 @@ cc_library( + ] + glob([ + "lib/Parse/*.cpp", + "lib/Parse/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/clang/Parse/AttrParserStringSwitches.inc", + "include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc", +- ] + glob(["include/clang/Parse/*.h"]), ++ ] + glob(["include/clang/Parse/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -935,8 +935,8 @@ cc_library( + srcs = glob([ + "lib/ASTMatchers/*.cpp", + "lib/ASTMatchers/*.h", +- ]), +- hdrs = glob(["include/clang/ASTMatchers/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/ASTMatchers/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -952,8 +952,8 @@ cc_library( + srcs = glob([ + "lib/ASTMatchers/Dynamic/*.cpp", + "lib/ASTMatchers/Dynamic/*.h", +- ]), +- hdrs = glob(["include/clang/ASTMatchers/Dynamic/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/ASTMatchers/Dynamic/*.h"], allow_empty = True), + copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -970,8 +970,8 @@ cc_library( + srcs = glob([ + "lib/Rewrite/*.cpp", + "lib/Rewrite/*.h", +- ]), +- hdrs = glob(["include/clang/Rewrite/Core/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/Rewrite/Core/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -987,8 +987,8 @@ cc_library( + name = "testing", + srcs = glob([ + "lib/Testing/*.cpp", +- ]), +- hdrs = glob(["include/clang/Testing/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/Testing/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1002,8 +1002,8 @@ cc_library( + srcs = glob([ + "lib/Tooling/Core/*.cpp", + "lib/Tooling/Core/*.h", +- ]), +- hdrs = glob(["include/clang/Tooling/Core/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/Tooling/Core/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1026,7 +1026,7 @@ cc_library( + ), + hdrs = glob([ + "include/clang/Tooling/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1048,10 +1048,10 @@ cc_library( + name = "tooling_inclusions", + srcs = glob([ + "lib/Tooling/Inclusions/**/*.cpp", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Tooling/Inclusions/**/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":basic", +@@ -1067,11 +1067,11 @@ cc_library( + srcs = glob([ + "lib/Tooling/Refactoring/**/*.cpp", + "lib/Tooling/Refactoring/**/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Tooling/Refactoring/**/*.h", + "include/clang/Tooling/Refactoring/**/*.def", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":ast", +@@ -1104,8 +1104,8 @@ gentbl( + + cc_library( + name = "tooling_syntax", +- srcs = glob(["lib/Tooling/Syntax/**/*.cpp"]), +- hdrs = glob(["include/clang/Tooling/Syntax/**/*.h"]), ++ srcs = glob(["lib/Tooling/Syntax/**/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/clang/Tooling/Syntax/**/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":ast", +@@ -1119,8 +1119,8 @@ cc_library( + + cc_library( + name = "tooling_dependency_scanning", +- srcs = glob(["lib/Tooling/DependencyScanning/**/*.cpp"]), +- hdrs = glob(["include/clang/Tooling/DependencyScanning/**/*.h"]), ++ srcs = glob(["lib/Tooling/DependencyScanning/**/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/clang/Tooling/DependencyScanning/**/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":basic", +@@ -1135,8 +1135,8 @@ cc_library( + + cc_library( + name = "transformer", +- srcs = glob(["lib/Tooling/Transformer/**/*.cpp"]), +- hdrs = glob(["include/clang/Tooling/Transformer/**/*.h"]), ++ srcs = glob(["lib/Tooling/Transformer/**/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/clang/Tooling/Transformer/**/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":ast", +@@ -1151,8 +1151,8 @@ cc_library( + + cc_library( + name = "ast-diff", +- srcs = glob(["lib/Tooling/ASTDiff/*.cpp"]), +- hdrs = glob(["include/clang/Tooling/ASTDiff/*.h"]), ++ srcs = glob(["lib/Tooling/ASTDiff/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/clang/Tooling/ASTDiff/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":ast", +@@ -1164,8 +1164,8 @@ cc_library( + + cc_library( + name = "crosstu", +- srcs = glob(["lib/CrossTU/*.cpp"]), +- hdrs = glob(["include/clang/CrossTU/*.h"]), ++ srcs = glob(["lib/CrossTU/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/clang/CrossTU/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + deps = [ + ":ast", +@@ -1184,13 +1184,13 @@ cc_library( + "lib/Format/*.cpp", + "lib/Format/*.h", + ], +- ), ++ allow_empty = True), + hdrs = [ + "lib/Format/FormatTokenLexer.h", + "lib/Format/Macros.h", + ] + glob([ + "include/clang/Format/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1204,8 +1204,8 @@ cc_library( + + cc_library( + name = "edit", +- srcs = glob(["lib/Edit/*.cpp"]), +- hdrs = glob(["include/clang/Edit/*.h"]), ++ srcs = glob(["lib/Edit/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/clang/Edit/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1237,15 +1237,15 @@ cc_library( + srcs = glob([ + "lib/StaticAnalyzer/Core/**/*.cpp", + "lib/StaticAnalyzer/Core/**/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/StaticAnalyzer/Core/**/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/clang/StaticAnalyzer/Core/**/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":analysis", + ":ast", +@@ -1282,12 +1282,12 @@ cc_library( + srcs = glob([ + "lib/StaticAnalyzer/Checkers/**/*.cpp", + "lib/StaticAnalyzer/Checkers/**/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/clang/StaticAnalyzer/Checkers/Checkers.inc", + ] + glob([ + "include/clang/StaticAnalyzer/Checkers/**/*.h", +- ]), ++ ], allow_empty = True), + copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1332,10 +1332,10 @@ cc_library( + exclude = [ + "lib/Driver/ToolChains/MSVCSetupApi.h", + ], +- ), ++ allow_empty = True), + hdrs = glob([ + "include/clang/Driver/*.h", +- ]), ++ ], allow_empty = True), + copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = [ + "include", +@@ -1349,7 +1349,7 @@ cc_library( + }), + textual_hdrs = glob([ + "include/clang/Driver/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":ast", + ":basic", +@@ -1466,7 +1466,7 @@ gentbl( + # We generate the set of builtin headers under a special subdirectory in the + # 'bin' section of the bazel output so that they can be used as data + # dependencies. It requires listing explicitly all the generated inputs here. +-builtin_headers = glob(["lib/Headers/**/*.h"]) + [ ++builtin_headers = glob(["lib/Headers/**/*.h"], allow_empty = True) + [ + "lib/Headers/arm_cde.h", + "lib/Headers/arm_fp16.h", + "lib/Headers/arm_mve.h", +@@ -1495,16 +1495,16 @@ cc_library( + srcs = glob([ + "lib/Frontend/*.cpp", + "lib/Frontend/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Frontend/*.h", +- ]), ++ ], allow_empty = True), + copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + data = [":builtin_headers_gen"], + includes = ["include"], + textual_hdrs = glob([ + "include/clang/Frontend/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":ast", + ":basic", +@@ -1537,8 +1537,8 @@ cc_library( + srcs = glob([ + "lib/Frontend/Rewrite/*.cpp", + "lib/Frontend/Rewrite/*.h", +- ]), +- hdrs = glob(["include/clang/Rewrite/Frontend/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/Rewrite/Frontend/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1560,8 +1560,8 @@ cc_library( + srcs = glob([ + "lib/Interpreter/*.cpp", + "lib/Interpreter/*.h", +- ]), +- hdrs = glob(["include/clang/Interpreter/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/Interpreter/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1593,8 +1593,8 @@ cc_library( + srcs = glob([ + "lib/CodeGen/*.cpp", + "lib/CodeGen/*.h", +- ]), +- hdrs = glob(["include/clang/CodeGen/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/CodeGen/*.h"], allow_empty = True), + copts = ["$(STACK_FRAME_UNLIMITED)"] + llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1644,8 +1644,8 @@ cc_library( + srcs = glob([ + "lib/StaticAnalyzer/Frontend/**/*.cpp", + "lib/StaticAnalyzer/Frontend/**/*.h", +- ]), +- hdrs = glob(["include/clang/StaticAnalyzer/Frontend/**/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/StaticAnalyzer/Frontend/**/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1697,15 +1697,15 @@ cc_library( + ] + glob([ + "lib/Serialization/*.cpp", + "lib/Serialization/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/clang/Serialization/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/clang/Serialization/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":ast", + ":basic", +@@ -1727,8 +1727,8 @@ cc_library( + srcs = glob([ + "lib/FrontendTool/*.cpp", + "lib/FrontendTool/*.h", +- ]), +- hdrs = glob(["include/clang/FrontendTool/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/FrontendTool/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1749,8 +1749,8 @@ cc_library( + srcs = glob([ + "lib/ARCMigrate/*.cpp", + "lib/ARCMigrate/*.h", +- ]), +- hdrs = glob(["include/clang/ARCMigrate/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/clang/ARCMigrate/*.h"], allow_empty = True), + copts = llvm_stdcxx_copts, + includes = ["include"], + deps = [ +@@ -1776,7 +1776,7 @@ cc_library( + srcs = glob([ + "tools/libclang/*.cpp", + "tools/libclang/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob(["include/clang-c/*.h"]), + copts = llvm_stdcxx_copts, + defines = ["CINDEX_NO_EXPORTS"], +@@ -1805,7 +1805,7 @@ cc_plugin_library( + srcs = glob([ + "tools/libclang/*.cpp", + "tools/libclang/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob(["include/clang-c/*.h"]), + copts = select({ + "@bazel_tools//src/conditions:windows": ["-D_CINDEX_LIB_"], +@@ -1914,7 +1914,7 @@ cc_binary( + srcs = glob([ + "tools/clang-import-test/*.cpp", + "tools/clang-import-test/*.h", +- ]), ++ ], allow_empty = True), + stamp = 0, + deps = [ + ":ast", +@@ -1934,7 +1934,7 @@ cc_library( + srcs = glob([ + "tools/driver/*.cpp", + "tools/driver/*.h", +- ]), ++ ], allow_empty = True), + copts = [ + # Disable stack frame size checks in the driver because + # clang::ensureStackAddressSpace allocates a large array on the stack. +@@ -1986,7 +1986,7 @@ cc_binary( + srcs = glob([ + "tools/diagtool/*.cpp", + "tools/diagtool/*.h", +- ]), ++ ], allow_empty = True), + stamp = 0, + deps = [ + ":basic", +diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +index 716d7f5d9645..1e3e7a8ff0e7 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +@@ -39,7 +39,7 @@ enum_targets_gen( + llvm_target_asm_printers = [ + t + for t in llvm_targets +- if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)]) ++ if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)], allow_empty = True) + ] + + enum_targets_gen( +@@ -54,7 +54,7 @@ enum_targets_gen( + llvm_target_asm_parsers = [ + t + for t in llvm_targets +- if glob(["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)]) ++ if glob(["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)], allow_empty = True) + ] + + enum_targets_gen( +@@ -69,7 +69,7 @@ enum_targets_gen( + llvm_target_disassemblers = [ + t + for t in llvm_targets +- if glob(["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)]) ++ if glob(["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)], allow_empty = True) + ] + + enum_targets_gen( +@@ -84,7 +84,7 @@ enum_targets_gen( + llvm_target_mcas = [ + t + for t in llvm_targets +- if glob(["lib/Target/{}/MCA/CMakeLists.txt".format(t)]) ++ if glob(["lib/Target/{}/MCA/CMakeLists.txt".format(t)], allow_empty = True) + ] + + enum_targets_gen( +@@ -149,8 +149,8 @@ cc_library( + srcs = glob([ + "lib/Demangle/*.cpp", + "lib/Demangle/*.h", +- ]), +- hdrs = glob(["include/llvm/Demangle/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Demangle/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [":config"], + ) +@@ -175,11 +175,11 @@ cc_library( + name = "Support-c", + srcs = glob([ + "lib/Support/*.c", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Support/**/*.h", + "include/llvm/ADT/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Core.h", + "include/llvm-c/DataTypes.h", + "include/llvm-c/Deprecated.h", +@@ -213,7 +213,7 @@ cc_library( + "include/llvm/Support/*.def", + "lib/Support/*.h", + "lib/Support/*.inc", +- ]), ++ ], allow_empty = True), + deps = [ + ":config", + ":Demangle", +@@ -241,16 +241,16 @@ cc_library( + "@bazel_tools//src/conditions:windows": glob([ + "lib/Support/Windows/*.h", + "lib/Support/Windows/*.inc", +- ]), ++ ], allow_empty = True), + "//conditions:default": glob([ + "lib/Support/Unix/*.h", + "lib/Support/Unix/*.inc", +- ]), ++ ], allow_empty = True), + }), + hdrs = glob([ + "include/llvm/Support/**/*.h", + "include/llvm/ADT/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Core.h", + "include/llvm-c/DataTypes.h", + "include/llvm-c/Deprecated.h", +@@ -282,7 +282,7 @@ cc_library( + }), + textual_hdrs = glob([ + "include/llvm/Support/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":Support-c", + ":config", +@@ -306,8 +306,8 @@ cc_library( + srcs = glob([ + "lib/FileCheck/*.cpp", + "lib/FileCheck/*.h", +- ]), +- hdrs = glob(["include/llvm/FileCheck/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/FileCheck/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [":Support"], + ) +@@ -317,8 +317,8 @@ cc_library( + srcs = glob([ + "lib/LineEditor/*.cpp", + "lib/LineEditor/*.h", +- ]), +- hdrs = glob(["include/llvm/LineEditor/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/LineEditor/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Support", +@@ -331,8 +331,8 @@ cc_library( + srcs = glob([ + "lib/Option/*.cpp", + "lib/Option/*.h", +- ]), +- hdrs = glob(["include/llvm/Option/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Option/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Support", +@@ -345,8 +345,8 @@ cc_library( + srcs = glob([ + "lib/TableGen/*.cpp", + "lib/TableGen/*.h", +- ]), +- hdrs = glob(["include/llvm/TableGen/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/TableGen/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Support", +@@ -365,7 +365,7 @@ cc_library( + exclude = [ + "include/llvm/LinkAllPasses.h", + ], +- ) + [ ++ allow_empty = True) + [ + "include/llvm/IR/Value.def", + "include/llvm-c/Comdat.h", + "include/llvm-c/DebugInfo.h", +@@ -379,16 +379,16 @@ cc_library( + "lib/BinaryFormat/*.cpp", + "lib/BinaryFormat/*.def", + "lib/BinaryFormat/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/BinaryFormat/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + includes = ["include"], + textual_hdrs = glob([ + "include/llvm/BinaryFormat/*.def", + "include/llvm/BinaryFormat/ELFRelocs/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":Support", + ], +@@ -396,7 +396,7 @@ cc_library( + + cc_library( + name = "DebugInfo", +- hdrs = glob(["include/llvm/DebugInfo/*.h"]), ++ hdrs = glob(["include/llvm/DebugInfo/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Object", +@@ -409,8 +409,8 @@ cc_library( + srcs = glob([ + "lib/DebugInfo/MSF/*.cpp", + "lib/DebugInfo/MSF/*.h", +- ]), +- hdrs = glob(["include/llvm/DebugInfo/MSF/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/DebugInfo/MSF/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [":Support"], + ) +@@ -420,14 +420,14 @@ cc_library( + srcs = glob([ + "lib/DebugInfo/CodeView/*.cpp", + "lib/DebugInfo/CodeView/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/DebugInfo/CodeView/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + textual_hdrs = glob([ + "include/llvm/DebugInfo/CodeView/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":BinaryFormat", + ":DebugInfoMSF", +@@ -442,11 +442,11 @@ cc_library( + "lib/DebugInfo/PDB/*.h", + "lib/DebugInfo/PDB/Native/*.cpp", + "lib/DebugInfo/PDB/Native/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/DebugInfo/PDB/*.h", + "include/llvm/DebugInfo/PDB/Native/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -463,10 +463,10 @@ cc_library( + name = "Debuginfod", + srcs = glob([ + "lib/Debuginfod/*.cpp", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Debuginfod/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Support", +@@ -478,12 +478,12 @@ cc_library( + srcs = glob([ + "lib/MC/*.cpp", + "lib/MC/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/MC/*.h", + "include/llvm/MC/*.def", + "include/llvm/MC/*.inc", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -499,8 +499,8 @@ cc_library( + srcs = glob([ + "lib/DebugInfo/DWARF/*.cpp", + "lib/DebugInfo/DWARF/*.h", +- ]), +- hdrs = glob(["include/llvm/DebugInfo/DWARF/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/DebugInfo/DWARF/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -516,8 +516,8 @@ cc_library( + srcs = glob([ + "lib/DebugInfo/Symbolize/*.cpp", + "lib/DebugInfo/Symbolize/*.h", +- ]), +- hdrs = glob(["include/llvm/DebugInfo/Symbolize/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/DebugInfo/Symbolize/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -553,7 +553,7 @@ cc_library( + hdrs = glob([ + "utils/TableGen/*.h", + "utils/TableGen/GlobalISel/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + features = ["-header_modules"], + strip_include_prefix = "utils/TableGen", +@@ -581,7 +581,7 @@ gentbl( + td_srcs = glob([ + "include/llvm/CodeGen/*.td", + "include/llvm/IR/Intrinsics*.td", +- ]), ++ ], allow_empty = True), + ) + + gentbl( +@@ -592,7 +592,7 @@ gentbl( + td_srcs = glob([ + "include/llvm/CodeGen/*.td", + "include/llvm/IR/Intrinsics*.td", +- ]), ++ ], allow_empty = True), + ) + + # Note that the intrinsics are not currently set up so they can be pruned for +@@ -672,7 +672,7 @@ llvm_target_intrinsics_list = [ + td_srcs = glob([ + "include/llvm/CodeGen/*.td", + "include/llvm/IR/*.td", +- ]), ++ ], allow_empty = True), + ), + ] for target in llvm_target_intrinsics_list] + +@@ -692,7 +692,7 @@ cc_library( + srcs = glob([ + "lib/Bitstream/Reader/*.cpp", + "lib/Bitstream/Reader/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/llvm/Bitstream/BitCodes.h", + "include/llvm/Bitstream/BitstreamReader.h", +@@ -707,7 +707,7 @@ cc_library( + name = "BitstreamWriter", + srcs = glob([ + "lib/Bitstream/Writer/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/llvm/Bitstream/BitCodes.h", + "include/llvm/Bitstream/BitstreamWriter.h", +@@ -726,13 +726,13 @@ cc_library( + "lib/Remarks/*.h", + ], + exclude = ["lib/Remarks/RemarkLinker.cpp"], +- ), ++ allow_empty = True), + hdrs = glob( + [ + "include/llvm/Remarks/*.h", + ], + exclude = ["include/llvm/Remarks/RemarkLinker.h"], +- ) + [ ++ allow_empty = True) + [ + "include/llvm-c/Remarks.h", + ], + copts = llvm_copts, +@@ -767,7 +767,7 @@ cc_library( + srcs = glob([ + "lib/IR/*.cpp", + "lib/IR/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob( + [ + "include/llvm/*.h", +@@ -776,12 +776,12 @@ cc_library( + exclude = [ + "include/llvm/LinkAllPasses.h", + ], +- ) + [ ++ allow_empty = True) + [ + "include/llvm-c/Comdat.h", + "include/llvm-c/DebugInfo.h", + ] + [":llvm_intrinsics_headers"], + copts = llvm_copts, +- textual_hdrs = glob(["include/llvm/IR/*.def"]), ++ textual_hdrs = glob(["include/llvm/IR/*.def"], allow_empty = True), + deps = [ + ":BinaryFormat", + ":Remarks", +@@ -798,7 +798,7 @@ cc_library( + srcs = glob([ + "lib/Bitcode/Reader/*.cpp", + "lib/Bitcode/Reader/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/llvm-c/BitReader.h", + "include/llvm/Bitcode/BitcodeAnalyzer.h", +@@ -820,8 +820,8 @@ cc_library( + srcs = glob([ + "lib/MC/MCParser/*.cpp", + "lib/MC/MCParser/*.h", +- ]), +- hdrs = glob(["include/llvm/MC/MCParser/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/MC/MCParser/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -835,12 +835,12 @@ cc_library( + name = "TextAPI", + srcs = glob([ + "lib/TextAPI/**/*.cpp", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/TextAPI/**/*.h", + "include/llvm/TextAPI/**/*.def", + "lib/TextAPI/**/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -853,10 +853,10 @@ cc_library( + srcs = glob([ + "lib/Object/*.cpp", + "lib/Object/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Object/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Object.h", + ], + copts = llvm_copts, +@@ -877,8 +877,8 @@ cc_library( + srcs = glob([ + "lib/ObjectYAML/*.cpp", + "lib/ObjectYAML/*.h", +- ]), +- hdrs = glob(["include/llvm/ObjectYAML/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/ObjectYAML/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -893,11 +893,11 @@ cc_library( + srcs = glob([ + "lib/ProfileData/*.cpp", + "lib/ProfileData/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/ProfileData/*.h", + "include/llvm/ProfileData/*.inc", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Core", +@@ -912,8 +912,8 @@ cc_library( + srcs = glob([ + "lib/ProfileData/Coverage/*.cpp", + "lib/ProfileData/Coverage/*.h", +- ]), +- hdrs = glob(["include/llvm/ProfileData/Coverage/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/ProfileData/Coverage/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Object", +@@ -930,20 +930,20 @@ cc_library( + "lib/Analysis/*.h", + "lib/Analysis/*.def", + ], +- ), ++ allow_empty = True), + hdrs = glob( + [ + "include/llvm/Analysis/*.h", + "include/llvm/Analysis/Utils/*.h", + ], +- ) + [ ++ allow_empty = True) + [ + "include/llvm-c/Analysis.h", + "include/llvm-c/Initialization.h", + ], + copts = llvm_copts, + textual_hdrs = glob([ + "include/llvm/Analysis/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":BinaryFormat", + ":Core", +@@ -959,7 +959,7 @@ cc_library( + srcs = glob([ + "lib/Bitcode/Writer/*.cpp", + "lib/Bitcode/Writer/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/llvm-c/BitWriter.h", + "include/llvm/Bitcode/BitcodeCommon.h", +@@ -984,10 +984,10 @@ cc_library( + srcs = glob([ + "lib/Target/*.cpp", + "lib/Target/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Target/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Target.h", + "include/llvm-c/TargetMachine.h", + ], +@@ -1007,8 +1007,8 @@ cc_library( + srcs = glob([ + "lib/DWP/*.cpp", + "lib/DWP/*.h", +- ]), +- hdrs = glob(["include/llvm/DWP/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/DWP/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":DebugInfoDWARF", +@@ -1024,8 +1024,8 @@ cc_library( + srcs = glob([ + "lib/Transforms/Utils/*.cpp", + "lib/Transforms/Utils/*.h", +- ]), +- hdrs = glob(["include/llvm/Transforms/Utils/*.h"]) + [ ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Transforms/Utils/*.h"], allow_empty = True) + [ + "include/llvm/Transforms/Utils.h", + "include/llvm-c/Transforms/Utils.h", + ], +@@ -1053,7 +1053,7 @@ gentbl( + td_srcs = glob([ + "include/llvm/CodeGen/*.td", + "include/llvm/IR/Intrinsics*.td", +- ]) + [ ++ ], allow_empty = True) + [ + "lib/Target/AMDGPU/InstCombineTables.td", + "include/llvm/TableGen/SearchableTable.td", + ], +@@ -1064,8 +1064,8 @@ cc_library( + srcs = glob([ + "lib/Transforms/InstCombine/*.cpp", + "lib/Transforms/InstCombine/*.h", +- ]), +- hdrs = glob(["include/llvm/Transforms/InstCombine/*.h"]) + [ ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Transforms/InstCombine/*.h"], allow_empty = True) + [ + "include/llvm-c/Transforms/InstCombine.h", + ], + copts = llvm_copts, +@@ -1085,7 +1085,7 @@ cc_library( + srcs = glob([ + "lib/Transforms/AggressiveInstCombine/*.cpp", + "lib/Transforms/AggressiveInstCombine/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/llvm-c/Transforms/AggressiveInstCombine.h", + "include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h", +@@ -1105,8 +1105,8 @@ cc_library( + "lib/Transforms/Instrumentation/*.cpp", + "lib/Transforms/Instrumentation/*.h", + "lib/Transforms/Instrumentation/*.inc", +- ]), +- hdrs = glob(["include/llvm/Transforms/Instrumentation/*.h"]) + [ ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Transforms/Instrumentation/*.h"], allow_empty = True) + [ + "include/llvm/Transforms/Instrumentation.h", + ], + copts = llvm_copts, +@@ -1127,7 +1127,7 @@ cc_library( + srcs = glob([ + "lib/Transforms/ObjCARC/*.cpp", + "lib/Transforms/ObjCARC/*.h", +- ]), ++ ], allow_empty = True), + hdrs = ["include/llvm/Transforms/ObjCARC.h"], + copts = llvm_copts, + deps = [ +@@ -1145,8 +1145,8 @@ cc_library( + srcs = glob([ + "lib/Transforms/Scalar/*.cpp", + "lib/Transforms/Scalar/*.h", +- ]), +- hdrs = glob(["include/llvm/Transforms/Scalar/*.h"]) + [ ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Transforms/Scalar/*.h"], allow_empty = True) + [ + "include/llvm-c/Transforms/Scalar.h", + "include/llvm/Transforms/Scalar.h", + ], +@@ -1169,10 +1169,10 @@ cc_library( + srcs = glob([ + "lib/Transforms/Vectorize/*.cpp", + "lib/Transforms/Vectorize/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Transforms/Vectorize/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Transforms/Vectorize.h", + "include/llvm/Transforms/Vectorize.h", + ], +@@ -1192,7 +1192,7 @@ filegroup( + srcs = glob([ + "include/llvm/Frontend/OpenMP/*.td", + "include/llvm/Frontend/Directive/*.td", +- ]), ++ ], allow_empty = True), + ) + + gentbl( +@@ -1221,19 +1221,19 @@ cc_library( + name = "FrontendOpenMP", + srcs = glob([ + "lib/Frontend/OpenMP/*.cpp", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Frontend/OpenMP/*.h", + "include/llvm/Frontend/OpenMP/OMP/*.h", + "include/llvm/Frontend/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm/Frontend/OpenMP/OMP.h.inc", + "include/llvm/Frontend/OpenMP/OMP.inc", + ], + copts = llvm_copts, + textual_hdrs = glob([ + "include/llvm/Frontend/OpenMP/*.def", +- ]), ++ ], allow_empty = True), + deps = [ + ":Analysis", + ":Core", +@@ -1248,7 +1248,7 @@ filegroup( + srcs = glob([ + "include/llvm/Frontend/OpenACC/*.td", + "include/llvm/Frontend/Directive/*.td", +- ]), ++ ], allow_empty = True), + ) + + gentbl( +@@ -1277,12 +1277,12 @@ cc_library( + name = "FrontendOpenACC", + srcs = glob([ + "lib/Frontend/OpenACC/*.cpp", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm/Frontend/OpenACC/ACC.inc", + ], + hdrs = glob([ + "include/llvm/Frontend/OpenACC/*.h", +- ]) + ["include/llvm/Frontend/OpenACC/ACC.h.inc"], ++ ], allow_empty = True) + ["include/llvm/Frontend/OpenACC/ACC.h.inc"], + copts = llvm_copts, + deps = [ + ":Analysis", +@@ -1297,8 +1297,8 @@ cc_library( + srcs = glob([ + "lib/AsmParser/*.cpp", + "lib/AsmParser/*.h", +- ]), +- hdrs = glob(["include/llvm/AsmParser/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/AsmParser/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -1312,10 +1312,10 @@ cc_library( + srcs = glob([ + "lib/IRReader/*.cpp", + "lib/IRReader/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/IRReader/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/IRReader.h", + ], + copts = llvm_copts, +@@ -1333,10 +1333,10 @@ cc_library( + srcs = glob([ + "lib/Linker/*.cpp", + "lib/Linker/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Linker/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Linker.h", + ], + copts = llvm_copts, +@@ -1353,10 +1353,10 @@ cc_library( + srcs = glob([ + "lib/Transforms/IPO/*.cpp", + "lib/Transforms/IPO/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Transforms/IPO/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Transforms/IPO.h", + "include/llvm-c/Transforms/PassManagerBuilder.h", + "include/llvm/Transforms/IPO.h", +@@ -1391,7 +1391,7 @@ cc_library( + srcs = glob([ + "lib/Transforms/CFGuard/*.cpp", + "lib/Transforms/CFGuard/*.h", +- ]), ++ ], allow_empty = True), + hdrs = ["include/llvm/Transforms/CFGuard.h"], + copts = llvm_copts, + deps = [ +@@ -1405,7 +1405,7 @@ cc_library( + srcs = glob([ + "lib/Transforms/Coroutines/*.cpp", + "lib/Transforms/Coroutines/*.h", +- ]), ++ ], allow_empty = True), + hdrs = [ + "include/llvm-c/Transforms/Coroutines.h", + "include/llvm/Transforms/Coroutines.h", +@@ -1445,7 +1445,7 @@ cc_library( + cc_library( + name = "asm_printer_defs", + copts = llvm_copts, +- textual_hdrs = glob(["lib/CodeGen/AsmPrinter/*.def"]), ++ textual_hdrs = glob(["lib/CodeGen/AsmPrinter/*.def"], allow_empty = True), + ) + + cc_library( +@@ -1457,19 +1457,19 @@ cc_library( + "lib/CodeGen/SelectionDAG/*.cpp", + "lib/CodeGen/SelectionDAG/*.h", + ], +- ), ++ allow_empty = True), + hdrs = [ + "include/llvm/LinkAllPasses.h", + ] + glob( + [ + "include/llvm/CodeGen/**/*.h", + ], +- ), ++ allow_empty = True), + copts = llvm_copts, + textual_hdrs = glob([ + "include/llvm/CodeGen/**/*.def", + "include/llvm/CodeGen/**/*.inc", +- ]), ++ ], allow_empty = True), + deps = [ + ":Analysis", + ":AsmParser", +@@ -1498,10 +1498,10 @@ cc_library( + srcs = glob([ + "lib/MC/MCDisassembler/*.cpp", + "lib/MC/MCDisassembler/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/MC/MCDisassembler/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/Disassembler.h", + ], + copts = llvm_copts, +@@ -1818,7 +1818,7 @@ filegroup( + "include/llvm/TableGen/*.td", + "include/llvm/Target/*.td", + "include/llvm/Target/GlobalISel/*.td", +- ]), ++ ], allow_empty = True), + ) + + gentbl( +@@ -1836,7 +1836,7 @@ gentbl( + ":common_target_td_sources", + ] + glob([ + "lib/Target/AMDGPU/*.td", +- ]), ++ ], allow_empty = True), + ) + + gentbl( +@@ -1858,7 +1858,7 @@ gentbl( + ":common_target_td_sources", + ] + glob([ + "lib/Target/AMDGPU/*.td", +- ]), ++ ], allow_empty = True), + ) + + [[ +@@ -1880,7 +1880,7 @@ gentbl( + ] + glob([ + "lib/Target/" + target["name"] + "/*.td", + "lib/Target/" + target["name"] + "/GISel/*.td", +- ]), ++ ], allow_empty = True), + deps = target.get("tbl_deps", []), + )], + [cc_library( +@@ -1914,7 +1914,7 @@ gentbl( + # library. This mixture is likely incompatible with header modules. + "lib/Target/" + target["name"] + "/MCTargetDesc/*.h", + "lib/Target/" + target["name"] + "/Utils/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "lib/Target/" + target["name"] + "/MCTargetDesc/*.h", + "lib/Target/" + target["name"] + "/Utils/*.h", +@@ -1938,7 +1938,7 @@ gentbl( + # distinction between these two. + "lib/Target/" + target["name"] + "/*.def", + "lib/Target/" + target["name"] + "/*.inc", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + features = [ + "-parse_headers", +@@ -1967,14 +1967,14 @@ gentbl( + "lib/Target/" + target["name"] + "/GISel/*.h", + "lib/Target/" + target["name"] + "/*.cpp", + "lib/Target/" + target["name"] + "/*.h", +- ]), ++ ], allow_empty = True), + hdrs = ["lib/Target/" + target["name"] + "/" + target["short_name"] + ".h"], + copts = llvm_copts, + strip_include_prefix = "lib/Target/" + target["name"], + textual_hdrs = glob([ + "lib/Target/" + target["name"] + "/*.def", + "lib/Target/" + target["name"] + "/*.inc", +- ]), ++ ], allow_empty = True), + deps = [ + ":Analysis", + ":BinaryFormat", +@@ -2001,7 +2001,7 @@ gentbl( + srcs = glob([ + "lib/Target/" + target["name"] + "/AsmParser/*.cpp", + "lib/Target/" + target["name"] + "/AsmParser/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -2031,7 +2031,7 @@ gentbl( + # distinction between these two. + hdrs = glob([ + "lib/Target/" + target["name"] + "/Disassembler/*.h", +- ]), ++ ], allow_empty = True), + features = [ + "-parse_headers", + "-header_modules", +@@ -2044,7 +2044,7 @@ gentbl( + "lib/Target/" + target["name"] + "/Disassembler/*.cpp", + "lib/Target/" + target["name"] + "/Disassembler/*.c", + "lib/Target/" + target["name"] + "/Disassembler/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":CodeGen", +@@ -2065,7 +2065,7 @@ gentbl( + "lib/Target/" + target["name"] + "/MCA/*.cpp", + "lib/Target/" + target["name"] + "/MCA/*.c", + "lib/Target/" + target["name"] + "/MCA/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":MC", +@@ -2126,10 +2126,10 @@ cc_library( + srcs = glob([ + "lib/Analysis/ML/*.cpp", + "lib/Analysis/ML/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Analysis/ML/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Analysis", +@@ -2143,8 +2143,8 @@ cc_library( + srcs = glob([ + "lib/Passes/*.cpp", + "lib/Passes/*.h", +- ]), +- hdrs = glob(["include/llvm/Passes/*.h"]) + ["include/llvm-c/Transforms/PassBuilder.h"], ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/Passes/*.h"], allow_empty = True) + ["include/llvm-c/Transforms/PassBuilder.h"], + copts = llvm_copts, + deps = [ + ":Analysis", +@@ -2166,11 +2166,11 @@ cc_library( + srcs = glob([ + "lib/LTO/*.cpp", + "lib/LTO/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/LTO/*.h", + "include/llvm/LTO/legacy/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/lto.h", + ], + copts = llvm_copts, +@@ -2203,7 +2203,7 @@ cc_library( + "lib/ExecutionEngine/RuntimeDyld/*.h", + "lib/ExecutionEngine/RuntimeDyld/Targets/*.cpp", + "lib/ExecutionEngine/RuntimeDyld/Targets/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob( + [ + "include/llvm/ExecutionEngine/*.h", +@@ -2212,7 +2212,7 @@ cc_library( + "include/llvm/ExecutionEngine/MCJIT*.h", + "include/llvm/ExecutionEngine/OProfileWrapper.h", + ], +- ) + [ ++ allow_empty = True) + [ + "include/llvm-c/ExecutionEngine.h", + ], + copts = llvm_copts, +@@ -2237,7 +2237,7 @@ cc_library( + srcs = glob([ + "lib/ExecutionEngine/Interpreter/*.cpp", + "lib/ExecutionEngine/Interpreter/*.h", +- ]), ++ ], allow_empty = True), + hdrs = ["include/llvm/ExecutionEngine/Interpreter.h"], + copts = llvm_copts, + deps = [ +@@ -2255,10 +2255,10 @@ cc_library( + srcs = glob([ + "lib/ExecutionEngine/JITLink/*.cpp", + "lib/ExecutionEngine/JITLink/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/ExecutionEngine/JITLink/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":ExecutionEngine", +@@ -2274,8 +2274,8 @@ cc_library( + srcs = glob([ + "lib/ExecutionEngine/MCJIT/*.cpp", + "lib/ExecutionEngine/MCJIT/*.h", +- ]), +- hdrs = glob(["include/llvm/ExecutionEngine/MCJIT*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/ExecutionEngine/MCJIT*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":CodeGen", +@@ -2294,11 +2294,11 @@ cc_library( + srcs = glob([ + "lib/ExecutionEngine/Orc/*.cpp", + "lib/ExecutionEngine/Orc/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/ExecutionEngine/Orc/*.h", + "include/llvm/ExecutionEngine/Orc/RPC/*.h", +- ]) + [ ++ ], allow_empty = True) + [ + "include/llvm-c/LLJIT.h", + "include/llvm-c/Orc.h", + "include/llvm-c/OrcEE.h", +@@ -2325,10 +2325,10 @@ cc_library( + name = "OrcShared", + srcs = glob([ + "lib/ExecutionEngine/Orc/Shared/*.cpp", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/ExecutionEngine/Orc/Shared/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -2350,10 +2350,10 @@ cc_library( + srcs = glob([ + "lib/ExecutionEngine/Orc/TargetProcess/*.cpp", + "lib/ExecutionEngine/Orc/TargetProcess/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/ExecutionEngine/Orc/TargetProcess/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":BinaryFormat", +@@ -2376,8 +2376,8 @@ cc_library( + srcs = glob([ + "lib/DWARFLinker/*.cpp", + "lib/DWARFLinker/*.h", +- ]), +- hdrs = glob(["include/llvm/DWARFLinker/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/DWARFLinker/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":CodeGen", +@@ -2442,10 +2442,10 @@ cc_library( + srcs = glob([ + "lib/InterfaceStub/*.cpp", + "lib/InterfaceStub/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/InterfaceStub/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Object", +@@ -2458,10 +2458,10 @@ cc_library( + name = "WindowsManifest", + srcs = glob([ + "lib/WindowsManifest/*.cpp", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/WindowsManifest/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + linkopts = [ + # Libxml2 is required to process Windows manifests. Without this, +@@ -2499,10 +2499,10 @@ cc_library( + srcs = glob([ + "lib/MCA/**/*.cpp", + "lib/MCA/**/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/MCA/**/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":MC", +@@ -2526,8 +2526,8 @@ cc_library( + srcs = glob([ + "lib/XRay/*.cpp", + "lib/XRay/*.h", +- ]), +- hdrs = glob(["include/llvm/XRay/*.h"]), ++ ], allow_empty = True), ++ hdrs = glob(["include/llvm/XRay/*.h"], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Object", +@@ -2594,7 +2594,7 @@ cc_binary( + srcs = glob([ + "tools/dsymutil/*.cpp", + "tools/dsymutil/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2620,7 +2620,7 @@ cc_binary( + srcs = glob([ + "tools/llc/*.cpp", + "tools/llc/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2644,7 +2644,7 @@ cc_binary( + srcs = glob([ + "tools/lli/*.cpp", + "tools/lli/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + # ll scripts rely on symbols from dependent + # libraries being resolvable. +@@ -2689,7 +2689,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-ar/*.cpp", + "tools/llvm-ar/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2725,7 +2725,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-as/*.cpp", + "tools/llvm-as/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2742,7 +2742,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-bcanalyzer/*.cpp", + "tools/llvm-bcanalyzer/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2755,7 +2755,7 @@ cc_binary( + name = "llvm-cat", + srcs = glob([ + "tools/llvm-cat/*.cpp", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2773,7 +2773,7 @@ cc_binary( + "tools/llvm-cfi-verify/*.cpp", + "tools/llvm-cfi-verify/lib/*.cpp", + "tools/llvm-cfi-verify/lib/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2796,7 +2796,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-cov/*.cpp", + "tools/llvm-cov/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2825,7 +2825,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-cvtres/*.cpp", + "tools/llvm-cvtres/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2841,7 +2841,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-cxxdump/*.cpp", + "tools/llvm-cxxdump/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2857,7 +2857,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-cxxmap/*.cpp", + "tools/llvm-cxxmap/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2882,7 +2882,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-cxxfilt/*.cpp", + "tools/llvm-cxxfilt/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2898,7 +2898,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-dis/*.cpp", + "tools/llvm-dis/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2914,7 +2914,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-dwarfdump/*.cpp", + "tools/llvm-dwarfdump/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2933,7 +2933,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-dwp/*.cpp", + "tools/llvm-dwp/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2974,7 +2974,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-extract/*.cpp", + "tools/llvm-extract/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -2993,7 +2993,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-ifs/*.cpp", + "tools/llvm-ifs/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3009,7 +3009,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-jitlink/*.cpp", + "tools/llvm-jitlink/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + # Make symbols from the standard library dynamically resolvable. + linkopts = select({ +@@ -3048,7 +3048,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-libtool-darwin/*.cpp", + "tools/llvm-libtool-darwin/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3063,7 +3063,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-link/*.cpp", + "tools/llvm-link/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3112,7 +3112,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-lto/*.cpp", + "tools/llvm-lto/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3134,7 +3134,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-lto2/*.cpp", + "tools/llvm-lto2/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3153,7 +3153,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-mc/*.cpp", + "tools/llvm-mc/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3175,7 +3175,7 @@ cc_binary( + "tools/llvm-mca/*.h", + "tools/llvm-mca/Views/*.cpp", + "tools/llvm-mca/Views/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3208,7 +3208,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-ml/*.cpp", + "tools/llvm-ml/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3227,7 +3227,7 @@ cc_binary( + name = "llvm-modextract", + srcs = glob([ + "tools/llvm-modextract/*.cpp", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3255,7 +3255,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-mt/*.cpp", + "tools/llvm-mt/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + tags = [ +@@ -3287,7 +3287,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-nm/*.cpp", + "tools/llvm-nm/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3369,7 +3369,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-stress/*.cpp", + "tools/llvm-stress/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3425,7 +3425,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-objdump/*.cpp", + "tools/llvm-objdump/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3482,7 +3482,7 @@ cc_binary( + name = "llvm-opt-report", + srcs = glob([ + "tools/llvm-opt-report/*.cpp", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3498,7 +3498,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-pdbutil/*.cpp", + "tools/llvm-pdbutil/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3518,7 +3518,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-profdata/*.cpp", + "tools/llvm-profdata/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3533,7 +3533,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-profgen/*.cpp", + "tools/llvm-profgen/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3578,7 +3578,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-rc/*.cpp", + "tools/llvm-rc/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3613,7 +3613,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-readobj/*.cpp", + "tools/llvm-readobj/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3641,7 +3641,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-reduce/**/*.cpp", + "tools/llvm-reduce/**/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + includes = ["tools/llvm-reduce"], + stamp = 0, +@@ -3658,7 +3658,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-rtdyld/*.cpp", + "tools/llvm-rtdyld/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3691,7 +3691,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-size/*.cpp", + "tools/llvm-size/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3707,7 +3707,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-split/*.cpp", + "tools/llvm-split/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3736,7 +3736,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-strings/*.cpp", + "tools/llvm-strings/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3764,7 +3764,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-symbolizer/*.cpp", + "tools/llvm-symbolizer/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3789,7 +3789,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-undname/*.cpp", + "tools/llvm-undname/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3804,7 +3804,7 @@ cc_binary( + "tools/llvm-xray/*.cpp", + "tools/llvm-xray/*.cc", + "tools/llvm-xray/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3821,7 +3821,7 @@ cc_binary( + srcs = glob([ + "tools/opt/*.cpp", + "tools/opt/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + linkopts = select({ + "@bazel_tools//src/conditions:windows": [], +@@ -3854,7 +3854,7 @@ cc_binary( + srcs = glob([ + "tools/sancov/*.cpp", + "tools/sancov/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3875,7 +3875,7 @@ cc_binary( + srcs = glob([ + "tools/sanstats/*.cpp", + "tools/sanstats/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3890,7 +3890,7 @@ cc_binary( + srcs = glob([ + "tools/split-file/*.cpp", + "tools/split-file/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -3904,8 +3904,8 @@ cc_binary( + cc_library( + name = "FuzzMutate", + testonly = True, +- srcs = glob(["lib/FuzzMutate/*.cpp"]), +- hdrs = glob(["include/llvm/FuzzMutate/*.h"]), ++ srcs = glob(["lib/FuzzMutate/*.cpp"], allow_empty = True), ++ hdrs = glob(["include/llvm/FuzzMutate/*.h"], allow_empty = True), + copts = llvm_copts, + includes = ["include"], + deps = [ +@@ -3921,8 +3921,8 @@ cc_library( + cc_library( + name = "Diff", + testonly = True, +- srcs = glob(["tools/llvm-diff/lib/*.cpp"]), +- hdrs = glob(["tools/llvm-diff/lib/*.h"]), ++ srcs = glob(["tools/llvm-diff/lib/*.cpp"], allow_empty = True), ++ hdrs = glob(["tools/llvm-diff/lib/*.h"], allow_empty = True), + deps = [ + ":Core", + ":Support", +@@ -4023,7 +4023,7 @@ cc_library( + py_binary( + name = "lit", + testonly = True, +- srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"]), ++ srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"], allow_empty = True), + ) + + cc_library( +@@ -4032,10 +4032,10 @@ cc_library( + srcs = glob([ + "lib/Testing/Support/*.cpp", + "lib/Testing/Support/*.h", +- ]), ++ ], allow_empty = True), + hdrs = glob([ + "include/llvm/Testing/Support/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + deps = [ + ":Support", +@@ -4054,7 +4054,7 @@ cc_binary( + srcs = glob([ + "utils/FileCheck/*.cpp", + "utils/FileCheck/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [":FileCheckLib"], +@@ -4065,7 +4065,7 @@ cc_binary( + srcs = glob([ + "tools/bugpoint/*.cpp", + "tools/bugpoint/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -4093,7 +4093,7 @@ cc_binary( + srcs = glob([ + "utils/count/*.c", + "utils/count/*.h", +- ]), ++ ], allow_empty = True), + stamp = 0, + ) + +@@ -4103,7 +4103,7 @@ cc_binary( + srcs = glob([ + "tools/lli/ChildTarget/*.cpp", + "tools/lli/ChildTarget/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + # The tests load code into this binary that expect to see symbols + # from libstdc++ such as __cxa_begin_catch and _ZTIi. The latter +@@ -4164,7 +4164,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-diff/*.cpp", + "tools/llvm-diff/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -4181,7 +4181,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-isel-fuzzer/*.cpp", + "tools/llvm-isel-fuzzer/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -4225,7 +4225,7 @@ cc_binary( + srcs = glob([ + "utils/not/*.cpp", + "utils/not/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [":Support"], +@@ -4287,7 +4287,7 @@ cc_binary( + srcs = glob([ + "tools/llvm-tli-checker/*.cpp", + "tools/llvm-tli-checker/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -4314,7 +4314,7 @@ cc_binary( + srcs = glob([ + "tools/obj2yaml/*.cpp", + "tools/obj2yaml/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -4332,7 +4332,7 @@ cc_binary( + srcs = glob([ + "tools/verify-uselistorder/*.cpp", + "tools/verify-uselistorder/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ +@@ -4351,7 +4351,7 @@ cc_binary( + srcs = glob([ + "tools/yaml2obj/*.cpp", + "tools/yaml2obj/*.h", +- ]), ++ ], allow_empty = True), + copts = llvm_copts, + stamp = 0, + deps = [ diff --git a/bindgen/BUILD.bazel b/bindgen/BUILD.bazel index bb93162cb6..68760394cf 100644 --- a/bindgen/BUILD.bazel +++ b/bindgen/BUILD.bazel @@ -23,21 +23,41 @@ bzl_library( ], ) +alias( + name = "clang_macos", + actual = select({ + "@platforms//cpu:aarch64": "@bindgen_clang_macos_aarch64//:clang", + "//conditions:default": "@bindgen_clang_macos_x86_64//:clang", + }), + tags = ["manual"], +) + +alias( + name = "clang_linux", + actual = select({ + "@platforms//cpu:aarch64": "@bindgen_clang_linux_aarch64//:clang", + "//conditions:default": "@bindgen_clang_linux_x86_64//:clang", + }), + tags = ["manual"], +) + rust_bindgen_toolchain( name = "default_bindgen_toolchain_impl", bindgen = "//bindgen/3rdparty:bindgen", - clang = select({ - "//rust/platform:osx": "@bindgen_clang_osx//:clang", - "//conditions:default": "@bindgen_clang_linux//:clang", - }), - libclang = select({ - "//rust/platform:osx": "@bindgen_clang_osx//:libclang", - "//conditions:default": "@bindgen_clang_linux//:libclang", - }), - libstdcxx = select({ - "//rust/platform:osx": "@bindgen_clang_osx//:libc++", - "//conditions:default": None, - }), + clang = "@llvm-project//clang:clang", + libclang = "@llvm-project//clang:libclang", + # clang = select({ + # "@platforms//os:macos": ":clang_macos", + # "//conditions:default": ":clang_linux", + # }), + # libclang = select({ + # "//rust/platform:osx": "@bindgen_clang_osx//:libclang", + # "//conditions:default": "@bindgen_clang_linux//:libclang", + # }), + # libstdcxx = select({ + # "//rust/platform:osx": "@bindgen_clang_osx//:libc++", + # "//conditions:default": None, + # }), ) toolchain( diff --git a/bindgen/repositories.bzl b/bindgen/repositories.bzl index 3e09d3df6b..7e06e9136e 100644 --- a/bindgen/repositories.bzl +++ b/bindgen/repositories.bzl @@ -22,8 +22,19 @@ load("//bindgen/3rdparty/crates:defs.bzl", "crate_repositories") def rust_bindgen_dependencies(): """Declare dependencies needed for bindgen.""" - # nb. The bindgen rule itself should work on any platform. - _bindgen_clang_repositories() + maybe( + http_archive, + name = "llvm-raw", + urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-project-14.0.6.src.tar.xz"], + strip_prefix = "llvm-project-14.0.6.src", + sha256 = "8b3cfd7bc695bd6cea0f37f53f0981f34f87496e79e2529874fd03a2f9dd3a8a", + build_file_content = "# empty", + patch_args = ["-p1"], + patches = [ + Label("//bindgen/3rdparty/patches:llvm-project.cxx17.patch"), + Label("//bindgen/3rdparty/patches:llvm-project.incompatible_disallow_empty_glob.patch"), + ], + ) crate_repositories() @@ -38,71 +49,3 @@ def rust_bindgen_register_toolchains(register_toolchains = True): """ if register_toolchains: native.register_toolchains(str(Label("//bindgen:default_bindgen_toolchain"))) - -# buildifier: disable=unnamed-macro -def rust_bindgen_repositories(): - """**Deprecated**: Instead use [rust_bindgen_dependencies](#rust_bindgen_dependencies) and [rust_bindgen_register_toolchains](#rust_bindgen_register_toolchains)""" - - rust_bindgen_dependencies() - rust_bindgen_register_toolchains() - -_COMMON_WORKSPACE = """\ -workspace(name = "{}") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.1/rules_cc-0.0.1.tar.gz"], - sha256 = "4dccbfd22c0def164c8f47458bd50e0c7148f3d92002cdb459c2a96a68498241", -) -""" - -_CLANG_BUILD_FILE = """\ -load("@rules_cc//cc:defs.bzl", "cc_import") - -package(default_visibility = ["//visibility:public"]) - -sh_binary( - name = "clang", - srcs = ["bin/clang"], -) - -cc_import( - name = "libclang", - shared_library = "lib/libclang.{suffix}", -) - -alias( - name = "libclang.so", - actual = ":libclang", - deprecation = "Use :libclang instead", -) - -cc_import( - name = "libc++", - shared_library = "lib/libc++.{suffix}" -) -""" - -def _bindgen_clang_repositories(): - # Releases @ http://releases.llvm.org/download.html - maybe( - http_archive, - name = "bindgen_clang_linux", - urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz"], - strip_prefix = "clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04", - sha256 = "b25f592a0c00686f03e3b7db68ca6dc87418f681f4ead4df4745a01d9be63843", - build_file_content = _CLANG_BUILD_FILE.format(suffix = "so"), - workspace_file_content = _COMMON_WORKSPACE.format("bindgen_clang_linux"), - ) - - maybe( - http_archive, - name = "bindgen_clang_osx", - urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz"], - strip_prefix = "clang+llvm-10.0.0-x86_64-apple-darwin", - sha256 = "633a833396bf2276094c126b072d52b59aca6249e7ce8eae14c728016edb5e61", - build_file_content = _CLANG_BUILD_FILE.format(suffix = "dylib"), - workspace_file_content = _COMMON_WORKSPACE.format("bindgen_clang_osx"), - ) diff --git a/bindgen/transitive_repositories.bzl b/bindgen/transitive_repositories.bzl new file mode 100644 index 0000000000..66c80ee5fc --- /dev/null +++ b/bindgen/transitive_repositories.bzl @@ -0,0 +1,21 @@ +"""Transitive dependencies for the Rust `bindgen` rules""" + +load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps") + +# buildifier: disable=unnamed-macro +def rust_bindgen_transitive_dependencies(): + """Declare transitive dependencies needed for bindgen.""" + + llvm_configure( + name = "llvm-project", + repo_mapping = {"@llvm_zlib": "@zlib"}, + targets = [ + "AArch64", + "X86", + ], + ) + + # Disables optional dependencies for Support like zlib and terminfo. You may + # instead want to configure them using the macros in the corresponding bzl + # files. + llvm_disable_optional_support_deps() diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 47ed38c5df..6c55c0c91b 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -81,10 +81,10 @@ PAGES = dict([ header_template = ":rust_bindgen.vm", symbols = [ "rust_bindgen_library", + "rust_bindgen", + "rust_bindgen_toolchain", "rust_bindgen_dependencies", "rust_bindgen_register_toolchains", - "rust_bindgen_toolchain", - "rust_bindgen", ], ), page( diff --git a/docs/rust_bindgen.md b/docs/rust_bindgen.md index bd8d0c3f23..a217a1a51e 100644 --- a/docs/rust_bindgen.md +++ b/docs/rust_bindgen.md @@ -2,10 +2,10 @@ # Rust Bindgen * [rust_bindgen_library](#rust_bindgen_library) +* [rust_bindgen](#rust_bindgen) +* [rust_bindgen_toolchain](#rust_bindgen_toolchain) * [rust_bindgen_dependencies](#rust_bindgen_dependencies) * [rust_bindgen_register_toolchains](#rust_bindgen_register_toolchains) -* [rust_bindgen_toolchain](#rust_bindgen_toolchain) -* [rust_bindgen](#rust_bindgen) ## Overview @@ -28,6 +28,10 @@ load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_dependencies", "rust rust_bindgen_dependencies() rust_bindgen_register_toolchains() + +load("@rules_rust//bindgen:transitive_repositories.bzl", "rust_bindgen_transitive_dependencies") + +rust_bindgen_transitive_dependencies() ``` --- diff --git a/docs/rust_bindgen.vm b/docs/rust_bindgen.vm index faffca38e5..3fc1dc7945 100644 --- a/docs/rust_bindgen.vm +++ b/docs/rust_bindgen.vm @@ -19,6 +19,10 @@ load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_dependencies", "rust rust_bindgen_dependencies() rust_bindgen_register_toolchains() + +load("@rules_rust//bindgen:transitive_repositories.bzl", "rust_bindgen_transitive_dependencies") + +rust_bindgen_transitive_dependencies() ``` --- diff --git a/docs/symbols.bzl b/docs/symbols.bzl index 6d5a7baeae..c5aa922683 100644 --- a/docs/symbols.bzl +++ b/docs/symbols.bzl @@ -12,7 +12,6 @@ load( "@rules_rust//bindgen:repositories.bzl", _rust_bindgen_dependencies = "rust_bindgen_dependencies", _rust_bindgen_register_toolchains = "rust_bindgen_register_toolchains", - _rust_bindgen_repositories = "rust_bindgen_repositories", ) load( "@rules_rust//cargo:defs.bzl", @@ -128,7 +127,6 @@ rust_bindgen = _rust_bindgen rust_bindgen_dependencies = _rust_bindgen_dependencies rust_bindgen_library = _rust_bindgen_library rust_bindgen_register_toolchains = _rust_bindgen_register_toolchains -rust_bindgen_repositories = _rust_bindgen_repositories rust_bindgen_toolchain = _rust_bindgen_toolchain rust_toolchain = _rust_toolchain diff --git a/examples/WORKSPACE.bazel b/examples/WORKSPACE.bazel index 27b8c48925..8607259572 100644 --- a/examples/WORKSPACE.bazel +++ b/examples/WORKSPACE.bazel @@ -30,6 +30,10 @@ rust_bindgen_dependencies() rust_bindgen_register_toolchains() +load("@rules_rust//bindgen:transitive_repositories.bzl", "rust_bindgen_transitive_dependencies") + +rust_bindgen_transitive_dependencies() + load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories") rust_proto_repositories()