blob: 29c2e9aa02a48004e6b9ee04bbce36f0306bfd73 [file] [log] [blame]
# Copyright 2020 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/pkg/bin/grand-swd-binary/gsb.gni")
import("system_update_committer_config.gni")
# `system-update-committer` 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-committer"
with_unit_tests = true
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_rust",
"//sdk/fidl/fuchsia.paver:fuchsia.paver_rust",
"//sdk/fidl/fuchsia.update:fuchsia.update_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/zircon/rust:fuchsia-zircon",
"//src/sys/pkg/fidl/fuchsia.update.verify:fuchsia.update.verify_rust",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:typed-builder",
]
test_deps = [
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/fuchsia-sync",
"//src/sys/pkg/testing/mock-paver",
"//src/sys/pkg/testing/mock-reboot",
"//src/sys/pkg/testing/mock-verifier:lib",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:proptest",
]
source_root = "src/main.rs"
sources = [
"src/config.rs",
"src/fidl.rs",
"src/main.rs",
"src/metadata.rs",
"src/metadata/commit.rs",
"src/metadata/configuration.rs",
"src/metadata/errors.rs",
"src/metadata/inspect.rs",
"src/metadata/policy.rs",
"src/metadata/verify.rs",
"src/reboot.rs",
]
visibility = [
":*",
"//src/sys/pkg/bin/grand-swd-binary:*",
]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
}
grand_swd_binary("bin") {
output_name = "system_update_committer"
}
fuchsia_component("component") {
component_name = "system-update-committer"
manifest = "meta/system-update-committer.cml"
deps = [ ":bin" ]
}
fuchsia_package("system-update-committer") {
deps = [ ":component" ]
}
fuchsia_unittest_package("system-update-committer-tests") {
deps = [ ":lib_test" ]
}
system_update_committer_config("enable_reboot_on_verification_failure") {
blobfs = "reboot_on_failure"
netstack = "reboot_on_failure"
}
system_update_committer_config("disable") {
blobfs = "ignore"
netstack = "ignore"
enable = false
}
group("tests") {
testonly = true
public_deps = [ ":system-update-committer-tests" ]
}