blob: 5d5f9211cb15695de7b4fb26096faac0c1620199 [file] [log] [blame]
# Copyright 2022 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_library.gni")
import("//src/sys/core/build/core_shard.gni")
import("//src/sys/pkg/bin/grand-swd-binary/gsb.gni")
# `system-update-configurator` is conceptually a binary, but it built as a lib here so
# it can be aggregated into //src/sys/pkg/bin/grand-swd-binary to save disk space.
rustc_library("lib") {
name = "system-update-configurator"
with_unit_tests = true
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.update.config:fuchsia.update.config-rustc",
"//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/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [ "//third_party/rust_crates:assert_matches" ]
non_rust_deps = [ "//src/security/tee/tee-client-api" ]
source_root = "src/main.rs"
sources = [
"src/bridge.rs",
"src/bridge/testing.rs",
"src/bridge/vx_ta/mod.rs",
"src/bridge/vx_ta/tee_client_api.rs",
"src/health.rs",
"src/main.rs",
"src/service.rs",
]
visibility = [
":*",
"//src/sys/pkg/bin/grand-swd-binary:*",
]
}
grand_swd_binary("bin") {
output_name = "system_update_configurator"
}
fuchsia_component("component") {
component_name = "system-update-configurator"
manifest = "meta/system-update-configurator.cml"
deps = [ ":bin" ]
}
fuchsia_package("system-update-configurator") {
deps = [ ":component" ]
}
core_shard("core-shard") {
shard_file = "meta/core-shard.cml"
}
# FIXME(fxbug.dev/93695) Replace with an optional capability route when that feature is available
core_shard("route-to-omaha-core-shard") {
shard_file = "meta/route-to-omaha-core-shard.cml"
}
fuchsia_unittest_package("system-update-configurator-tests") {
deps = [ ":lib_test" ]
}
group("tests") {
testonly = true
public_deps = [
":system-update-configurator-integration-test",
":system-update-configurator-tests",
]
}
rustc_test("bin_test") {
name = "system_update_configurator_smoke_test"
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.update.config:fuchsia.update.config-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:libc",
]
source_root = "src/integration_test.rs"
sources = [ "src/integration_test.rs" ]
}
fuchsia_component("system-update-configurator-integration-test-cmp") {
testonly = true
component_name = "system-update-configurator-integration-test"
manifest = "meta/system-update-configurator-integration-test.cml"
deps = [ ":bin_test" ]
}
fuchsia_component("tee-manager-test-cmp") {
manifest = "meta/tee-manager.test.cml"
component_name = "tee_manager"
deps = [ "//src/security/tee_manager:bin" ]
}
fuchsia_test_package("system-update-configurator-integration-test") {
test_components = [ ":system-update-configurator-integration-test-cmp" ]
deps = [
":component",
":tee-manager-test-cmp",
]
test_specs = {
environments = [
sherlock_env,
nelson_env,
]
}
}