blob: 77725b59c0ad8b5e29594b113e110048413fe3ab [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", "host_rustc_test")
load("//build/bazel/rules/idk:idk_ffx_tool.bzl", "idk_ffx_tool")
load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library")
package(default_applicable_licenses = ["//:license"])
test_suite(
name = "host_tests",
tests = [":ffx_process_test"],
visibility = ["//src/developer/ffx:__pkg__"],
)
rustc_library(
name = "ffx_process_args",
srcs = ["src/args.rs"],
crate_root = "src/args.rs",
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
deps = ["//third_party/rust_crates/vendor:argh"],
)
rustc_library(
name = "ffx_process",
srcs = [
"src/fuchsia_map.rs",
"src/lib.rs",
"src/processes_data.rs",
"src/write_human_readable_output.rs",
],
edition = "2024",
target_compatible_with = HOST_OS_CONSTRAINTS,
deps = [
":ffx_process_args",
"//sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_rust_fdomain",
"//sdk/fidl/fuchsia.process.explorer:fuchsia.process.explorer_rust_fdomain",
"//sdk/rust/zx-status",
"//sdk/rust/zx-types",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/fho:lib",
"//src/developer/ffx/lib/symbol-index:lib",
"//src/developer/ffx/lib/target/holders:lib",
"//src/developer/ffx/lib/writer:lib",
"//src/lib/fdomain/client",
"//third_party/rust_crates/vendor:anyhow",
"//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",
],
)
# LINT.IfChange
idk_ffx_tool(
name = "ffx_process_tool",
srcs = ["src/main.rs"],
category = "partner",
edition = "2024",
idk_name = "ffx-process",
deps = [
":ffx_process",
"//src/developer/ffx/lib/fho:lib",
"//src/lib/fuchsia-async",
],
)
# LINT.ThenChange(BUILD.gn)
host_rustc_test(
name = "ffx_process_test",
crate = ":ffx_process",
deps = [
"//src/lib/fdomain/local",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//third_party/rust_crates/vendor:pretty_assertions",
],
)