From dfdc95261e88f2a7b77cd19cb6c88b2cd962588e Mon Sep 17 00:00:00 2001 From: Chris Frantz Date: Thu, 13 Jun 2024 21:27:19 -0700 Subject: [PATCH] [rust] Add libloading crate Signed-off-by: Chris Frantz (cherry picked from commit 60f22c7c7a650d7438997c73a50b234549e36dcb) --- third_party/rust/Cargo.lock | 15 +- third_party/rust/Cargo.toml | 1 + third_party/rust/crates/BUILD.bazel | 6 + .../rust/crates/BUILD.libloading-0.8.3.bazel | 151 ++++++++++++++++++ third_party/rust/crates/defs.bzl | 11 ++ 5 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 third_party/rust/crates/BUILD.libloading-0.8.3.bazel diff --git a/third_party/rust/Cargo.lock b/third_party/rust/Cargo.lock index 5a8bf7a8ab903..9f557b3a8d654 100644 --- a/third_party/rust/Cargo.lock +++ b/third_party/rust/Cargo.lock @@ -308,6 +308,7 @@ dependencies = [ "indicatif", "indoc", "itertools", + "libloading 0.8.3", "log", "mdbook", "memchr", @@ -557,7 +558,7 @@ checksum = "95d9fb68c88020896fa3741a10e41f206b2ace927724170a753a3f2ba5f77c2b" dependencies = [ "bitflags 1.3.2", "cryptoki-sys", - "libloading", + "libloading 0.7.4", "log", "paste", "secrecy", @@ -569,7 +570,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bc9943e09928a84ed6e76dbaea1699b7678e95b2487b0de31075af300221095" dependencies = [ - "libloading", + "libloading 0.7.4", "target-lexicon", ] @@ -1209,6 +1210,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.48.5", +] + [[package]] name = "libm" version = "0.2.8" diff --git a/third_party/rust/Cargo.toml b/third_party/rust/Cargo.toml index 06213f4fcbc57..30dec79753680 100644 --- a/third_party/rust/Cargo.toml +++ b/third_party/rust/Cargo.toml @@ -89,6 +89,7 @@ cryptoki-sys = "0.1.6" indexmap = { version = "2.0", features = ["serde"] } secrecy = "0.8" strum = { version = "0.25", features = ["derive"] } +libloading = "0.8" # We'd like to reference serde_annotate by its Git repo, but we also need to # support airgapped builds and bazel does not support git repo references diff --git a/third_party/rust/crates/BUILD.bazel b/third_party/rust/crates/BUILD.bazel index d38a8e8f2ec66..77040f5def0d3 100644 --- a/third_party/rust/crates/BUILD.bazel +++ b/third_party/rust/crates/BUILD.bazel @@ -229,6 +229,12 @@ alias( tags = ["manual"], ) +alias( + name = "libloading", + actual = "@crate_index__libloading-0.8.3//:libloading", + tags = ["manual"], +) + alias( name = "log", actual = "@crate_index__log-0.4.20//:log", diff --git a/third_party/rust/crates/BUILD.libloading-0.8.3.bazel b/third_party/rust/crates/BUILD.libloading-0.8.3.bazel new file mode 100644 index 0000000000000..931f4134abb93 --- /dev/null +++ b/third_party/rust/crates/BUILD.libloading-0.8.3.bazel @@ -0,0 +1,151 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//third_party/rust:crate_index +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +# licenses([ +# "TODO", # ISC +# ]) + +rust_library( + name = "libloading", + srcs = glob(["**/*.rs"]), + compile_data = glob( + include = ["**"], + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = ["--cap-lints=allow"], + tags = [ + "cargo-bazel", + "crate-name=libloading", + "manual", + "noclippy", + "norustfmt", + ], + target_compatible_with = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [], + "@rules_rust//rust/platform:aarch64-apple-ios": [], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], + "@rules_rust//rust/platform:aarch64-fuchsia": [], + "@rules_rust//rust/platform:aarch64-linux-android": [], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], + "@rules_rust//rust/platform:armv7-linux-androideabi": [], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], + "@rules_rust//rust/platform:i686-apple-darwin": [], + "@rules_rust//rust/platform:i686-linux-android": [], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [], + "@rules_rust//rust/platform:i686-unknown-freebsd": [], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], + "@rules_rust//rust/platform:thumbv7em-none-eabi": [], + "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [], + "@rules_rust//rust/platform:wasm32-wasi": [], + "@rules_rust//rust/platform:x86_64-apple-darwin": [], + "@rules_rust//rust/platform:x86_64-apple-ios": [], + "@rules_rust//rust/platform:x86_64-fuchsia": [], + "@rules_rust//rust/platform:x86_64-linux-android": [], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], + "@rules_rust//rust/platform:x86_64-unknown-none": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + version = "0.8.3", + deps = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@crate_index__windows-targets-0.48.5//:windows_targets", # cfg(windows) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@crate_index__windows-targets-0.48.5//:windows_targets", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@crate_index__windows-targets-0.48.5//:windows_targets", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@crate_index__cfg-if-1.0.0//:cfg_if", # cfg(unix) + ], + "//conditions:default": [], + }), +) diff --git a/third_party/rust/crates/defs.bzl b/third_party/rust/crates/defs.bzl index e6fe66c4742aa..6afa6f6e01dd6 100644 --- a/third_party/rust/crates/defs.bzl +++ b/third_party/rust/crates/defs.bzl @@ -328,6 +328,7 @@ _NORMAL_DEPENDENCIES = { "indexmap": "@crate_index__indexmap-2.0.0//:indexmap", "indicatif": "@crate_index__indicatif-0.17.6//:indicatif", "itertools": "@crate_index__itertools-0.13.0//:itertools", + "libloading": "@crate_index__libloading-0.8.3//:libloading", "log": "@crate_index__log-0.4.20//:log", "mdbook": "@crate_index__mdbook-0.4.34//:mdbook", "memchr": "@crate_index__memchr-2.6.4//:memchr", @@ -1747,6 +1748,16 @@ def crate_repositories(): build_file = Label("@lowrisc_opentitan//third_party/rust/crates:BUILD.libloading-0.7.4.bazel"), ) + maybe( + http_archive, + name = "crate_index__libloading-0.8.3", + sha256 = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19", + type = "tar.gz", + urls = ["https://static.crates.io/crates/libloading/0.8.3/download"], + strip_prefix = "libloading-0.8.3", + build_file = Label("@lowrisc_opentitan//third_party/rust/crates:BUILD.libloading-0.8.3.bazel"), + ) + maybe( http_archive, name = "crate_index__libm-0.2.8",