| # 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:defs.bzl", "rustc_library") | |
| package(default_applicable_licenses = ["//:license"]) | |
| # NOTE: `mem_util_test` and `mem_util_tests` remain in BUILD.gn above the | |
| # sentinel because `mem_util_test` depends on `//src/storage/lib/vfs/rust:vfs` | |
| # (`rustc_dylib("vfs_dylib")`). `@rules_rust` puts both | |
| # `src/storage/lib/vfs/rust/libvfs-<hash>.so` and its `_solib_*` symlink into | |
| # `default_runfiles` when a `rustc_test` lists `vfs` in `deps`, causing | |
| # `fx_packaged_binary` + `fx_package` to fail with: | |
| # "Multiple files are being installed into the package at lib/libvfs-<hash>.so". | |
| rustc_library( | |
| name = "mem_util", | |
| srcs = ["src/lib.rs"], | |
| edition = "2024", | |
| lint_config = "//build/config/rust/lints:clippy_warn_all", | |
| visibility = [ | |
| "//src/devices/bin/driver-index:__pkg__", | |
| "//src/lib/fuchsia-component-test/realm_builder_server:__pkg__", | |
| "//src/sys/component_manager:__pkg__", | |
| "//src/sys/lib/routing:__pkg__", | |
| "//src/sys/pkg/bin/pkg-resolver:__pkg__", | |
| "//src/sys/pkg/tests/pkg-cache:__pkg__", | |
| "//src/sys/test_manager:__pkg__", | |
| ], | |
| deps = [ | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem_rust", | |
| "//sdk/rust/zx-status", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-fs", | |
| "//third_party/rust_crates/vendor:log", | |
| "//third_party/rust_crates/vendor:thiserror", | |
| ], | |
| ) |