blob: 3e7d2ab814187a4cfc979b6e16a0b35d2f497d8c [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/rust:rustc_library.bzl", "rustc_library")
load("//build/bazel/rules/rust:rustc_test.bzl", "rustc_test")
load("//build/bazel/rules/testing:fx_unittest_package.bzl", "fx_unittest_package")
package(default_applicable_licenses = ["//:license"])
# `pkgctl` is conceptually a binary, but it built as a lib here so it can be
# aggregated into //src/sys/pkg/bin/multi-universal-tool to save disk space.
rustc_library(
name = "lib",
srcs = [
"src/args.rs",
"src/main.rs",
],
crate_name = "pkgctl",
crate_root = "src/main.rs",
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
visibility = ["//src/sys/pkg/bin/multi-universal-tool:__pkg__"],
deps = [
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust",
"//sdk/fidl/fuchsia.pkg.garbagecollector:fuchsia.pkg.garbagecollector_rust",
"//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite_rust",
"//sdk/rust/zx",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-url",
"//src/sys/lib/fidl-fuchsia-pkg-ext",
"//src/sys/lib/fidl-fuchsia-pkg-rewrite-ext",
"//src/sys/pkg/lib/fetch-url",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:futures",
"//third_party/rust_crates/vendor:serde_json",
],
)
# @bazel2gn:skip
rustc_test(
name = "lib_test",
crate = ":lib",
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
visibility = ["//visibility:private"],
deps = [
"//third_party/rust_crates/vendor:assert_matches",
],
)
# @bazel2gn:skip
fx_unittest_package(
name = "pkgctl-tests",
unit_tests = [":lib_test"],
)