| # 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/assembly/bootfs_files_for_assembly.gni") | |
| import("//build/components.gni") | |
| import("//build/dist/component_manifest_resources.gni") | |
| import("//build/rust/rustc_library.gni") | |
| import("//build/testing/environments.gni") | |
| import("//build/toolchain/concurrent_jobs.gni") | |
| import("//src/storage/fshost/generated_fshost_config.gni") | |
| import("//src/sys/pkg/bin/grand-swd-binary/gsb.gni") | |
| fuchsia_structured_config_values2("config_values_from_gn") { | |
| cm_label = ":manifest" | |
| component_name = "pkg-cache" | |
| output_component_name = "pkg-cache-config" | |
| values = { | |
| # TODO(https://fxbug.dev/331302451) Populate this correctly. | |
| all_packages_executable = false | |
| require_system_image = true | |
| enable_upgradable_packages = false | |
| } | |
| visibility = [ ":*" ] | |
| } | |
| group("production-component-and-config") { | |
| testonly = true | |
| public_deps = [ | |
| ":component", | |
| ":config_values_from_gn", | |
| ] | |
| } | |
| # Assembly consumes this package through its bazel_inputs export: a Bazel | |
| # package would ship the vfs Rust dylib, whose debug symbols the Bazel | |
| # build does not export yet. | |
| fuchsia_package("pkg-cache") { | |
| deps = [ ":component" ] | |
| } | |
| # The binary and its unit-test binary (`:bin_test`) are defined in | |
| # BUILD.bazel. Only the test component and package (`:pkg-cache-test` and | |
| # `:pkg-cache-tests`) remain in GN above the sentinel because | |
| # `pkg-cache-tests` packages `//src/storage/testing:storage_driver_test_realm` | |
| # (which is GN-only). | |
| fuchsia_component("pkg-cache-test") { | |
| testonly = true | |
| manifest = "meta/pkg-cache-bin-test.cml" | |
| deps = [ ":bin_test" ] | |
| } | |
| fuchsia_test_package("pkg-cache-tests") { | |
| test_specs = { | |
| log_settings = { | |
| max_severity = "ERROR" | |
| } | |
| } | |
| test_components = [ ":pkg-cache-test" ] | |
| deps = [ "//src/storage/testing:storage_driver_test_realm" ] | |
| } | |
| group("hermetic_tests") { | |
| testonly = true | |
| public_deps = [ ":pkg-cache-tests" ] | |
| } | |
| ## 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_binary("bin") { | |
| sources = [ | |
| "src/base_package_resolver.rs", | |
| "src/blob_fetcher.rs", | |
| "src/blob_fetcher/retry.rs", | |
| "src/cache_service.rs", | |
| "src/cache_service/missing_blobs.rs", | |
| "src/compat.rs", | |
| "src/compat/pkgfs.rs", | |
| "src/compat/pkgfs/validation.rs", | |
| "src/component_resolver.rs", | |
| "src/executability.rs", | |
| "src/frozen_index.rs", | |
| "src/full_package_resolver.rs", | |
| "src/gc_service.rs", | |
| "src/index.rs", | |
| "src/index/package.rs", | |
| "src/index/retained.rs", | |
| "src/index/upgradable.rs", | |
| "src/index/writing.rs", | |
| "src/main.rs", | |
| "src/ota_downloader.rs", | |
| "src/ota_resolver.rs", | |
| "src/package_fetcher.rs", | |
| "src/required_blobs.rs", | |
| "src/retained_packages_service.rs", | |
| "src/root_dir.rs", | |
| "src/test_utils.rs", | |
| ] | |
| configs += [ "//build/config/rust:bootfs" ] | |
| output_name = "pkg_cache" | |
| edition = "2024" | |
| lint_config = "//build/config/rust/lints:clippy_warn_all" | |
| 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.pkg:fuchsia.pkg_rust", | |
| "//sdk/fidl/fuchsia.pkg.garbagecollector:fuchsia.pkg.garbagecollector_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.storage.block:fuchsia.storage.block_rust", | |
| "//sdk/fidl/fuchsia.update:fuchsia.update_rust", | |
| "//sdk/rust/zx", | |
| "//src/lib/cobalt/rust/builders", | |
| "//src/lib/collections/sorted-vec-map", | |
| "//src/lib/diagnostics/inspect/contrib/rust", | |
| "//src/lib/diagnostics/inspect/runtime/rust", | |
| "//src/lib/diagnostics/inspect/rust", | |
| "//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-runtime", | |
| "//src/lib/fuchsia-sync", | |
| "//src/lib/fuchsia-url", | |
| "//src/lib/http-uri-ext", | |
| "//src/lib/trace/rust:trace", | |
| "//src/lib/trace/rust:trace-provider", | |
| "//src/lib/versioning/version-history/rust", | |
| "//src/storage/fidl/fuchsia.storage.mapping:fuchsia.storage.mapping_rust", | |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", | |
| "//src/storage/lib/blob_pager_and_verifier", | |
| "//src/storage/lib/vfs/rust:vfs", | |
| "//src/sys/lib/fidl-connector", | |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", | |
| "//src/sys/lib/fuchsia_backoff", | |
| "//src/sys/pkg/lib/blobfs", | |
| "//src/sys/pkg/lib/context-authenticator", | |
| "//src/sys/pkg/lib/fuchsia-hash", | |
| "//src/sys/pkg/lib/fuchsia-merkle", | |
| "//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib", | |
| "//src/sys/pkg/lib/package-directory", | |
| "//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:itertools", | |
| "//third_party/rust_crates:log", | |
| "//third_party/rust_crates:rand", | |
| "//third_party/rust_crates:scopeguard", | |
| "//third_party/rust_crates:thiserror", | |
| "//third_party/rust_crates:typed-builder", | |
| ] | |
| visibility = [ | |
| ":*", | |
| "//src/sys/pkg/bin/grand-swd-binary:*", | |
| ] | |
| _concurrent_jobs = concurrent_jobs.link_highmem | |
| configs += _concurrent_jobs.configs | |
| forward_variables_from(_concurrent_jobs.vars, "*") | |
| } | |
| rustc_test("bin_test") { | |
| sources = [ | |
| "src/base_package_resolver.rs", | |
| "src/blob_fetcher.rs", | |
| "src/blob_fetcher/retry.rs", | |
| "src/cache_service.rs", | |
| "src/cache_service/missing_blobs.rs", | |
| "src/compat.rs", | |
| "src/compat/pkgfs.rs", | |
| "src/compat/pkgfs/validation.rs", | |
| "src/component_resolver.rs", | |
| "src/executability.rs", | |
| "src/frozen_index.rs", | |
| "src/full_package_resolver.rs", | |
| "src/gc_service.rs", | |
| "src/index.rs", | |
| "src/index/package.rs", | |
| "src/index/retained.rs", | |
| "src/index/upgradable.rs", | |
| "src/index/writing.rs", | |
| "src/main.rs", | |
| "src/ota_downloader.rs", | |
| "src/ota_resolver.rs", | |
| "src/package_fetcher.rs", | |
| "src/required_blobs.rs", | |
| "src/retained_packages_service.rs", | |
| "src/root_dir.rs", | |
| "src/test_utils.rs", | |
| ] | |
| 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.pkg:fuchsia.pkg_rust", | |
| "//sdk/fidl/fuchsia.pkg.garbagecollector:fuchsia.pkg.garbagecollector_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.storage.block:fuchsia.storage.block_rust", | |
| "//sdk/fidl/fuchsia.update:fuchsia.update_rust", | |
| "//sdk/rust/zx", | |
| "//src/lib/cobalt/rust/builders", | |
| "//src/lib/collections/sorted-vec-map", | |
| "//src/lib/diagnostics/inspect/contrib/rust", | |
| "//src/lib/diagnostics/inspect/runtime/rust", | |
| "//src/lib/diagnostics/inspect/rust", | |
| "//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-runtime", | |
| "//src/lib/fuchsia-sync", | |
| "//src/lib/fuchsia-url", | |
| "//src/lib/http-uri-ext", | |
| "//src/lib/trace/rust:trace", | |
| "//src/lib/trace/rust:trace-provider", | |
| "//src/lib/versioning/version-history/rust", | |
| "//src/storage/fidl/fuchsia.storage.mapping:fuchsia.storage.mapping_rust", | |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", | |
| "//src/storage/lib/blob_pager_and_verifier", | |
| "//src/storage/lib/vfs/rust:vfs", | |
| "//src/sys/lib/fidl-connector", | |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", | |
| "//src/sys/lib/fuchsia_backoff", | |
| "//src/sys/pkg/lib/blobfs", | |
| "//src/sys/pkg/lib/context-authenticator", | |
| "//src/sys/pkg/lib/fuchsia-hash", | |
| "//src/sys/pkg/lib/fuchsia-merkle", | |
| "//src/sys/pkg/lib/metrics:cobalt_sw_delivery_registry_rustlib", | |
| "//src/sys/pkg/lib/package-directory", | |
| "//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:itertools", | |
| "//third_party/rust_crates:log", | |
| "//third_party/rust_crates:rand", | |
| "//third_party/rust_crates:scopeguard", | |
| "//third_party/rust_crates:thiserror", | |
| "//third_party/rust_crates:typed-builder", | |
| ] + [ | |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", | |
| "//src/sys/pkg/lib/far/rust:fuchsia-archive", | |
| "//src/sys/pkg/lib/fuchsia-pkg", | |
| "//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:tempfile", | |
| "//third_party/rust_crates:test-case", | |
| ] | |
| source_root = "src/main.rs" | |
| configs += [ "//build/config/rust:bootfs" ] | |
| output_name = "pkg_cache_bin_test" | |
| lint_config = "//build/config/rust/lints:clippy_warn_all" | |
| _concurrent_jobs = concurrent_jobs.link_highmem | |
| configs += _concurrent_jobs.configs | |
| forward_variables_from(_concurrent_jobs.vars, "*") | |
| } | |
| fuchsia_component_manifest("manifest") { | |
| component_name = "pkg-cache" | |
| manifest = "meta/pkg-cache.cml" | |
| } | |
| fuchsia_structured_config_rust_lib("config_lib") { | |
| cm_label = ":manifest" | |
| name = "pkg_cache_config" | |
| } | |
| fuchsia_component("component") { | |
| cm_label = ":manifest" | |
| visibility = [ | |
| ":*", | |
| "//src/sys/pkg/lib/isolated-swd:*", | |
| "//src/sys/pkg/tests/isolated-ota:*", | |
| "//src/sys/pkg/tests/pkg-cache:*", | |
| ] | |
| deps = [ ":bin" ] | |
| } |