| # 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_manifest", |
| "fx_test_component", |
| ) |
| 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:defs.bzl", "rustc_library") |
| load("//build/bazel/rules/testing:fx_test.bzl", "fx_test") |
| |
| package(default_applicable_licenses = ["//:license"]) |
| |
| rustc_library( |
| name = "runtime", |
| srcs = ["src/lib.rs"], |
| crate_name = "fuchsia_component_runtime", |
| edition = "2024", |
| # @bazel2gn:skip |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates/vendor:assert_matches", |
| ], |
| visibility = ["//src/lib/fuchsia-component:__subpackages__"], |
| # @bazel2gn:skip |
| with_unit_tests = True, |
| deps = [ |
| "//sdk/fidl/fuchsia.component.runtime:fuchsia.component.runtime_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/rust/zx", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-component/client", |
| "//third_party/rust_crates/vendor:futures", |
| ], |
| ) |
| |
| # @bazel2gn:skip |
| fx_packaged_binary( |
| name = "runtime_test_packaged_bin", |
| testonly = True, |
| binary = ":runtime_test", |
| binary_name = "fuchsia_component_runtime_lib_test", |
| ) |
| |
| # @bazel2gn:skip |
| fx_component_manifest( |
| name = "fuchsia-component-runtime-unittests-manifest", |
| testonly = True, |
| component_name = "fuchsia-component-runtime-unittests", |
| includes = [ |
| "//sdk/lib/syslog:client.shard.cml", |
| "//sdk/lib/syslog:offer.shard.cml", |
| "//sdk/lib/syslog:use.shard.cml", |
| "//src/sys/test_runners/rust:default.shard.cml", |
| ], |
| manifest = "meta/fuchsia-component-runtime-unittests.cml", |
| ) |
| |
| # @bazel2gn:skip |
| fx_test_component( |
| name = "fuchsia-component-runtime-unittests-component", |
| compiled_manifest = ":fuchsia-component-runtime-unittests-manifest", |
| component_name = "fuchsia-component-runtime-unittests", |
| deps = [":runtime_test_packaged_bin"], |
| ) |
| |
| # @bazel2gn:skip |
| fx_package( |
| name = "fuchsia-component-runtime-unittests-package", |
| package_name = "fuchsia-component-runtime-unittests", |
| test_components = [":fuchsia-component-runtime-unittests-component"], |
| ) |
| |
| # @bazel2gn:skip |
| fx_test( |
| name = "fuchsia-component-runtime-unittests", |
| package = ":fuchsia-component-runtime-unittests-package", |
| ) |