Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
264 lines (255 loc) · 12.4 KB
/
Copy pathCargo.toml
File metadata and controls
264 lines (255 loc) · 12.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
[workspace]
resolver = "2"
members = [
"vk-core",
"vk-driver",
"vk-agent",
"vk-fs",
"vk-registry",
"vk-hub-proto",
"vk-peer",
"vk-oidc",
"vk-hub",
"vk-gitlab",
"vk-runnerctl",
"vk-selfupdate",
"vk-tpm",
"vk-uefi-vars",
"bench",
"vk-testkit",
]
# third_party/libkrun is upstream libkrun's own cargo workspace (the 2.0 development branch),
# vendored and locally patched (see third_party/libkrun/VENDOR.md). vk-driver depends on its
# `libkrun` crate by path; excluding it here keeps the two workspaces from merging.
#
# third_party/imago is a single vendored leaf crate (see third_party/imago/VENDOR.md), a
# dependency of third_party/libkrun's block device — excluded for the same reason.
exclude = [
"third_party/libkrun",
"third_party/imago",
"third_party/ipstack",
]
[workspace.package]
version = "0.112.0"
edition = "2024"
authors = [
"Vincent Vanackere <vincent.vanackere@gmail.com>",
"Vincent Vanackere <vvanackere@wallix.com>",
"WALLIX",
]
license = "Apache-2.0"
# Fast local builds: keep file:line backtraces for workspace crates, but omit the
# variable/type debuginfo that slows code generation and linking. Dependencies need no
# debuginfo in the normal edit loop. Opt into the full-debug profile when debugging.
[profile.dev]
debug = "line-tables-only"
[profile.dev.package."*"]
debug = false
# Optimize vk-tpm's crypto and zeroize's state wiping in the dev profile: unoptimized, they
# made vk-tpm's tests about twice as slow. Dev profile only: release builds are unchanged.
[profile.dev.package.rsa]
opt-level = 3
[profile.dev.package.crypto-bigint]
opt-level = 3
[profile.dev.package.crypto-primes]
opt-level = 3
[profile.dev.package.p256]
opt-level = 3
[profile.dev.package.primeorder]
opt-level = 3
[profile.dev.package.elliptic-curve]
opt-level = 3
[profile.dev.package.ecdsa]
opt-level = 3
[profile.dev.package.sha1]
opt-level = 3
[profile.dev.package.sha2]
opt-level = 3
[profile.dev.package.aes]
opt-level = 3
[profile.dev.package.cfb-mode]
opt-level = 3
[profile.dev.package.hmac]
opt-level = 3
[profile.dev.package.zeroize]
opt-level = 3
# `inherits` also carries the inherited profile's per-package overrides, so the dev
# profile's `debug = false` for dependencies has to be undone explicitly here —
# otherwise no dependency frame resolves in the one profile meant for debugging.
[profile.debugging]
inherits = "dev"
debug = true
[profile.debugging.package."*"]
debug = true
# Reproducible release builds: strip inside the toolchain (not the host strip).
# Path-independence comes from --remap-path-prefix / -ffile-prefix-map applied at
# build time (see build.sh), since trim-paths is not yet stabilized in this toolchain.
#
# lto + a single codegen unit trade compile time for smaller, faster binaries
# (cross-crate inlining + dead-code elimination); both also make the output more
# deterministic, which the reproducible-build guarantee wants anyway.
[profile.release]
strip = true
lto = "thin"
codegen-units = 1
# Single source of truth for dependency versions. Members reference these with
# `<dep>.workspace = true` and only add the per-crate features they need.
[workspace.dependencies]
anyhow = "1"
# wrap_help wraps help text at the terminal width (adds only `terminal_size`; rustix is
# already in the tree) — `vk run -h` lists 60 options and soft-wrapping them mid-word is
# what makes it unreadable.
clap = { version = "4", features = ["derive", "wrap_help"] }
futures = "0"
libc = "0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# compose-subset parsing for `vk run --compose` (safe-Rust YAML parser)
serde-saphyr = { version = "2", default-features = false, features = ["deserialize"] }
# read a `docker export` stream and transcode it into a cpio initramfs (cpio.rs)
tar = "0.4"
# pull OCI images straight from a registry (no docker daemon); rustls so the
# binary stays musl-static (no openssl). flate2 gunzips the layer tars.
#
# No tls feature: oci-client's `rustls-tls` would pin reqwest to the aws-lc-rs provider,
# pulling the aws-lc-sys C blob alongside the ring backend russh already uses. We wire
# reqwest (rustls + ring) directly below instead, so a single crypto backend is linked.
# oci-client builds its reqwest client from whatever TLS reqwest compiled, so HTTPS
# still works.
oci-client = { version = "0.18", default-features = false }
flate2 = "1"
# docker-hash: content hashing of a (Dockerfile, stage) for image-tag resolution
sha2 = "0.11"
# vk-tpm's SHA-1 PCR bank (TPM 2.0 keeps one for compatibility). RustCrypto, like sha2; already
# in the tree via russh.
sha1 = "0.11"
# vk-tpm: the TPM's entropy (TPM2_GetRandom, its seeds) from the OS. Already in the tree via rand.
getrandom = "0.4"
# vk-tpm: constant-time comparison of authorization values. Already in the tree via the
# RustCrypto crates.
subtle = "2"
# vk-tpm: wipe the TPM's seeds and secrets when they are dropped. Already in the tree via the
# RustCrypto crates.
zeroize = "1"
# vk-tpm: the tickets the TPM signs with its proofs (and, later, sessions and KDFa).
# RustCrypto; already in the tree via russh and rustls.
hmac = { version = "0.13", features = ["zeroize"] }
# vk-tpm: AES-CFB parameter encryption (and, later, symmetric keys). AES is already in the tree via
# russh; cfb-mode is RustCrypto's CFB mode over it, a few hundred lines with no other dependency.
aes = "0.9"
cfb-mode = { version = "0.9", features = ["zeroize"] }
# vk-tpm: RSA keys (EK, SRK, BitLocker, PCP KSP). RustCrypto; already in the tree via russh. The
# release candidate on constant-time crypto-bigint, not 0.9: RUSTSEC-2023-0071 (Marvin) is fixed
# there (.cargo/audit.toml). `hazmat` for the raw RSA a TPM offers (TPM_ALG_NULL padding).
rsa = { version = "0.10.0-rc.18", default-features = false, features = ["std", "hazmat"] }
# vk-tpm: the prime search of deterministic RSA primary keys, and big-integer arithmetic the
# reference implementation specifies (the ECC private scalar of a primary). Both already in the
# tree via rsa.
crypto-bigint = { version = "0.7", default-features = false, features = ["alloc", "zeroize"] }
crypto-primes = { version = "0.7", default-features = false }
# vk-tpm: NIST P-256 keys, ECDSA and ECDH. RustCrypto; already in the tree via russh and rustls.
p256 = { version = "0.14", default-features = false, features = ["arithmetic", "ecdsa", "std"] }
ecdsa = { version = "0.17", default-features = false, features = ["algorithm", "std"] }
# native OCI bundle store (registry.rs): content-defined chunking of runner.ext4 for
# block-level dedup, each chunk zstd-compressed independently. fastcdc is pure Rust;
# zstd vendors its C (gcc/musl-dev are in the build image), so the binary stays
# musl-static.
fastcdc = "5"
zstd = "0.14"
# .ko.xz kernel-module decompression for `vk run --kernel image` (fullvm): pure Rust,
# so it needs no C liblzma and the binary stays musl-static (zstd/gz are covered by the
# crates above).
lzma-rs = "0.3"
# The xz payload of a distribution kernel (bzImage) uses the x86 BCJ filter, which lzma-rs
# does not decode: lzma-rust2 does, in pure Rust too. The decoder alone ("encoder" is for
# tests).
lzma-rust2 = { version = "0.25", default-features = false, features = ["std", "xz"] }
# tokio features are member-specific; only the version is pinned here.
tokio = { version = "1" }
# vk-gitlab notes SIGTERM and SIGINT the moment they arrive, beside tokio's own handling
# (already in the tree through tokio's `signal`).
signal-hook-registry = "1"
toml = "1"
# the `vk-registry` OCI-distribution server: a minimal v2 distribution API over hyper
# (already in the tree via oci-client). Pure Rust, so the binary stays musl-static.
hyper = { version = "1", features = ["server", "http1"] }
hyper-util = { version = "0.1", features = ["tokio"] }
http-body-util = "0.1"
# IMF-fixdate for the registry's WebDAV `Last-Modified`/`getlastmodified`; already in the tree
# via hyper.
httpdate = "1"
bytes = "1"
# direct HTTP client for the transparent-zstd blob push (oci-client can't set a
# per-request Content-Encoding). rustls so the binary stays musl-static (matches
# oci-client); already in the tree via oci-client.
#
# `rustls-no-provider` compiles rustls without a built-in crypto provider (the plain
# `rustls` feature would force aws-lc-rs); main installs the ring provider as the
# process default. json/stream are pulled in by oci-client too, kept here explicitly.
reqwest = { version = "0.13", default-features = false, features = ["rustls-no-provider", "json", "query", "stream"] }
# rustls with the ring provider only (default features would pull aws-lc-rs). Ties
# the whole reqwest/oci-client TLS stack to ring; the provider is installed in main.
rustls = { version = "0.23", default-features = false, features = ["ring", "tls12", "logging", "std"] }
# the `switch` subcommand: a userspace L2 gateway for microVMs. etherparse parses
# and builds ethernet/ARP/IPv4/UDP (checksums); ipstack terminates arbitrary guest
# TCP/UDP for transparent egress through the host's sockets (the gvproxy replacement).
# ipstack names the vendored fork's own pre-release version: a requirement that does not
# spell one out matches no pre-release, and the patch below would be ignored.
etherparse = "0.21"
ipstack = "1.0.2-dev"
listenfd = "1"
log = "0"
rand = "0.10"
# default-features off to use the `ring` backend (consistent with oci-client)
# rather than russh's default aws-lc-rs, while keeping `rsa` so the SSH server can
# accept clients' RSA keys. The rsa crate carries RUSTSEC-2023-0071 (Marvin, no
# fixed release); it is suppressed in .cargo/audit.toml (see that file).
russh = { version = "0.65", default-features = false, features = ["flate2", "ring", "rsa"] }
russh-sftp = "3"
# /run/vk control filesystem (`ctlfs`, vk-agent): pure-Rust FUSE, mounted by
# PID-1 root directly through the mount syscall (no fusermount, no libfuse).
fuser = { version = "0.18", default-features = false }
simplelog = "0"
thiserror = "2"
tokio-serde = { version = "0", features = ["messagepack"] }
tokio-util = { version = "0", features = ["codec"] }
tokio-vsock = "0.7"
# the messagepack codec tokio-serde uses, to assert the on-wire Status layout
rmp-serde = "1"
# fleet identities: `vk node` signs with an ed25519 key and `vk-hub` verifies against the
# pinned public half. Already in the tree as the one crypto backend rustls and russh use, so
# nothing new is linked.
ring = "0.17"
# the hub↔node WebSocket (`vk node` ↔ `vk-hub`). Handshake only — no `connect` or TLS
# features: the hub takes the socket from hyper's upgrade and the node dials through
# tokio-rustls itself, so TLS stays on the ring-backed rustls above and no second TLS stack
# (or aws-lc-rs) comes in. Pure Rust; its handshake deps (http, httparse, sha1) are small
# and mostly in the tree already.
tokio-tungstenite = { version = "0.30", default-features = false, features = ["handshake"] }
# `vk node`'s TLS verification against the platform's roots: the verifier reqwest already
# links, so the hub session trusts exactly what `vk`'s other HTTPS clients trust. Already in
# the tree; pure Rust on Linux.
rustls-platform-verifier = "0.7"
# vk-gitlab reads its GitLab server's certificate for the SPKI digest a relay reports. The
# parser rustls verifies with, already in the tree.
rustls-webpki = { version = "0.103", default-features = false, features = ["alloc"] }
# musl builds use jemalloc instead of the default musl allocator (same approach as ripgrep)
jemallocator = "0.5"
# vk-registry accounts.rs: an embedded users/sessions/API-keys store, alongside the
# filesystem CAS store. Pure Rust, so the binary stays musl-static — see
# vk-registry/DESIGN.md for why not a bundled sqlite.
redb = "4"
# `vk build` live progress dashboard: a multi-line, in-place-updating overview that is
# robust across terminals and multiplexers (tmux/zellij). Pure Rust (console uses libc
# termios, no C lib), so the musl-static build is unaffected.
indicatif = "0.18"
# display width of a char, for the dashboard's own right-margin break: indicatif lays its
# lines out with the same crate (via console), so counting columns any other way would
# desync the two. Already transitive through indicatif; pure Rust, tables only.
unicode-width = "0.2"
# Use indicatif's transitive ANSI classifier in dashboard layout tests.
console = { version = "0.16", default-features = false, features = ["ansi-parsing"] }
# Our vendored fork of ipstack: the fixes a guest's flows need are still on their way
# upstream. See third_party/ipstack/VENDOR.md.
[patch.crates-io]
ipstack = { path = "third_party/ipstack" }