blob: 290b94349ba0b3766a51c09764379705d907e3d4 [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/host_tests:host_rustc_test.bzl", "host_rustc_test")
load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library")
package(default_applicable_licenses = ["//:license"])
test_suite(
name = "host_tests",
tests = [":lib_test"],
visibility = ["//src/developer/ffx:__pkg__"],
)
rustc_library(
name = "lib",
srcs = [
"src/boot_data.rs",
"src/builder.rs",
"src/lib.rs",
"src/vbmeta.rs",
"src/zbi.rs",
],
compile_data = [
# TODO(https://fxbug.dev/560343570): third_party/android/platform/external/avb
# has no BUILD.bazel, so Bazel uses root filegroups while GN uses file paths.
"//:avb_atx_metadata", # @bazel2gn:path_overwrite://third_party/android/platform/external/avb/test/data/atx_metadata.bin
# TODO(https://fxbug.dev/560343570): Same as above.
"//:avb_testkey_atx_psk", # @bazel2gn:path_overwrite://third_party/android/platform/external/avb/test/data/testkey_atx_psk.pem
],
crate_name = "ffx_uefi_disk",
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
visibility = [
"//src/developer/ffx/lib/gce:__pkg__",
"//src/developer/ffx/plugins/emulator/engines:__pkg__",
],
deps = [
"//build/sdk/meta:rust",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/fho:lib",
"//src/developer/ffx/lib/ssh:lib",
"//src/lib/assembly/assembled_system",
"//src/lib/assembly/vbmeta",
"//third_party/rust_crates/vendor:camino",
"//third_party/rust_crates/vendor:log",
"//third_party/rust_crates/vendor:tempfile",
"//tools/make-fuchsia-vol:lib",
],
)
host_rustc_test(
name = "lib_test",
crate = ":lib",
# Only used by bazel2gn to set GN output_name and avoid host_x64/lib_test collisions.
crate_name = "ffx_uefi_disk_lib_test",
deps = ["//src/lib/fuchsia"],
)