blob: 70afe34798dd9f6f777c8b7aa94593f61c61c901 [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/rust/rustc_binary.gni")
import("//build/testing/environments.gni")
import("//src/sys/build/components.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/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//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/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:futures",
"//third_party/rust_crates:openat",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//src/sys/pkg/lib/fuchsia-hash",
"//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",
]
}
fuchsia_component("component-v1") {
component_name = "pkg-cache"
manifest = "meta/pkg-cache.cmx"
deps = [ ":bin" ]
}
fuchsia_component("component-v2") {
component_name = "pkg-cache"
manifest = "meta/pkg-cache.cml"
deps = [ ":bin" ]
}
fuchsia_package("pkg-cache") {
deps = [ ":component-v1" ]
}
fuchsia_component("pkg-cache-test") {
testonly = true
manifest = "meta/pkg-cache-bin-test.cml"
deps = [ ":bin_test" ]
}
fuchsia_test_package("pkg-cache-tests") {
test_components = [ ":pkg-cache-test" ]
}
fuchsia_component("isolated") {
component_name = "pkg-cache-isolated"
manifest = "meta/pkg-cache-isolated.cmx"
deps = [ ":bin" ]
}
sysmgr_config("config") {
source = "sysmgr.config"
}
group("tests") {
testonly = true
public_deps = [ ":pkg-cache-tests" ]
}