blob: 13d19fec2f6620154f86952fb518d0bc89ca4d0f [file]
# 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")
rustc_library("platform") {
edition = "2021"
with_unit_tests = true
name = "fxfs-platform"
deps = []
sources = [ "src/lib.rs" ]
test_deps = []
if (is_fuchsia) {
sources += [
"src/fuchsia.rs",
"src/fuchsia/component.rs",
"src/fuchsia/device.rs",
"src/fuchsia/directory.rs",
"src/fuchsia/errors.rs",
"src/fuchsia/file.rs",
"src/fuchsia/fxblob.rs",
"src/fuchsia/fxblob/blob.rs",
"src/fuchsia/fxblob/directory.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/remote_crypt.rs",
"src/fuchsia/symlink.rs",
"src/fuchsia/testing.rs",
"src/fuchsia/vmo_data_buffer.rs",
"src/fuchsia/volume.rs",
"src/fuchsia/volumes_directory.rs",
]
deps += [
"//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.kernel:fuchsia.kernel_rust",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_rust",
"//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_rust",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/storage/block_client/rust:remote-block-device",
"//src/lib/storage/fs_inspect",
"//src/lib/storage/storage_device",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/trace/rust:trace",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_rust",
"//src/storage/fxfs:lib",
"//src/storage/fxfs/crypto",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/sys/pkg/lib/fuchsia-hash",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//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:lazy_static",
"//third_party/rust_crates:once_cell",
"//third_party/rust_crates:scopeguard",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:zstd",
"//third_party/zstd",
]
if (is_debug) {
deps += [ "//zircon/system/ulib/backtrace-request/rust" ]
}
test_deps += [
"//sdk/fidl/fuchsia.device:fuchsia.device_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/storage/fs_management/rust:fs_management",
"//src/lib/storage/ramdevice_client/rust:ramdevice_client",
"//src/storage/bin/blobfs:blobfs-component",
"//src/storage/fxfs:lib",
"//src/storage/fxfs-crypt:lib",
"//src/storage/fxfs/crypto/insecure",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:rand",
]
}
features = [ "tracing" ]
visibility = [ "//src/storage/fxfs/*" ]
}
rustc_library("fxfs-testing") {
testonly = true
edition = "2021"
sources = [
"src/fuchsia/testing.rs",
"src/testing.rs",
]
source_root = "src/testing.rs"
deps = [
":platform",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/storage/storage_device",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/fxfs:lib",
"//src/storage/fxfs/crypto/insecure",
"//third_party/rust_crates:anyhow",
]
features = [ "tracing" ]
visibility = [
"//sdk/lib/zxio/tests/*",
"//src/starnix/kernel/*",
"//src/storage/conformance/conformance_harness/fxfs/*",
"//src/storage/fxfs/*",
]
}