blob: 8ee37047bffe3469a21834920e5eb7b16b547e03 [file]
# 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_test.gni")
import("//src/sys/pkg/bin/grand-swd-binary/gsb.gni")
grand_swd_binary("bin") {
output_name = "pkg_resolver"
}
fuchsia_package("pkg-resolver") {
deps = [ ":component" ]
}
# Kept in GN because `unit-tests-package` uses
# `//src/connectivity/network/dns:package`,
# `//src/connectivity/network/netstack3:package-for-tests`, and
# `//src/connectivity/policy/http-client:package`, which remain in GN, and
# `lib_test` depends on `//src/storage/lib/vfs/rust:vfs`
# (`rustc_dylib("vfs_dylib")`).
rustc_test("lib_test") {
output_name = "pkg_resolver_lib_test"
edition = "2024"
deps = [
":config_lib",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.component.resolution:fuchsia.component.resolution_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//sdk/fidl/fuchsia.net.http:fuchsia.net.http_rust",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust",
"//sdk/fidl/fuchsia.pkg.http:fuchsia.pkg.http_rust",
"//sdk/fidl/fuchsia.pkg.internal:fuchsia.pkg.internal_rust",
"//sdk/fidl/fuchsia.pkg.resolution:fuchsia.pkg.resolution_rust",
"//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite_rust",
"//sdk/rust/zx",
"//src/lib/cobalt/rust/builders",
"//src/lib/diagnostics/inspect/contrib/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fidl/rust/fidl-contrib",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-sync",
"//src/lib/fuchsia-url",
"//src/lib/http-sse:http_sse",
"//src/lib/http-uri-ext",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
"//src/lib/versioning/version-history/rust",
"//src/storage/lib/delivery_blob",
"//src/storage/lib/vfs/rust:vfs",
"//src/sys/lib/fidl-fuchsia-component-abi-ext",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/lib/fidl-fuchsia-pkg-rewrite-ext",
"//src/sys/lib/fuchsia_backoff",
"//src/sys/lib/mem_util",
"//src/sys/pkg/lib/eager-package-config",
"//src/sys/pkg/lib/fuchsia-pkg",
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib",
"//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:assert_matches",
"//third_party/rust_crates:async-lock",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:derive_builder",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:http",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:log",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:omaha_client",
"//third_party/rust_crates:p256",
"//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:tuf",
"//third_party/rust_crates:typed-builder",
]
source_root = "src/main.rs"
sources = [
"src/authority_service.rs",
"src/cache.rs",
"src/cache/inspect.rs",
"src/cache/retry.rs",
"src/cache_package_index.rs",
"src/clock.rs",
"src/component_resolver.rs",
"src/config.rs",
"src/eager_package_manager.rs",
"src/error.rs",
"src/inspect_util.rs",
"src/main.rs",
"src/metrics_util.rs",
"src/ota_downloader.rs",
"src/repository.rs",
"src/repository/filesystem_repository.rs",
"src/repository/http_repository.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/resolver_service/resolve_with_context.rs",
"src/rewrite_manager.rs",
"src/rewrite_service.rs",
"src/test_util.rs",
"src/util.rs",
]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
}
fuchsia_test_component("unit-tests-root") {
component_name = "test_root"
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-tests"
deps = [
":component",
":unit-tests-driver",
"//src/sys/pkg/lib/fuchsia-pkg-testing/certs",
"//src/sys/pkg/testing:fake-ssl-certs",
"//src/sys/pkg/tests/pkg-resolver:empty-repo",
]
subpackages = [
"//src/connectivity/network/dns:package",
"//src/connectivity/network/netstack3:package-for-tests",
"//src/connectivity/policy/http-client:package",
]
test_components = [ ":unit-tests-root" ]
}
group("non_hermetic_tests") {
testonly = true
public_deps = [ ":unit-tests-package" ]
}
## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ##
#
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
#
#
# AUTO-GENERATED - DO NOT EDIT
#
# The targets below are auto-generated based on the targets defined in the
# BUILD.bazel file from the same directory. If you made changes to targets in
# Bazel, instead of editing this file manually, run:
#
# > fx bazel2gn
#
# Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and
# rerun bazel2gn.
import("//build/tools/bazel2gn/bazel_migration.gni")
rustc_library("lib") {
sources = [
"src/authority_service.rs",
"src/cache.rs",
"src/cache/inspect.rs",
"src/cache/retry.rs",
"src/cache_package_index.rs",
"src/clock.rs",
"src/component_resolver.rs",
"src/config.rs",
"src/eager_package_manager.rs",
"src/error.rs",
"src/inspect_util.rs",
"src/main.rs",
"src/metrics_util.rs",
"src/ota_downloader.rs",
"src/repository.rs",
"src/repository/filesystem_repository.rs",
"src/repository/http_repository.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/resolver_service/resolve_with_context.rs",
"src/rewrite_manager.rs",
"src/rewrite_service.rs",
"src/test_util.rs",
"src/util.rs",
]
crate_name = "pkg_resolver"
source_root = "src/main.rs"
edition = "2024"
lint_config = "//build/config/rust/lints:clippy_warn_all"
proc_macro_deps = [ "//third_party/rust_crates:async-trait" ]
visibility = [
":*",
"//src/sys/pkg/bin/grand-swd-binary:*",
]
deps = [
":config_lib",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.component.resolution:fuchsia.component.resolution_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//sdk/fidl/fuchsia.net.http:fuchsia.net.http_rust",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust",
"//sdk/fidl/fuchsia.pkg.http:fuchsia.pkg.http_rust",
"//sdk/fidl/fuchsia.pkg.internal:fuchsia.pkg.internal_rust",
"//sdk/fidl/fuchsia.pkg.resolution:fuchsia.pkg.resolution_rust",
"//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite_rust",
"//sdk/rust/zx",
"//src/lib/cobalt/rust/builders",
"//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/fidl/rust/fidl-contrib",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-sync",
"//src/lib/fuchsia-url",
"//src/lib/http-sse:http_sse",
"//src/lib/http-uri-ext",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
"//src/lib/versioning/version-history/rust",
"//src/storage/lib/delivery_blob",
"//src/sys/lib/fidl-fuchsia-component-abi-ext",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/lib/fidl-fuchsia-pkg-rewrite-ext",
"//src/sys/lib/fuchsia_backoff",
"//src/sys/lib/mem_util",
"//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/system-image",
"//src/sys/pkg/lib/work-queue",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-lock",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:http",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:log",
"//third_party/rust_crates:omaha_client",
"//third_party/rust_crates:p256",
"//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",
"//third_party/rust_crates:typed-builder",
]
}
fuchsia_component_manifest("manifest") {
component_name = "pkg-resolver"
manifest = "meta/pkg-resolver.cml"
}
fuchsia_structured_config_rust_lib("config_lib") {
cm_label = ":manifest"
name = "pkg_resolver_config"
}
fuchsia_component("component") {
cm_label = ":manifest"
visibility = [
":*",
"//src/security/tests/pkg_test/tests:*",
"//src/sys/pkg/lib/isolated-swd:*",
"//src/sys/pkg/tests/isolated-ota:*",
]
deps = [ ":bin" ]
}