blob: 9de30b85bb205620e4627d83fa6126bd17fb62e0 [file] [log] [blame] [edit]
# Copyright 2021 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.
import("//build/components/fuchsia_test_package.gni")
import("//build/components/fuchsia_unittest_component.gni")
import("//build/dist/renamed_binary.gni")
import("//build/rust/rustc_binary.gni")
rustc_binary("bin") {
output_name = "fshost_rust"
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_rust",
"//sdk/fidl/fuchsia.component:fuchsia.component_rust",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.device:fuchsia.device_rust",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust",
"//sdk/fidl/fuchsia.fshost:fuchsia.fshost_rust",
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_rust",
"//sdk/fidl/fuchsia.hardware.block.encrypted:fuchsia.hardware.block.encrypted_rust",
"//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition_rust",
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust",
"//sdk/lib/device-watcher/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-runtime",
"//src/lib/storage/block_client/rust:remote-block-device",
"//src/lib/storage/fs_management/rust:fs_management",
"//src/lib/storage/fuchsia-watch",
"//src/lib/storage/key-bag",
"//src/lib/storage/ramdevice_client/rust",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/security/lib/kms-stateless/rust",
"//src/storage/fshost:fshost_config_rust",
"//src/storage/fxfs:fuchsia.fxfs_rust",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:zerocopy",
"//third_party/rust_crates:zstd",
"//third_party/zstd",
]
test_deps = [
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-async",
]
sources = [
"src/boot_args.rs",
"src/config.rs",
"src/crypt.rs",
"src/crypt/fxfs.rs",
"src/crypt/zxcrypt.rs",
"src/device.rs",
"src/device/constants.rs",
"src/environment.rs",
"src/environment/copier.rs",
"src/inspect.rs",
"src/main.rs",
"src/manager.rs",
"src/matcher.rs",
"src/ramdisk.rs",
"src/service.rs",
"src/volume.rs",
"src/watcher.rs",
]
with_unit_tests = true
configs += [ "//build/config/rust:bootfs" ]
}
renamed_binary("fshost-rust") {
source = "$root_out_dir/fshost_rust"
source_deps = [ ":bin" ]
dest = "bin/fshost"
}
fuchsia_unittest_component("fshost_rust_tests_component") {
component_name = "fshost_rust_tests"
deps = [ ":bin_test" ]
}
fuchsia_test_package("fshost_rust_tests") {
test_components = [ ":fshost_rust_tests_component" ]
}
group("tests") {
testonly = true
public_deps = [
":fshost_rust_tests",
"integration:tests",
]
}