blob: 239728824937d402e69052f3f1ac58ebf8d4669b [file]
# Copyright 2026 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
load("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS")
load("//build/bazel/rules/rust:defs.bzl", "rustc_binary", "rustc_library")
package(default_applicable_licenses = ["//:license"])
rustc_library(
name = "vbmeta",
srcs = [
"src/descriptor.rs",
"src/descriptor/chain_partition.rs",
"src/descriptor/hash.rs",
"src/descriptor/hash_builder.rs",
"src/descriptor/kernel_cmdline.rs",
"src/descriptor/property.rs",
"src/footer.rs",
"src/header.rs",
"src/key.rs",
"src/lib.rs",
"src/test.rs",
"src/vbmeta.rs",
],
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
test_deps = [
"//src/lib/assembly/test_keys",
"//third_party/rust_crates/vendor:assert_matches",
"//third_party/rust_crates/vendor:tempfile",
],
version = "0.1.0",
visibility = [
"//src/developer/ffx/lib/uefi_disk:__pkg__",
"//src/lib/assembly:__subpackages__",
],
with_host_unit_tests = True,
deps = [
"//src/lib/mundane",
"//third_party/modinv",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:camino",
"//third_party/rust_crates/vendor:hex",
"//third_party/rust_crates/vendor:num-bigint",
"//third_party/rust_crates/vendor:num-traits",
"//third_party/rust_crates/vendor:pem",
"//third_party/rust_crates/vendor:ring",
"//third_party/rust_crates/vendor:serde",
"//third_party/rust_crates/vendor:thiserror",
"//third_party/rust_crates/vendor:zerocopy",
],
)
rustc_binary(
name = "bin",
srcs = ["src/main.rs"],
crate_name = "vbmeta",
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
# Only used as the tool of the vbmeta() template in //build/images/vbmeta.gni.
visibility = ["//build/images:__pkg__"],
deps = [
":vbmeta",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:camino",
],
)