blob: 958cc05475aa6e00b8ebe2ded4b62540ae4034cf [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/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS")
load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "wrap_host_rust_test")
load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library")
load("//build/bazel/rules/rust:rustc_test.bzl", "rustc_test")
package(default_applicable_licenses = ["//:license"])
rustc_library(
name = "package-tool",
srcs = [
"src/args.rs",
"src/lib.rs",
"src/package_archive.rs",
"src/package_build.rs",
"src/repo_create.rs",
"src/repo_publish.rs",
],
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
target_compatible_with = HOST_OS_CONSTRAINTS,
visibility = [
"//src/developer/ffx/plugins:__subpackages__",
"//src/sys/pkg:__subpackages__",
],
deps = [
"//src/lib/assembly/product_bundle",
"//src/lib/buf-read-ext",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-lockfile:lib",
"//src/lib/tempfile-ext",
"//src/lib/versioning/version-history/rust",
"//src/lib/versioning/version-history/rust/data",
"//src/sys/pkg/lib/far/rust:fuchsia-archive",
"//src/sys/pkg/lib/fuchsia-merkle",
"//src/sys/pkg/lib/fuchsia-pkg",
"//src/sys/pkg/lib/fuchsia-repo",
"//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:argh",
"//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:log",
"//third_party/rust_crates/vendor:serde",
"//third_party/rust_crates/vendor:serde_json",
"//third_party/rust_crates/vendor:tempfile",
],
)
rustc_test(
name = "package-tool_test",
crate = ":package-tool",
# Matches GN output_name.
crate_name = "package_tool_lib_test",
data = [
"//src/developer/ffx/lib/pkg:empty-repo-keys",
"//src/developer/ffx/lib/pkg:empty-repo-metadata",
],
lint_config = "//build/config/rust/lints:clippy_warn_all",
target_compatible_with = HOST_OS_CONSTRAINTS,
deps = [
"//src/lib/assembly/partitions_config",
"//src/lib/fuchsia",
"//src/lib/fuchsia-url",
"//third_party/rust_crates/vendor:assert_matches",
"//third_party/rust_crates/vendor:pretty_assertions",
"//third_party/rust_crates/vendor:test-case",
"//third_party/rust_crates/vendor:walkdir",
],
)
wrap_host_rust_test(
name = "package-tool_host_test",
binary_name = "package-tool_test",
test_data = [
"//src/developer/ffx/lib/pkg:empty-repo-keys",
"//src/developer/ffx/lib/pkg:empty-repo-metadata",
],
)