blob: 9c0353f5b142026557a3cebe3168e3ee6be257c2 [file] [log] [blame]
# Copyright 2018 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/testing/environments.gni")
import("//src/sys/pkg/sysmgr_config.gni")
rustc_binary("bin") {
name = "pkg_cache"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.space:fuchsia.space-rustc",
"//sdk/fidl/fuchsia.update:fuchsia.update-rustc",
"//src/lib/cobalt/rust:fuchsia-cobalt",
"//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/syslog/rust:syslog",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/pkg/lib/blobfs",
"//src/sys/pkg/lib/far/rust:fuchsia-archive",
"//src/sys/pkg/lib/fuchsia-hash",
"//src/sys/pkg/lib/fuchsia-merkle",
"//src/sys/pkg/lib/fuchsia-pkg",
"//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib",
"//src/sys/pkg/lib/pkgfs",
"//src/sys/pkg/lib/system-image",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:openat",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:proptest-derive",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/blob_location.rs",
"src/blobs.rs",
"src/cache_service.rs",
"src/dynamic_index.rs",
"src/gc_service.rs",
"src/main.rs",
"src/pkgfs_inspect.rs",
"src/test_utils.rs",
]
}
fuchsia_component("component") {
component_name = "pkg-cache"
manifest = "meta/pkg-cache.cml"
deps = [ ":bin" ]
}
fuchsia_package("pkg-cache") {
deps = [ ":component" ]
}
fuchsia_component("pkg-cache-test") {
testonly = true
manifest = "meta/pkg-cache-bin-test.cml"
deps = [ ":bin_test" ]
}
fuchsia_test_package("pkg-cache-tests") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [ ":pkg-cache-test" ]
}
fuchsia_component("isolated") {
component_name = "pkg-cache-isolated"
manifest = "meta/pkg-cache-isolated.cmx"
deps = [ ":bin" ]
}
group("tests") {
testonly = true
public_deps = [ ":pkg-cache-tests" ]
}