blob: 7778043d3b8a17089e7aa7fc36144558a81957df [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_library.gni")
import("//build/testing/environments.gni")
import("//src/sys/pkg/bin/grand-swd-binary/gsb.gni")
rustc_library("lib") {
name = "pkg_cache"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.boot:fuchsia.boot-rustc",
"//sdk/fidl/fuchsia.inspect:fuchsia.inspect-rustc",
"//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/fuchsia-runtime",
"//src/lib/storage/vfs/rust:vfs",
"//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/package-directory",
"//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:async-lock",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//garnet/lib/rust/files_async",
"//src/lib/fuchsia-url",
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//src/sys/pkg/testing/blobfs-ramdisk",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:proptest-derive",
"//third_party/rust_crates:tempfile",
]
source_root = "src/main.rs"
sources = [
"src/base_packages.rs",
"src/cache_service.rs",
"src/compat.rs",
"src/compat/pkgfs.rs",
"src/compat/pkgfs/packages.rs",
"src/compat/pkgfs/packages/variants.rs",
"src/compat/pkgfs/validation.rs",
"src/compat/pkgfs/versions.rs",
"src/gc_service.rs",
"src/index.rs",
"src/index/dynamic.rs",
"src/index/package.rs",
"src/index/retained.rs",
"src/main.rs",
"src/retained_packages_service.rs",
"src/test_utils.rs",
]
visibility = [
":*",
"//src/sys/pkg/bin/grand-swd-binary:*",
]
}
grand_swd_binary("bin") {
output_name = "pkg_cache"
}
fuchsia_component("component") {
component_name = "pkg-cache"
manifest = "meta/pkg-cache.cml"
deps = [ ":bin" ]
}
fuchsia_component("component-ignore-system-image") {
component_name = "pkg-cache-ignore-system-image"
manifest = "meta/pkg-cache-ignore-system-image.cml"
deps = [ ":bin" ]
}
fuchsia_package("pkg-cache") {
deps = [ ":component" ]
}
fuchsia_component("pkg-cache-test") {
testonly = true
manifest = "meta/pkg-cache-bin-test.cml"
deps = [
":lib_test",
"//src/sys/pkg/bin/pm:pm_bin",
]
}
fuchsia_test_package("pkg-cache-tests") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [ ":pkg-cache-test" ]
deps = [
"//src/storage/bin/blobfs",
"//src/storage/testing:storage_driver_test_realm",
]
}
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" ]
}