-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCargo.toml
More file actions
413 lines (393 loc) · 19.6 KB
/
Copy pathCargo.toml
File metadata and controls
413 lines (393 loc) · 19.6 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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
[workspace]
members = [
"crates/lunco-core",
"crates/lunco-hash",
"crates/lunco-time",
"crates/lunco-obc",
"crates/lunco-fsw",
"crates/lunco-behavior",
"crates/lunco-controller",
"crates/lunco-autopilot",
"crates/lunco-attributes",
"crates/lunco-avatar",
"crates/luncosim",
"crates/lunco-sandbox",
"crates/lunco-sandbox-server",
"crates/lunco-telemetry",
"crates/lunco-celestial",
"crates/lunco-celestial-ephemeris",
"crates/lunco-hardware",
"crates/lunco-mobility",
"crates/lunco-robotics",
"crates/lunco-modelica",
"crates/lunco-usd-avian",
"crates/lunco-usd-bevy",
"crates/lunco-usd-sim",
"crates/lunco-usd",
"crates/lunco-sandbox-edit",
"crates/lunco-ui",
"crates/lunco-assets",
"crates/lunco-materials",
"crates/lunco-networking",
"crates/lunco-command-macro",
"crates/lunco-terrain-globe",
"crates/lunco-terrain-core",
"crates/lunco-api",
"crates/lunco-cosim",
"crates/lunco-environment",
"crates/lunco-doc",
"crates/lunco-doc-bevy",
"crates/lunco-twin",
"crates/lunco-twin-journal",
"crates/lunco-tools",
"crates/lunco-tools-rhai",
"crates/lunco-hooks",
"crates/lunco-hooks-rhai",
"crates/lunco-workbench",
"crates/lunco-web",
"crates/lunco-scripting",
"crates/lunco-viz",
"crates/lunco-canvas",
"crates/lunco-cache",
"crates/lunco-theme",
"crates/lunco-storage",
"crates/lunco-workspace",
"crates/lunco-settings",
"crates/lunco-experiments",
"crates/lunco-render",
"crates/lunco-obstacle-field",
"crates/lunco-terrain-surface",
"crates/lunco-tutorial"
]
# Bare `cargo build`/`check`/`test` (no `-p`/`--workspace`) operates on just the
# two app crates and their dependency closure. This skips workspace members that
# no binary reaches — lunco-attributes, lunco-cache, lunco-obc, lunco-telemetry,
# and the feature-gated lunco-networking — so default builds don't compile dead
# weight. Use `--workspace` to include everything (e.g. CI lint/test sweeps).
#
# `lunco-sandbox-server` is intentionally NOT here — for LEANNESS, not
# correctness: built via `-p lunco-sandbox-server`, Cargo resolves
# `lunco-sandbox` WITHOUT `ui`, so the GUI/winit/egui stack isn't linked. (A
# bare/`--workspace` build unifies `ui` on via the GUI `sandbox` bin, making the
# server binary heavier — but it STILL runs headless: the bin calls
# `lunco_sandbox::run_headless()`, which forces the windowless path regardless of
# the linked `ui` feature.) `cargo run -p lunco-sandbox-server`.
default-members = [
"crates/luncosim",
"crates/lunco-sandbox",
"crates/lunco-modelica",
]
resolver = "2"
[patch.crates-io]
# scnr2 patch removed — rumoca main uses scnr2 0.3.3 and
# parol_runtime 4.2 which resolve correctly without overrides.
# openusd consumed from the `main` branch of our fork github.com/LunCoSim/openusd
# (which tracks github.com/mxpv/openusd as upstream) instead of the crates.io
# 0.5.0 release. main adds the authoring/journaling features Phase C needs — the
# `Diff`/`Edit` API (add_sink/extract_diff/apply_diff, usd/diff.rs), the
# `usd::editor` module, value-resolution/relocates/PathTable fixes, and our
# `usd::evaluate` export — while still reporting version 0.5.0 (satisfies the
# `=0.5.0` requirement below). We consume the canonical git version rather than a
# local checkout; local patches land on the fork's main, then `cargo update -p openusd`.
# To develop against a local rumoca-style checkout, uncomment the [patch] block
# below and point it at `../openusd`.
openusd = { git = "https://github.com/LunCoSim/openusd", branch = "main" }
# [patch."https://github.com/LunCoSim/openusd"]
# openusd = { path = "../openusd" }
# Rumoca consumed from the `main` branch of LunCoSim/rumoca (see
# [workspace.dependencies]). The fixes are merged into that `main`, so we
# consume the canonical git version rather than a local checkout.
# To develop against a local rumoca checkout, uncomment the [patch] block
# and point it at `../rumoca`.
#
# [patch."https://github.com/LunCoSim/rumoca"]
# rumoca-ir-ast = { path = "../rumoca/crates/rumoca-ir-ast" }
# rumoca-phase-parse = { path = "../rumoca/crates/rumoca-phase-parse" }
# rumoca-compile = { path = "../rumoca/crates/rumoca-compile" }
# rumoca-sim = { path = "../rumoca/crates/rumoca-sim" }
# rumoca-tool-fmt = { path = "../rumoca/crates/rumoca-tool-fmt" }
# rumoca-tool-lint = { path = "../rumoca/crates/rumoca-tool-lint" }
[workspace.package]
description = "Initialize multi-crate workspace architecture for vessel control simulation"
[workspace.dependencies]
# Slim Bevy: drop everything Modelica/rover workbench provably doesn't
# use. Defaults pull bevy_audio/vorbis (no audio in the apps),
# bevy_text/bevy_ui*/bevy_sprite* (egui replaces UI + 2D),
# bevy_animation/bevy_gizmos/bevy_gilrs/sysinfo_plugin (unused on
# either binary). Each enabled feature is documented inline so we
# don't drift.
#
# If a build break surfaces something that was silently relying on a
# default-on feature, add it here with a `# used by …` comment rather
# than re-enabling `default` (which un-strips the lot).
bevy = { version = "0.18.1", default-features = false, features = [
# ── 2D / UI-only core. Anything 3D-shaped (PBR, GLTF, scenes,
# meshes, post-processing, mesh picking) is *not* in this list —
# crates that need 3D opt in via their own Cargo.toml so the
# Lunica (LunCoSim Modelica Workbench) web binary doesn't carry them. See
# `crates/lunco-sandbox/Cargo.toml` for the opt-in pattern.
# SUBSTRATE ONLY (ECS / app / log / state / color — no GPU, window, winit,
# egui). This baseline reaches every `bevy = { workspace = true }` crate, so
# render-free crates (lunco-core, lunco-cosim, lunco-networking, …) and the
# `--no-ui` server binary do NOT transitively link bevy_render / bevy_winit /
# wayland. Render/window/winit are opted into by the consumer:
# - render crates add `features = ["bevy_pbr", …]` (pulls bevy_render);
# - bevy_egui pulls bevy_render + bevy_window itself, so egui crates self-heal;
# - GUI BINARIES add the windowing backend (bevy_winit/wayland/x11/bevy_window)
# via their own bevy feature list.
"bevy_log", # info!/warn!/error! macros workspace-wide
"bevy_state", # state machine (some panels)
"bevy_color", # Color / ClearColor (ECS-level, no GPU)
"bevy_input_focus", # focus tracking (ECS-level)
"multi_threaded", # task pools (AsyncCompute/Io)
# NOTE: `trace_tracy` is intentionally NOT in the workspace default features
# because tracy-client-sys requires a C++ compile that doesn't work
# targeting wasm32-unknown-unknown *or* Windows MSVC 2019. It is re-enabled
# on native via the opt-in `tracy` feature on `lunco-modelica`
# (see that crate's [features] section and target-cfg dependency).
"serialize", # serde Serialize/Deserialize for Entity, Vec3, Quat, Handle, etc.
# Enables `#[Command]` to always derive serde without per-field worry.
] }
lunco-assets = { path = "crates/lunco-assets" }
avian3d = { version = "0.6.1", default-features = false, features = ["3d", "f64", "parry-f64", "parallel", "debug-plugin", "default-collider", "collider-from-mesh", "bevy_diagnostic", "xpbd_joints"] }
big_space = "0.12.0"
leafwing-input-manager = "0.20.0"
bevy_egui = { version = "0.39.1", features = ["serde"] }
bevy-inspector-egui = "0.36.0"
# `mouse_interaction` (default) fires a gizmo drag on ANY left-press held over
# the gizmo, with no handle check. Selection here is Shift+left-click and the
# gizmo renders ON the selected object, so that driver made the selecting click
# immediately grab the gizmo. We drop it and drive drags ourselves, gated to
# plain (non-Shift) presses — see `gizmo::drive_gizmo_drag_no_shift`. Keep
# `gizmo_picking_backend` (hover/handle hit-testing).
transform-gizmo-bevy = { version = "0.9.0", default-features = false, features = ["gizmo_picking_backend"] }
avian_pickup = "0.5.0-rc.1"
chrono = "0.4.40"
futures-lite = "2.3.0"
resvg = "0.45"
tiny-skia = "0.11"
usvg = { version = "0.45", default-features = false }
# default-features off keeps the Lunica wasm worker lean (image's defaults
# pull ~a dozen codecs); we ship only what consumers declare — png (screenshot
# encode + MSL icons), jpeg (MSL icons), tiff. Add a feature here if a build
# surfaces a missing codec rather than re-enabling `default`.
image = { version = "0.25", default-features = false, features = ["tiff", "png", "jpeg"] }
smallvec = "1.13"
# openusd 0.5.0: real PCP composition engine (variantSets + relationship target
# translation) + typed usd::Stage API. Replaces our hand-rolled lunco-usd-composer.
# Pinned exact — pre-1.0, API moves fast. See crates/lunco-usd-bevy/OPENUSD_0_5_MIGRATION.md.
openusd = "=0.5.0"
instant = "0.1"
# Drop-in replacement for `std::time::Instant` / `SystemTime` that works on
# wasm32-unknown-unknown (where the std types panic at runtime). Backed by
# `performance.now()` in the browser, `std::time` on native. Used by Bevy
# itself, so already in our dep graph as a transitive — pin it explicitly so
# our own code can depend on it.
web-time = { version = "1", features = ["serde"] }
# getrandom 0.2 with js feature for wasm32 support (needed by rand, uuid, etc.)
getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] }
lunco-api = { path = "crates/lunco-api" }
lunco-terrain-globe = { path = "crates/lunco-terrain-globe" }
lunco-terrain-core = { path = "crates/lunco-terrain-core" }
lunco-cosim = { path = "crates/lunco-cosim" }
lunco-environment = { path = "crates/lunco-environment" }
lunco-theme = { path = "crates/lunco-theme" }
lunco-web = { path = "crates/lunco-web" }
# Rumoca crates — single source-of-truth for the git URL + branch.
# Crates opt in via `rumoca-xxx = { workspace = true }`.
# Consumed from the `main` branch of LunCoSim/rumoca.
rumoca-ir-ast = { git = "https://github.com/LunCoSim/rumoca", branch = "main" }
rumoca-phase-parse = { git = "https://github.com/LunCoSim/rumoca", branch = "main" }
rumoca-compile = { git = "https://github.com/LunCoSim/rumoca", branch = "main" }
rumoca-sim = { git = "https://github.com/LunCoSim/rumoca", branch = "main" }
rumoca-tool-fmt = { git = "https://github.com/LunCoSim/rumoca", branch = "main" }
rumoca-tool-lint = { git = "https://github.com/LunCoSim/rumoca", branch = "main" }
egui_colors = "0.4.0"
catppuccin-egui = "5.2.0"
egui-phosphor = "0.7.1"
# Centralised here so version drift across crates is visible in one
# place. Each crate opts in via `dep = { workspace = true }`.
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
# Pure-Rust embedded scripting engine. Chosen over Luau/mlua because mlua only
# reaches wasm via `wasm32-unknown-emscripten`; rhai compiles cleanly to
# `wasm32-unknown-unknown` (our wasm-bindgen target) with no C/C++ toolchain.
# Sandboxed (op/depth/size caps) and deterministic — fits the FixedUpdate sync
# path used by cosim + networking.
rhai = { version = "1", features = ["sync", "serde"] }
toml = "0.8"
uuid = { version = "1", features = ["v4", "serde"] }
indexmap = { version = "2.6", features = ["serde"] }
smol_str = { version = "0.2", features = ["serde"] }
crossbeam-channel = "0.5"
# Link-time distributed registry (life-before-main collection). Backs the
# asset-scheme registry: any crate `inventory::submit!`s its `AssetSchemeProvider`
# and the pre-AssetPlugin registrar drains them — no central hardcoded scheme
# list. wasm-safe (collected via wasm-bindgen module init).
inventory = "0.3"
egui_plot = "0.34.1"
rfd = "0.15"
tempfile = "3.10"
thiserror = "2.0"
async-trait = "0.1"
# Seeded, reproducible RNG for procedural generation. ChaCha8Rng seeded via
# `seed_from_u64` is deterministic across platforms and needs NO getrandom at
# runtime — so the obstacle-field generator produces identical fields on
# server + every client (networking replicates the spec, not the geometry) and
# is wasm-safe without an entropy backend.
rand = { version = "0.8", default-features = false, features = ["std"] }
rand_chacha = "0.3"
# ── wasm / browser-platform bindings ─────────────────────────────────
# Centralised so the wasm-bindgen/js-sys/web-sys family can't drift apart
# across the ~10 crates that touch the browser. web-sys features are
# additive: each crate opts into the JS APIs it needs via
# `web-sys = { workspace = true, features = ["…"] }`; Cargo unions them.
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
web-sys = "0.3"
console_error_panic_hook = "0.1"
# ── Misc shared third-party (centralised to kill version drift) ──────
ureq = { version = "2.9", features = ["tls"] }
bincode = "1.3"
tar = "0.4"
zstd = "0.13"
rayon = "1"
base64 = "0.22"
# Pure-Rust SHA-256 — works on native AND wasm32-unknown-unknown (no
# getrandom / no C). Used by lunco-assets (asset verify) and
# lunco-networking (scenario manifest revision digest + asset content
# addressing on both server and web client).
sha2 = "0.10"
# IPLD content-addressing (IPFS interop). `cid` builds/renders CIDs;
# `multihash-codetable` provides `Code::Sha2_256.digest(bytes)`. Both
# pure-Rust and wasm32-safe — the web client verifies asset hashes
# identically to native and the CIDs it pins are resolvable by `ipfs
# get`/`ipfs pin`. Wire form is canonical CID bytes (see
# lunco-networking/src/scenario.rs).
cid = { version = "0.11", default-features = false, features = ["alloc", "serde"] }
multihash-codetable = { version = "0.2", default-features = false, features = ["sha2"] }
# ── Bevy sub-crates — pinned to the exact `bevy` version above ────────
# These ship in lock-step with bevy; a skewed minor (e.g. bevy_reflect
# "0.18" resolving ahead of bevy "0.18.1") risks subtle ABI/derive
# breakage. Keep every entry == the `bevy` pin.
bevy_reflect = "0.18.1"
bevy_mesh = "0.18.1"
bevy_shader = "0.18.1"
bevy_asset = "0.18.1"
bevy_picking = "0.18.1"
# ── Lints (inherited via `[lints] workspace = true` per crate) ───────
# Encodes policy decisions:
# - Default `unused`/`dead_code` lints stay at warn (compiler default)
# — we keep the workspace clean of them.
# - `unreachable_pub` and `missing_docs` raised to warn — both currently
# at zero across the workspace; surfaces drift early.
# - Selected clippy lints we've already cleaned to zero are pinned at
# warn so future code re-introducing them gets flagged.
# - `needless_pass_by_value` is silenced because Bevy SystemParams
# (Res, Query, Commands, On, …) are framework-mandated by-value and
# trip the lint en masse with no actionable signal. Audit on demand
# with a grep filter; see prior session notes.
[workspace.lints.rust]
unreachable_pub = "warn"
# `missing_docs` stays at the compiler default (allow) workspace-wide;
# crates that want strict doc coverage opt in with `#![warn(missing_docs)]`
# in their `lib.rs` (currently: lunco-doc, lunco-doc-bevy, lunco-workbench,
# lunco-workspace, lunco-storage, lunco-twin). Forcing it on every crate
# would surface 1500+ warnings on the long-tail crates without value.
missing_docs = "allow"
[workspace.lints.clippy]
redundant_clone = "warn"
clone_on_copy = "warn"
or_fun_call = "warn"
needless_collect = "warn"
unnecessary_wraps = "warn"
needless_borrow = "warn"
manual_map = "warn"
manual_unwrap_or = "warn"
useless_conversion = "warn"
redundant_closure = "warn"
needless_pass_by_value = "allow"
# Asset I/O policy AND the GridAnchor atomic-re-parenting invariant.
# Domain crates may not bypass `AssetServer` with raw `std::fs` /
# `std::thread` / blocking `Instant` (those break wasm32 — the bug only
# shows in the browser, not in `cargo test`), and re-parenting of
# big_space `GridAnchor` entities must go through
# `lunco_core::attach::migrate_to_grid`. The full list of banned symbols
# (plus the local `#[allow]` escape-hatch policy) lives in `clippy.toml`
# at the workspace root. See `docs/architecture/40-asset-io.md` and
# `crates/lunco-core/src/attach.rs` for the rationale.
disallowed_methods = "deny"
# ── Dev profile ──────────────────────────────────────────────────────
# Bevy/avian/parry are unusably slow at opt-level 0. opt-level=1 on our
# own crates + opt-level=3 on deps recovers most of release-mode runtime
# speed for a one-time longer dep build (cached afterwards).
#
# debug + split-debuginfo: the default `debug = true` (full DWARF, level 2)
# is what makes native `target/debug` explode to 40G+ on a Bevy/avian stack
# (31G of it is deps rlibs; example binaries carry 2-4G of embedded debuginfo
# each). `line-tables-only` keeps file:line backtraces — all we use in
# practice — while dropping variable-level DWARF, cutting target/ by ~60%.
# `split-debuginfo = "unpacked"` keeps that debuginfo in side .dwo files
# instead of copying it into every dependent binary, so the per-example
# binaries shrink from GBs to MBs. Mirrors web-dev/profiling, which already
# use line-tables-only. sccache does NOT affect target/ size — only rebuild
# speed — so this profile change is the actual disk-fill fix.
[profile.dev]
opt-level = 1
debug = "line-tables-only"
split-debuginfo = "unpacked"
[profile.dev.package."*"]
opt-level = 3
# ── Release profile (native, speed-first) ────────────────────────────
# Default `cargo build --release` targets native binaries. Wants runtime
# speed, not binary size. Earlier this profile was tuned for the wasm web
# build (`opt-level = "z"`, `lto = "fat"`, `codegen-units = 1`) which
# pessimised native — every native release ran with shrink-first codegen
# and the link took minutes due to fat LTO. The wasm tuning now lives in
# `[profile.web-release]` below; the wasm build scripts use that.
[profile.release]
opt-level = 3
lto = "thin"
strip = true
# Wasm web build: optimise for download/compile-in-browser size. Used by
# `scripts/build_web.sh` and `scripts/build_rover.sh` via `--profile
# web-release`. Output lands in `target/wasm32-unknown-unknown/web-release/`.
#
# - opt-level = "z": shrink-first (default "3" favours runtime speed).
# Typical wasm gain: 5–15 %.
# - lto = "fat": cross-crate inlining + DCE across the whole workspace.
# - codegen-units = 1: whole-crate codegen, slightly smaller output.
[profile.web-release]
inherits = "release"
opt-level = "z"
lto = "fat"
codegen-units = 1
strip = true
# `panic = "abort"` drops the unwinding tables and panic-formatting
# machinery from the wasm. Typical gain: ~5–10 % on a release build.
# Safe on wasm — there's no host that catches panics; a panic
# terminates the module either way, we just skip the unwind metadata.
panic = "abort"
# Wasm web build, fast-iteration variant. Used by `scripts/build_web.sh
# build <bin> --dev` for inner-loop development — produces a larger
# wasm but compiles+links in a fraction of the time of `web-release`
# (no fat LTO, no shrink-first codegen, parallel codegen units). The
# build script also skips the `wasm-opt` post-pass when this profile
# is selected. Use `web-release` for what users actually load.
[profile.web-dev]
inherits = "release"
opt-level = 1
lto = false
codegen-units = 16
strip = false
debug = "line-tables-only"
incremental = true
# Profile for samply / perf — release codegen with line-table debug info so
# stacks symbolicate to function names. Strip is off; otherwise identical to
# release. Build with `cargo run --profile profiling --bin ...`.
[profile.profiling]
inherits = "release"
debug = "line-tables-only"
strip = "none"