blob: a5c761a41f4076131b66aff59aa1488609b8a1da [file] [log] [blame]
# Copyright 2023 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.
import("//build/rust/rustc_library.gni")
platform_sources = [
"src/fuchsia.rs",
"src/fuchsia/component.rs",
"src/fuchsia/debug.rs",
"src/fuchsia/device.rs",
"src/fuchsia/directory.rs",
"src/fuchsia/dirent_cache.rs",
"src/fuchsia/errors.rs",
"src/fuchsia/file.rs",
"src/fuchsia/fxblob.rs",
"src/fuchsia/fxblob/atomic_vec.rs",
"src/fuchsia/fxblob/blob.rs",
"src/fuchsia/fxblob/directory.rs",
"src/fuchsia/fxblob/reader.rs",
"src/fuchsia/fxblob/testing.rs",
"src/fuchsia/fxblob/writer.rs",
"src/fuchsia/memory_pressure.rs",
"src/fuchsia/node.rs",
"src/fuchsia/paged_object_handle.rs",
"src/fuchsia/pager.rs",
"src/fuchsia/profile.rs",
"src/fuchsia/remote_crypt.rs",
"src/fuchsia/symlink.rs",
"src/fuchsia/testing.rs",
"src/fuchsia/volume.rs",
"src/fuchsia/volumes_directory.rs",
]
platform_deps = [
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust",
"//sdk/fidl/fuchsia.fs:fuchsia.fs_rust",
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_rust",
"//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//sdk/fidl/fuchsia.memory.attribution:fuchsia.memory.attribution_rust",
"//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_rust",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust",
"//sdk/rust/zx",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component/client",
"//src/lib/fuchsia-sync",
"//src/performance/memory/attribution/refaults_vmo",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_rust",
"//src/storage/fxfs:fxfs_macros",
"//src/storage/fxfs:lib",
"//src/storage/fxfs/crypto",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/storage/fxfs/trace",
"//src/storage/lib/block_client/rust",
"//src/storage/lib/delivery_blob",
"//src/storage/lib/fs_inspect",
"//src/storage/lib/storage_device",
"//src/storage/lib/vfs/rust:vfs_static",
"//src/sys/pkg/lib/fuchsia-hash",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:arrayref",
"//third_party/rust_crates:async-channel",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:base64",
"//third_party/rust_crates:bincode",
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:either",
"//third_party/rust_crates:event-listener",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:linked-hash-map",
"//third_party/rust_crates:log",
"//third_party/rust_crates:rustc-hash",
"//third_party/rust_crates:scopeguard",
"//third_party/rust_crates:zstd",
"//third_party/zstd",
]
rustc_library("platform") {
edition = "2024"
with_unit_tests = true
name = "fxfs-platform"
deps = []
sources = [ "src/lib.rs" ]
test_deps = []
if (is_fuchsia) {
sources += platform_sources
deps += platform_deps
test_deps += [
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia",
"//src/lib/fuchsia-fs",
"//src/lib/test_util",
"//src/storage/blobfs/bin:blobfs-component",
"//src/storage/crypt/fxfs:lib",
"//src/storage/fxfs:lib",
"//src/storage/fxfs/crypto/insecure",
"//src/storage/lib/blob_writer:blob-writer",
"//src/storage/lib/block_protocol",
"//src/storage/lib/block_server:vmo_backed_block_server",
"//src/storage/lib/fs_management/rust:fs_management",
"//src/storage/lib/fsverity-merkle",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:rand",
]
# The test requires more than typical memory,
# so remote-build with a larger worker.
_concurrent_jobs = concurrent_jobs.rust_highmem
test_configs = _concurrent_jobs.configs
test_vars = _concurrent_jobs.vars
}
visibility = [ "//src/storage/fxfs/*" ]
}
rustc_library("fxfs-testing") {
testonly = true
edition = "2024"
features = [ "testing" ]
sources = platform_sources + [ "src/testing.rs" ]
source_root = "src/testing.rs"
deps = platform_deps + [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/rust/zx",
"//src/lib/fidl/rust/fidl",
"//src/storage/fxfs:lib",
"//src/storage/fxfs/crypto",
"//src/storage/fxfs/crypto/insecure",
"//src/storage/lib/storage_device",
"//src/storage/lib/vfs/rust:vfs_static",
"//third_party/rust_crates:anyhow",
]
visibility = [
"//sdk/lib/zxio/tests/*",
"//src/starnix/kernel/*",
"//src/storage/conformance/conformance_harness/fxfs/*",
"//src/storage/fxfs/*",
]
}