blob: 7aac61a43451fa4a6769829bf0ab6d76b5c7a763 [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/test/test_package.gni")
import("//build/testing/environments.gni")
import("//src/sys/pkg/bin/pkg-resolver/pkg_resolver_config.gni")
import("//src/sys/pkg/sysmgr_config.gni")
rustc_binary("bin") {
name = "pkg_resolver"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//garnet/lib/rust/sysconfig-client",
"//garnet/public/rust/fuchsia-hyper",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite-rustc",
"//src/lib/cobalt/rust:fuchsia-cobalt",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/lib/http-sse:http_sse",
"//src/lib/http-uri-ext",
"//src/lib/inspect/rust/fuchsia-inspect",
"//src/lib/inspect/rust/fuchsia-inspect-contrib",
"//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/lib/fidl-fuchsia-pkg-rewrite-ext",
"//src/sys/lib/fuchsia_backoff",
"//src/sys/pkg/bin/amber:cobalt_sw_delivery_registry_rustlib",
"//src/sys/pkg/lib/fuchsia-pkg",
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//src/sys/pkg/lib/pkgfs",
"//src/sys/pkg/lib/system-image",
"//src/sys/pkg/lib/tuf",
"//third_party/cobalt/src/lib/client/rust:cobalt-client",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:http",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:hyper-rustls",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:log",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-project",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:url",
"//zircon/system/fidl/fuchsia-boot:fuchsia-boot-rustc",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
non_rust_deps =
[ "//zircon/system/ulib/sysconfig-client:sysconfig-sync-client-c" ]
}
# Ensure the contents of this package stay in sync with //src/sys/pkg/tests/amberctl:amberctl-tests
package("pkg-resolver") {
deps = [ ":bin" ]
binaries = [
{
name = "pkg_resolver"
dest = "pkg-resolver"
},
]
meta = [
{
path = rebase_path("meta/pkg-resolver.cmx")
dest = "pkg-resolver.cmx"
},
]
}
generate_manifest("empty-repo.manifest") {
visibility = [ ":*" ]
testonly = true
sources = []
args = []
foreach(path,
[
"keys/root.json",
"keys/snapshot.json",
"keys/targets.json",
"keys/timestamp.json",
"repository/1.root.json",
"repository/1.snapshot.json",
"repository/1.targets.json",
"repository/root.json",
"repository/snapshot.json",
"repository/targets.json",
"repository/timestamp.json",
]) {
source = "//src/sys/pkg/tests/pkg-resolver/template/${path}"
sources += [ source ]
args += [ "--entry=empty-repo/${path}=" + rebase_path(source) ]
}
}
empty_repo_manifest_outputs = get_target_outputs(":empty-repo.manifest")
empty_repo_manifest_file = empty_repo_manifest_outputs[0]
test_package("pkg-resolver-unit-tests") {
deps = [
":bin_test",
":empty-repo.manifest",
]
extra = [ empty_repo_manifest_file ]
tests = [
{
name = "pkg_resolver_bin_test"
dest = "pkg-resolver-bin-test"
environments = basic_envs
},
]
}
pkg_resolver_config("enable_dynamic_configuration") {
enable_dynamic_configuration = true
}
sysmgr_config("config") {
source = "sysmgr.config"
}
group("tests") {
testonly = true
public_deps = [ ":pkg-resolver-unit-tests" ]
}