Skip to content

Commit

Permalink
[rust] Add libloading crate
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Frantz <[email protected]>
(cherry picked from commit 60f22c7)
  • Loading branch information
cfrantz committed Dec 4, 2024
1 parent 554eb5b commit dfdc952
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 2 deletions.
15 changes: 13 additions & 2 deletions third_party/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions third_party/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions third_party/rust/crates/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
151 changes: 151 additions & 0 deletions third_party/rust/crates/BUILD.libloading-0.8.3.bazel
Original file line number Diff line number Diff line change
@@ -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": [],
}),
)
11 changes: 11 additions & 0 deletions third_party/rust/crates/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit dfdc952

Please sign in to comment.