blob: 2f34962f38c0b367f4dc6e18e22614b40fa06d3a [file]
# Copyright 2026 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.
load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "host_rustc_test")
load("//src/developer/ffx/build:ffx_plugin.bzl", "ffx_plugin")
package(default_applicable_licenses = ["//:license"])
ffx_plugin(
name = "ffx_repository_server_start",
srcs = [
"src/lib.rs",
"src/server.rs",
"src/server_impl.rs",
"src/target.rs",
],
args_deps = [
"//src/developer/ffx/core:lib",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:camino",
],
args_srcs = ["src/args.rs"],
edition = "2024",
sdk_category = "not-yet-specified",
version = "0.1.0",
visibility = [
"//src/developer/ffx/plugins/repository/serve-archive:__pkg__",
"//src/developer/ffx/plugins/repository/server:__pkg__",
"//src/developer/ffx/plugins/target/update:__pkg__",
],
deps = [
"//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust_fdomain",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust_fdomain",
"//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite_rust_fdomain",
"//src/developer/ffx/command/error:lib",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/fidl:fuchsia.developer.ffx_rust",
"//src/developer/ffx/lib/errors:lib",
"//src/developer/ffx/lib/fho:lib",
"//src/developer/ffx/lib/pkg:pkg_fdomain",
"//src/developer/ffx/lib/rcs:lib",
"//src/developer/ffx/lib/ssh:lib",
"//src/developer/ffx/lib/target:lib",
"//src/developer/ffx/lib/target/connector:lib",
"//src/developer/ffx/lib/target/holders:lib",
"//src/developer/ffx/lib/target_errors:lib",
"//src/developer/ffx/lib/target_net:lib",
"//src/developer/ffx/lib/timeout:lib",
"//src/developer/ffx/lib/writer:lib",
"//src/lib/assembly/product_bundle",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-url",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/pkg/lib/fuchsia-repo",
"//src/sys/pkg/lib/package-tool",
# Forked third-party crate lives under forks/tuf-0.3.0-beta14 in Bazel; GN aliases it at //third_party/rust_crates:tuf.
"//third_party/rust_crates/forks/tuf-0.3.0-beta14:tuf", # @bazel2gn:path_overwrite://third_party/rust_crates:tuf
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:async-fs",
"//third_party/rust_crates/vendor:camino",
"//third_party/rust_crates/vendor:chrono",
"//third_party/rust_crates/vendor:futures",
"//third_party/rust_crates/vendor:http",
"//third_party/rust_crates/vendor:log",
"//third_party/rust_crates/vendor:schemars",
"//third_party/rust_crates/vendor:serde",
"//third_party/rust_crates/vendor:signal-hook",
"//third_party/rust_crates/vendor:thiserror",
],
)
# src/server_impl.rs calls fuchsia_repo::test_utils::{make_empty_pm_repo_dir,
# make_repo_dir, make_pm_repository}, which read
# ./test_data/ffx_lib_pkg/empty-repo/{keys,repository} from disk at runtime
# (EMPTY_REPO_PATH in //src/sys/pkg/lib/fuchsia-repo/src/test_utils.rs), and
# //src/sys/pkg/lib/fuchsia-repo does not bundle those files. bazel2gn cannot
# translate `test_data`, so this test is marked @bazel2gn:skip and wired into
# //src/developer/ffx:tests in Bazel.
# @bazel2gn:skip
host_rustc_test(
name = "ffx_repository_server_start_test",
crate = ":ffx_repository_server_start",
test_data = [
"//src/developer/ffx/lib/pkg:empty-repo-keys",
"//src/developer/ffx/lib/pkg:empty-repo-metadata",
],
visibility = ["//src/developer/ffx:__pkg__"],
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust_fdomain",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust_fdomain",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/fidl:fuchsia.developer.ffx_rust",
"//src/developer/ffx/lib/discovery:lib",
"//src/developer/ffx/lib/target:lib",
"//src/developer/ffx/lib/target_net:testutil",
"//src/lib/assembly/partitions_config",
"//src/lib/fdomain/client",
"//src/lib/fdomain/local",
"//src/lib/fuchsia",
"//src/lib/fuchsia-hyper",
"//src/sys/lib/fidl-fuchsia-pkg-rewrite-ext:fidl-fuchsia-pkg-rewrite-ext_fdomain",
"//third_party/rust_crates/vendor:assert_matches",
"//third_party/rust_crates/vendor:camino",
"//third_party/rust_crates/vendor:futures",
"//third_party/rust_crates/vendor:tempfile",
"//third_party/rust_crates/vendor:test-case",
"//third_party/rust_crates/vendor:url",
],
)