| # 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/rust:rustc_library.bzl", "rustc_library") | |
| 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_library( | |
| name = "registry", | |
| srcs = ["registry.rs"], | |
| crate_name = "starnix_module_registry", | |
| crate_root = "registry.rs", | |
| edition = "2024", | |
| lint_config = "//src/starnix/build:kernel_library_config", | |
| version = "0.1.0", | |
| visibility = [ | |
| "//src/starnix/kernel:__subpackages__", | |
| "//src/starnix/modules:__subpackages__", | |
| "//vendor/google:__subpackages__", | |
| ], | |
| deps = [ | |
| "//src/lib/diagnostics/inspect/rust", | |
| "//src/starnix/kernel/core", | |
| "//third_party/rust_crates/vendor:anyhow", | |
| "//third_party/rust_crates/vendor:bstr", | |
| ], | |
| ) | |
| rustc_test( | |
| name = "registry_test", | |
| crate = ":registry", | |
| lint_config = "//src/starnix/config:starnix_clippy_lints_test", | |
| # TODO(https://fxbug.dev/42059075): Re-enable starnix in these environments. | |
| tags = [ | |
| "exclude_toolchain_tags=asan", | |
| "exclude_toolchain_tags=hwasan", | |
| "manual", | |
| ], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = ["//src/lib/fuchsia"], | |
| ) | |
| fx_unittest_package( | |
| name = "starnix_module_registry-tests", | |
| # TODO(https://fxbug.dev/42059075): Re-enable starnix in these environments. | |
| # @bazel2gn:skip | |
| build_only = select({ | |
| "//build/bazel/config/variant_features/asan:true": True, | |
| "//build/bazel/config/variant_features/hwasan:true": True, | |
| "//conditions:default": False, | |
| }), | |
| unit_tests = [":registry_test"], | |
| ) |