blob: c9a59a04011b414538e1f167f0e8207730b530cb [file] [log] [blame]
# Copyright 2019 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.gni")
import("//build/rust/rustc_binary.gni")
import("//build/toolchain/concurrent_jobs.gni")
import("//src/storage/fshost/fshost.gni")
# This is only used for generating the structured configuration library, as the
# main cml is produced by assembly.
fshost_cml("fshost_for_config_lib.cml") {
options = {
bootfs_only = true
}
}
fuchsia_component_manifest("fshost_manifest_for_config_lib") {
component_name = "fshost"
manifest = get_target_outputs(":fshost_for_config_lib.cml")
manifest = manifest[0]
deps = [ ":fshost_for_config_lib.cml" ]
}
fuchsia_structured_config_rust_lib("fshost_config_rust") {
name = "fshost_config"
cm_label = ":fshost_manifest_for_config_lib"
}
rustc_binary("fshost") {
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.fs:fuchsia.fs_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/fidl/fuchsia.storage.partitions:fuchsia.storage.partitions_rust",
"//sdk/lib/device-watcher/rust",
"//sdk/rust/zx",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//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/security/lib/kms-stateless/rust",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_rust",
"//src/storage/fshost:fshost_config_rust",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/storage/lib/fs_management/rust:fs_management",
"//src/storage/lib/key-bag",
"//src/storage/lib/ramdevice_client/rust",
"//src/storage/lib/vfs/rust:vfs",
"//src/sys/pkg/fidl/fuchsia.update.verify:fuchsia.update.verify_rust",
"//third_party/rust_crates:aes-gcm-siv",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hkdf",
"//third_party/rust_crates:scopeguard",
"//third_party/rust_crates:sha2",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:uuid",
"//third_party/rust_crates:zerocopy",
"//third_party/rust_crates:zstd",
"//third_party/zstd",
]
non_rust_deps = [
"//src/storage/fvm",
"//src/storage/lib/fs_management/c",
]
test_deps = [
"testing:test_zxcrypt_config",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-async",
]
sources = [
"src/boot_args.rs",
"src/config.rs",
"src/copier.rs",
"src/crypt.rs",
"src/crypt/fxfs.rs",
"src/crypt/zxcrypt.rs",
"src/device.rs",
"src/device/constants.rs",
"src/environment.rs",
"src/environment/fvm_container.rs",
"src/environment/fxfs_container.rs",
"src/fxblob.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" ]
# As this is a large binary that uses many resources to compile (and takes minutes when LTO is
# enabled, shift it to the large RBE worker pool)
_concurrent_jobs = concurrent_jobs.link_highmem
configs += _concurrent_jobs.configs
forward_variables_from(_concurrent_jobs.vars, "*")
exclude_toolchain_tags = [ "instrumented" ]
}
fuchsia_unittest_component("fshost_tests_component") {
component_name = "fshost_tests"
deps = [ ":fshost_test" ]
}
fuchsia_test_package("fshost_tests") {
test_components = [ ":fshost_tests_component" ]
}
source_set("admin-client") {
sources = [
"admin-client.cc",
"admin-client.h",
]
public_deps = [
"//sdk/fidl/fuchsia.fshost:fuchsia.fshost_cpp",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_cpp",
"//sdk/lib/component/incoming/cpp",
"//zircon/system/ulib/zx",
]
}
group("tests") {
testonly = true
public_deps = [
":fshost_tests",
"integration:tests",
]
}