| # 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") |
| import("pkg_resolver_config.gni") |
| |
| # `pkg-resolver` is conceptually a binary, but it built as a lib here so it can be |
| # aggregated into //src/sys/pkg/bin/grand-swd-binary to save disk space. |
| rustc_library("lib") { |
| name = "pkg_resolver" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.pkg.internal:fuchsia.pkg.internal-rustc", |
| "//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite-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-fs", |
| "//src/lib/fuchsia-hyper", |
| "//src/lib/fuchsia-url", |
| "//src/lib/http-sse:http_sse", |
| "//src/lib/http-uri-ext", |
| "//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/lib/async-generator", |
| "//src/sys/pkg/lib/eager-package-config", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib", |
| "//src/sys/pkg/lib/omaha-client", |
| "//src/sys/pkg/lib/system-image", |
| "//src/sys/pkg/lib/work-queue", |
| "//third_party/cobalt/src/lib/client/rust:cobalt-client", |
| "//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:http", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:p256", |
| "//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:thiserror", |
| "//third_party/rust_crates:tuf", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc", |
| "//src/sys/pkg/lib/fuchsia-pkg-testing", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:p256", |
| "//third_party/rust_crates:signature", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:typed-builder", |
| ] |
| |
| source_root = "src/main.rs" |
| sources = [ |
| "src/args.rs", |
| "src/cache.rs", |
| "src/cache/inspect.rs", |
| "src/cache/resume.rs", |
| "src/cache/retry.rs", |
| "src/cache_package_index.rs", |
| "src/clock.rs", |
| "src/config.rs", |
| "src/eager_package_manager.rs", |
| "src/error.rs", |
| "src/experiment.rs", |
| "src/font_package_manager.rs", |
| "src/inspect_util.rs", |
| "src/main.rs", |
| "src/metrics_util.rs", |
| "src/ota_channel.rs", |
| "src/repository.rs", |
| "src/repository/filesystem_repository.rs", |
| "src/repository/local_provider.rs", |
| "src/repository/updating_tuf_client.rs", |
| "src/repository_manager.rs", |
| "src/repository_service.rs", |
| "src/resolver_service.rs", |
| "src/resolver_service/inspect.rs", |
| "src/rewrite_manager.rs", |
| "src/rewrite_service.rs", |
| "src/test_util.rs", |
| "src/util.rs", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/sys/pkg/bin/grand-swd-binary:*", |
| ] |
| } |
| |
| grand_swd_binary("bin") { |
| output_name = "pkg_resolver" |
| } |
| |
| fuchsia_component("component") { |
| component_name = "pkg-resolver" |
| manifest = "meta/pkg-resolver.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("pkg-resolver") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_component("unit-tests-root") { |
| component_name = "test_root" |
| testonly = true |
| manifest = "meta/test_root.cml" |
| } |
| |
| fuchsia_component("unit-tests-driver") { |
| component_name = "test_driver" |
| testonly = true |
| manifest = "meta/test_driver.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_test_package("unit-tests-package") { |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| package_name = "pkg-resolver-unit-tests" |
| deps = [ |
| ":unit-tests-driver", |
| "//src/connectivity/network/dns:component", |
| "//src/connectivity/network/netstack:component", |
| "//src/sys/pkg/bin/pm:pm_bin", |
| "//src/sys/pkg/tests/pkg-resolver:empty-repo", |
| ] |
| test_components = [ ":unit-tests-root" ] |
| } |
| |
| fuchsia_component("isolated") { |
| component_name = "pkg-resolver-isolated" |
| manifest = "meta/pkg-resolver-isolated.cmx" |
| deps = [ "//src/sys/pkg/bin/pkg-resolver:bin" ] |
| } |
| |
| pkg_resolver_config("enable_dynamic_configuration") { |
| enable_dynamic_configuration = true |
| deps = [ "//build/validate:non_production_tag" ] |
| } |
| |
| resolver_persisted_repos_config("persisted_repos_dir") { |
| persisted_repos_dir = "repos" |
| deps = [ "//build/validate:non_production_tag" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":unit-tests-package" ] |
| } |