| # 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/rust:rustc_library.bzl", "rustc_library") | |
| package(default_applicable_licenses = ["//:license"]) | |
| rustc_library( | |
| name = "lib", | |
| srcs = [ | |
| "src/analytics.rs", | |
| "src/cache.rs", | |
| "src/connection.rs", | |
| "src/error.rs", | |
| "src/fdomain_transport.rs", | |
| "src/fidl_pipe.rs", | |
| "src/info.rs", | |
| "src/lib.rs", | |
| "src/list.rs", | |
| "src/registry.rs", | |
| "src/resolve.rs", | |
| "src/ssh_connector.rs", | |
| "src/store.rs", | |
| "src/target_connector.rs", | |
| "src/uart_connector.rs", | |
| "src/usb_connector.rs", | |
| "src/vsock_connector.rs", | |
| ], | |
| crate_name = "ffx_target", | |
| edition = "2024", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = [ | |
| "//src/developer/ffx:__subpackages__", | |
| "//src/developer/fuchsia-controller:__pkg__", | |
| ], | |
| deps = [ | |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust", | |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust_fdomain", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust_fdomain", | |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", | |
| "//src/connectivity/overnet/lib/circuit", | |
| "//src/connectivity/overnet/lib/core", | |
| "//src/developer/ffx/command/error:lib", | |
| "//src/developer/ffx/config:lib", | |
| "//src/developer/ffx/fidl:fuchsia.developer.ffx_rust", | |
| "//src/developer/ffx/lib/addr:lib", | |
| "//src/developer/ffx/lib/diagnostics/analytics:lib", | |
| "//src/developer/ffx/lib/diagnostics/formatting:lib", | |
| "//src/developer/ffx/lib/discovery:lib", | |
| "//src/developer/ffx/lib/errors:lib", | |
| "//src/developer/ffx/lib/futures:lib", | |
| "//src/developer/ffx/lib/manual_targets:lib", | |
| "//src/developer/ffx/lib/netext:lib", | |
| "//src/developer/ffx/lib/rcs:lib", | |
| "//src/developer/ffx/lib/ssh:lib", | |
| "//src/developer/ffx/lib/target_errors:lib", | |
| "//src/developer/ffx/lib/timeout:lib", | |
| "//src/developer/ffx/lib/uart_driver_api:lib", | |
| "//src/developer/ffx/lib/usb_driver_api:lib", | |
| "//src/lib/analytics/rust:lib", | |
| "//src/lib/fdomain/client", | |
| "//src/lib/fdomain/local", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/versioning/version-history/rust/data", | |
| "//third_party/rust_crates/vendor:anyhow", | |
| "//third_party/rust_crates/vendor:async-channel", | |
| "//third_party/rust_crates/vendor:async-lock", | |
| "//third_party/rust_crates/vendor:chrono", | |
| "//third_party/rust_crates/vendor:futures", | |
| "//third_party/rust_crates/vendor:futures-lite", | |
| "//third_party/rust_crates/vendor:log", | |
| "//third_party/rust_crates/vendor:nix", | |
| "//third_party/rust_crates/vendor:serde", | |
| "//third_party/rust_crates/vendor:serde_json", | |
| "//third_party/rust_crates/vendor:tempfile", | |
| "//third_party/rust_crates/vendor:thiserror", | |
| "//third_party/rust_crates/vendor:tokio", | |
| ], | |
| ) | |
| host_rustc_test( | |
| name = "lib_test", | |
| crate = ":lib", | |
| crate_name = "ffx_target_lib_test", | |
| edition = "2024", | |
| # These tests require a second host network interface (scope ID %2) and | |
| # AF_VSOCK kernel support, which are unavailable in the RBE test sandbox. | |
| test_args = [ | |
| "--skip=list::test::test_merge_target_usb_with_serial_and_mdns_without_serial_no_bootid", | |
| "--skip=vsock_connector::tests::test_do_connect_unconnected_cid_does_not_succeed_prematurely", | |
| ], | |
| visibility = ["//src/developer/ffx:__pkg__"], | |
| deps = [ | |
| "//src/lib/fuchsia", | |
| "//third_party/rust_crates/vendor:mockall", | |
| "//third_party/rust_crates/vendor:pretty_assertions", | |
| ], | |
| ) |