blob: 829b5d622c1c1dccfe7d1bf50a95a85ee4bc7884 [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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/testing/environments.gni")
import("//src/sys/build/components.gni")
import("//src/sys/pkg/sysmgr_config.gni")
import("//tools/fidl/measure-tape/measure_tape.gni")
measure_tape("measure_fuchsia_pkg") {
fidls = [ "//sdk/fidl/fuchsia.pkg" ]
target_type = "fuchsia.pkg/PackageIndexEntry"
target_binding = "rust"
}
rustc_binary("bin") {
name = "pkg_cache"
with_unit_tests = true
edition = "2018"
deps = [
":measure_fuchsia_pkg",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.space:fuchsia.space-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-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",
]
test_deps = [
"//src/sys/pkg/lib/fuchsia-hash",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/blob_location.rs",
"src/cache_service.rs",
"src/gc_service.rs",
"src/main.rs",
"src/pkgfs_inspect.rs",
]
}
package("pkg-cache") {
deps = [ ":bin" ]
binaries = [
{
name = "pkg_cache"
dest = "pkg-cache"
},
]
meta = [
{
path = rebase_path("meta/pkg-cache.cmx")
dest = "pkg-cache.cmx"
},
]
}
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" ]
}
sysmgr_config("config") {
source = "sysmgr.config"
}
group("tests") {
testonly = true
public_deps = [ ":pkg-cache-tests" ]
}