-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
187 lines (166 loc) · 5.4 KB
/
Copy pathCargo.toml
File metadata and controls
187 lines (166 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
[workspace]
members = ["benchmarks/engine-comparison"]
default-members = ["."]
resolver = "3"
[package]
name = "pagedb"
version = "0.1.0"
edition = "2024"
rust-version = "1.85"
license = "MIT OR Apache-2.0"
description = "Encrypted, portable, embedded page store with B+ tree and segment-file surfaces."
repository = "https://github.com/nodedb-lab/pagedb"
homepage = "https://github.com/nodedb-lab/pagedb"
documentation = "https://docs.rs/pagedb"
readme = "README.md"
keywords = ["database", "encryption", "storage", "btree", "embedded"]
categories = ["database-implementations", "cryptography", "embedded"]
authors = ["Farhan Syah"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lib]
# Benchmarking goes through the `harness = false` fluxbench targets below;
# the default libtest harness must not also build one for the lib.
bench = false
[dependencies]
# Production black-box recorder — corruption/invariant reports with a
# breadcrumb flight recorder. Optional + behind `diagnostics` (see [features]);
# the real `diag` impl is additionally gated off wasm32 so OPFS builds stay lean.
faultbox = { version = "0.1.0", optional = true }
aes-gcm = "0.10"
chacha20poly1305 = "0.10"
hkdf = "0.12"
hmac = "0.12"
sha2 = "0.10"
subtle = "2.6"
zeroize = { version = "1.8", features = ["zeroize_derive"] }
thiserror = "2"
bytes = "1"
tracing = "0.1"
parking_lot = "0.12"
rayon = "1"
rustc-hash = "2"
# `std` is required (not just `js`): `PagedbError::Randomness(#[from]
# getrandom::Error)` relies on `getrandom::Error: std::error::Error`, which
# getrandom only provides under `std`. In the workspace a sibling crate enabled
# `std` via feature unification, masking the gap — published standalone, pagedb
# must declare the feature it actually uses.
getrandom = { version = "0.2", features = ["js", "std"] }
# tokio's `rt-multi-thread` and `fs` features are not supported on
# `wasm32-unknown-unknown`. Split per target so OPFS builds compile.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
version = "1"
features = ["rt", "rt-multi-thread", "macros", "sync", "io-util", "fs", "time"]
[target.'cfg(target_arch = "wasm32")'.dependencies.tokio]
version = "1"
features = ["rt", "macros", "sync", "io-util", "time"]
[target.'cfg(unix)'.dependencies]
libc = "0.2"
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = [
"Win32_Foundation",
"Win32_Storage_FileSystem",
"Win32_System_IO",
"Win32_System_Threading",
] }
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
dispatch2 = "0.3"
block2 = "0.6"
libc = "0.2"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tempfile = "3"
memmap2 = "0.9"
lz4_flex = { version = "0.13", optional = true, default-features = false, features = [
"safe-encode",
"safe-decode",
] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
js-sys = { version = "0.3", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde-wasm-bindgen = { version = "0.6", optional = true }
send_wrapper = { version = "0.6", optional = true }
futures = { version = "0.3", optional = true, default-features = false, features = [
"alloc",
] }
web-sys = { version = "0.3", optional = true, features = [
"FileSystemDirectoryHandle",
"FileSystemFileHandle",
"FileSystemSyncAccessHandle",
"FileSystemGetFileOptions",
"FileSystemRemoveOptions",
"StorageManager",
"Navigator",
"Worker",
"WorkerOptions",
"WorkerType",
"MessageEvent",
"ErrorEvent",
] }
[target.'cfg(any(target_os = "linux", all(target_os = "android", not(target_arch = "arm"))))'.dependencies]
io-uring = "0.7"
[features]
default = ["diagnostics"]
# Emit black-box reports (corruption, read-verify failures) and operation
# breadcrumbs via the `faultbox` crate. Inert until the host application calls
# `faultbox::init`; a no-op on wasm32 regardless.
diagnostics = ["dep:faultbox"]
compression = ["dep:lz4_flex"]
opfs = [
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
"dep:js-sys",
"dep:web-sys",
"dep:serde",
"dep:serde-wasm-bindgen",
"dep:send_wrapper",
"dep:futures",
]
[dev-dependencies]
tokio = { version = "1", features = [
"rt",
"rt-multi-thread",
"macros",
"test-util",
] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
tempfile = "3"
aes-gcm = "0.10"
fluxbench = "0.1"
# Generated adversarial input for the decoders and the structural walks. Runs
# inside the normal `cargo nextest` suite on every Tier-1 target, which is why
# it is proptest and not a nightly-only libFuzzer harness. Dev-only: it must
# never reach the published surface or the default feature set.
proptest = "1.11"
[[bin]]
name = "pagedb-fsck"
path = "src/bin/pagedb-fsck/main.rs"
bench = false
# These are executable benchmarks, not test harnesses. The cross-engine suite
# is a separate non-default workspace package so normal PageDB tests never
# resolve its RocksDB, redb, or SQLite dependencies.
[[bench]]
name = "segment"
harness = false
test = false
[[bench]]
name = "compaction"
harness = false
test = false
[[bench]]
name = "authenticated_node_read"
harness = false
test = false
[[bench]]
name = "read_path"
harness = false
test = false
[[bench]]
name = "write_path"
harness = false
test = false
[profile.release]
lto = "thin"
codegen-units = 1