1load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 2load("//bindgen:repositories.bzl", "BINDGEN_VERSION") 3load("//crate_universe:defs.bzl", "crate", "crates_vendor") 4 5_BINDGEN_CLI_PACKAGES = { 6 "clap": crate.spec( 7 version = "4.3.3", 8 ), 9 "clap_complete": crate.spec( 10 version = "4.3.1", 11 ), 12 "env_logger": crate.spec( 13 version = "0.10.0", 14 ), 15} 16 17crates_vendor( 18 name = "crates_vendor", 19 annotations = { 20 "bindgen": [crate.annotation( 21 gen_build_script = True, 22 )], 23 "clang-sys": [crate.annotation( 24 gen_build_script = True, 25 )], 26 "libc": [crate.annotation( 27 gen_build_script = True, 28 )], 29 "rustix": [crate.annotation( 30 gen_build_script = True, 31 )], 32 "winapi": [crate.annotation( 33 gen_build_script = True, 34 )], 35 }, 36 cargo_lockfile = "Cargo.Bazel.lock", 37 generate_build_scripts = False, 38 mode = "remote", 39 packages = dict({ 40 "bindgen": crate.spec( 41 default_features = False, 42 features = ["runtime"], 43 version = BINDGEN_VERSION, 44 ), 45 "bindgen-cli": crate.spec( 46 default_features = False, 47 features = ["runtime"], 48 version = BINDGEN_VERSION, 49 ), 50 "clang-sys": crate.spec( 51 # Should match the version of llvm-project being used. 52 features = ["clang_14_0"], 53 version = "1.6.1", 54 ), 55 }.items() + _BINDGEN_CLI_PACKAGES.items()), 56 repository_name = "rules_rust_bindgen", 57 tags = ["manual"], 58) 59 60alias( 61 name = "bindgen", 62 actual = "@rules_rust_bindgen__bindgen-cli-{}//:bindgen-cli".format(BINDGEN_VERSION), 63 tags = ["manual"], 64 visibility = ["//visibility:public"], 65) 66 67bzl_library( 68 name = "bzl_lib", 69 srcs = [ 70 "//bindgen/3rdparty/crates:crates.bzl", 71 "//bindgen/3rdparty/crates:defs.bzl", 72 ], 73 visibility = ["//bindgen:__pkg__"], 74) 75