blob: 0f6275c1d690e7003f80641393ab4b3ff221adb0 [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 = [":identify-host-tests"],
visibility = ["//src/developer:__pkg__"],
)
rustc_binary(
name = "bin",
srcs = [
"src/args.rs",
"src/format.rs",
"src/main.rs",
],
binary_name = "identify-host",
edition = "2024",
visibility = ["//src/developer/remote-control:__pkg__"],
deps = [
"//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/sys/lib/component_debug",
"//src/sys/lib/moniker",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:serde",
"//third_party/rust_crates/vendor:serde_json",
],
)
rustc_test(
name = "identify_host_bin_test",
crate = ":bin",
target_compatible_with = ["@platforms//os:fuchsia"],
deps = [
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//third_party/rust_crates/vendor:futures",
],
)
fx_unittest_package(
name = "identify-host-tests",
unit_tests = [":identify_host_bin_test"],
)
fx_packaged_binary(
name = "identify_host_packaged_bin",
binary = ":bin",
binary_name = "identify-host",
)
fx_component_manifest(
name = "manifest",
component_name = "identify-host",
includes = ["//sdk/lib/syslog:client.shard"],
manifest = "meta/identify_host.cml",
)
fx_component(
name = "component",
compiled_manifest = ":manifest",
deps = [":identify_host_packaged_bin"],
)
fx_package(
name = "package",
package_name = "identify-host",
components = [":component"],
)