blob: 9aa65846373810cb0786968933b805476c4431ae [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("//src/sys/core/build/core_shard.gni")
import("//src/sys/pkg/bin/system-update-checker/ota_config.gni")
rustc_binary("bin") {
name = "system_update_checker"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.boot:fuchsia.boot-rustc",
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.paver:fuchsia.paver-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.space:fuchsia.space-rustc",
"//sdk/fidl/fuchsia.update:fuchsia.update-rustc",
"//sdk/fidl/fuchsia.update.channel:fuchsia.update.channel-rustc",
"//sdk/fidl/fuchsia.update.channelcontrol:fuchsia.update.channelcontrol-rustc",
"//src/lib/diagnostics/inspect/contrib/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer-rustc",
"//src/sys/pkg/lib/async-generator",
"//src/sys/pkg/lib/event-queue",
"//src/sys/pkg/lib/fidl-fuchsia-update-ext",
"//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext",
"//src/sys/pkg/lib/fuchsia-hash",
"//src/sys/pkg/lib/update-package",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//src/sys/pkg/testing/mock-paver",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:proptest-derive",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/apply.rs",
"src/channel.rs",
"src/channel_handler.rs",
"src/check.rs",
"src/config.rs",
"src/connect.rs",
"src/errors.rs",
"src/main.rs",
"src/poller.rs",
"src/rate_limiter.rs",
"src/update_manager.rs",
"src/update_monitor.rs",
"src/update_service.rs",
]
}
core_shard("system-update-checker-core-shard") {
shard_file = "meta/system_update_checker.core_shard.cml"
}
fuchsia_component("component") {
component_name = "system-update-checker"
manifest = "meta/system-update-checker.cml"
deps = [ ":bin" ]
}
# TODO(fxbug.dev/83213) Retain v1 component while out of tree tests need it.
fuchsia_component("legacy") {
component_name = "system-update-checker"
manifest = "meta/system-update-checker.cmx"
deps = [ ":bin" ]
}
fuchsia_package("system-update-checker") {
deps = [
":component",
":legacy",
]
}
fuchsia_unittest_component("system-update-checker-bin-test") {
manifest = "meta/system-update-checker-bin-test.cml"
deps = [ ":bin_test" ]
}
fuchsia_test_package("system-update-checker-tests") {
test_components = [ ":system-update-checker-bin-test" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
ota_config("auto_update") {
# Check for updates every 60 minutes
poll_frequency_minutes = 60
}
group("tests") {
testonly = true
public_deps = [ ":system-update-checker-tests" ]
}