blob: e7f40c3eb9109ce8c3b0efb1977ce5108f99ec0f [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"])
rustc_binary(
name = "bin",
srcs = ["src/main.rs"],
binary_name = "vsock-loopback",
edition = "2024",
tags = ["manual"],
deps = [
"//sdk/fidl/fuchsia.hardware.vsock:fuchsia.hardware.vsock_rust",
"//sdk/rust/zx",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:futures",
"//third_party/rust_crates/vendor:log",
"//third_party/rust_crates/vendor:thiserror",
],
)
fx_packaged_binary(
name = "bin_packaged",
binary = ":bin",
binary_name = "vsock-loopback",
)
fx_component_manifest(
name = "manifest",
component_name = "vsock-loopback",
includes = [
"//sdk/lib/inspect:client.shard",
"//sdk/lib/syslog:client.shard",
],
manifest = "meta/vsock_loopback.cml",
)
fx_component(
name = "component",
compiled_manifest = ":manifest",
visibility = ["//src/paravirtualization:__subpackages__"],
deps = [":bin_packaged"],
)
fx_package(
name = "package",
package_name = "vsock-loopback",
components = [":component"],
)
rustc_test(
name = "vsock_loopback_bin_test",
crate = ":bin",
)
fx_unittest_package(
name = "vsock-loopback-unittests",
unit_tests = [":vsock_loopback_bin_test"],
visibility = ["//src/paravirtualization:__pkg__"],
)