blob: 55085c87161670d6ce00867e254a097c24104646 [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/components:fx_component.bzl",
"fx_component",
"fx_component_manifest",
)
load("//build/bazel/rules/packages:fx_package.bzl", "fx_package")
load(
"//build/bazel/rules/packages:fx_packaged_binary.bzl",
"fx_packaged_binary",
)
load("//build/bazel/rules/rust:rustc_binary.bzl", "rustc_binary")
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"])
test_suite(
name = "tests",
tests = [":sys_shell_tests"],
visibility = ["//src/developer:__pkg__"],
)
rustc_binary(
name = "sys_shell_bin",
srcs = ["shell.rs"],
binary_name = "sys-info",
crate_root = "shell.rs",
edition = "2024",
tags = ["manual"],
deps = [
"//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_rust",
"//sdk/rust/zx",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:futures",
],
)
fx_packaged_binary(
name = "sys_shell_packaged_bin",
binary = ":sys_shell_bin",
binary_name = "sys-info",
)
fx_component_manifest(
name = "sys-info-shell-manifest",
component_name = "sys-info-shell",
includes = ["//sdk/lib/syslog:client.shard"],
manifest = "meta/sys_info_shell.cml",
)
fx_component(
name = "sys-info-shell-component",
compiled_manifest = ":sys-info-shell-manifest",
deps = [":sys_shell_packaged_bin"],
)
fx_package(
name = "sys-info-shell",
components = [":sys-info-shell-component"],
)
# test-parity-allow-manual: Inner test binary wrapped by :sys_shell_tests.
rustc_test(
name = "sys_shell_bin_test",
crate = ":sys_shell_bin",
tags = ["manual"],
target_compatible_with = ["@platforms//os:fuchsia"],
)
fx_unittest_package(
name = "sys_shell_tests",
unit_tests = [":sys_shell_bin_test"],
)