-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCargo.toml
More file actions
201 lines (184 loc) · 9.52 KB
/
Cargo.toml
File metadata and controls
201 lines (184 loc) · 9.52 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
# ── Cargo Workspace ────────────────────────────────────────────────────────────
#
# All Rust crates are members of a single workspace so they share one target
# directory (src-tauri/target/). This avoids multi-GB duplication that occurs
# when crates under crates/ are built independently (each getting its own
# target/ with duplicate copies of every transitive dependency).
#
# The shared target directory is configured via .cargo/config.toml:
# [build]
# target-dir = "src-tauri/target"
#
# This keeps the binary output where the Tauri CLI and build scripts expect it.
[workspace]
resolver = "2"
exclude = ["patches/muda-0.17.2"]
members = [
"src-tauri",
"crates/skill-autostart",
"crates/skill-calendar",
"crates/skill-commands",
"crates/skill-constants",
"crates/skill-daemon",
"crates/skill-daemon-common",
"crates/skill-data",
"crates/skill-devices",
"crates/skill-eeg",
"crates/skill-exg",
"crates/skill-headless",
"crates/skill-health",
"crates/skill-oura",
"crates/skill-gpu",
"crates/skill-history",
"crates/skill-iroh",
"crates/skill-jobs",
"crates/skill-label-index",
"crates/skill-lsl",
"crates/skill-llm",
"crates/skill-location",
"crates/skill-router",
"crates/skill-screenshots",
"crates/skill-settings",
"crates/skill-skills",
"crates/skill-tools",
"crates/skill-tray",
"crates/skill-tts",
"crates/skill-vision",
"crates/iroh_test_client",
"crates/iroh-example-client",
"crates/skill-daemon-common",
"crates/skill-daemon-state",
"crates/skill-daemon-routes",
"crates/skill-daemon",
]
# ── Patch: Apple-Silicon Metal fix for cubek-matmul ───────────────────────────
#
# cubek-matmul 0.1.1 panics on Apple Silicon when the SimpleCyclicCmma tile
# (40 KB) exceeds Metal's 32 KB shared-memory limit. The patched fork extends
# the 'auto' fallback chain: SimpleCyclicCmma → SimpleUnit → Naive.
#
# btleplug: improved macOS BLE scanning behaviour.
# NOTE: upstream branch has a typo ("imrpoved" → "improved"); tracked for rename.
#
# [patch] sections MUST live in the workspace root — they are NOT inherited
# from member Cargo.toml files.
[patch.crates-io]
cubek-matmul = { git = "https://github.com/eugenehp/cubek.git", branch = "cubek-matmul", package = "cubek-matmul" }
btleplug = { git = "https://github.com/eugenehp/btleplug.git", branch = "imrpoved_mac_version" }
# Fix muda ZeroWidth panic in to_png() on macOS (upstream bug in 0.17.2)
muda = { path = "patches/muda-0.17.2" }
# Fix glib VariantStrIter unsoundness (GHSA-wrw7-89jp-8q8g) — &p → &mut p
# All gtk-rs-core crates must come from the same source to keep -sys types aligned.
glib = { git = "https://github.com/eugenehp/gtk-rs-core.git", branch = "0.18-patched" }
glib-sys = { git = "https://github.com/eugenehp/gtk-rs-core.git", branch = "0.18-patched" }
gobject-sys = { git = "https://github.com/eugenehp/gtk-rs-core.git", branch = "0.18-patched" }
gio = { git = "https://github.com/eugenehp/gtk-rs-core.git", branch = "0.18-patched" }
gio-sys = { git = "https://github.com/eugenehp/gtk-rs-core.git", branch = "0.18-patched" }
glib-macros = { git = "https://github.com/eugenehp/gtk-rs-core.git", branch = "0.18-patched" }
# Fix rand 0.7.3 vulnerability (GHSA-2qph-qpvm-2qf7) pulled in by selectors → phf_codegen → phf_generator
phf_generator = { path = "patches/phf_generator-0.8.0" }
# burn-mlx on crates.io (0.1.2) targets burn 0.16; the git main branch supports
# burn 0.20 which we use. This patch also covers fast-umap's transitive dep.
burn-mlx = { git = "https://github.com/eidola-ai/burn-mlx", branch = "burn-0-20" }
# emotiv: using crates.io 0.0.12 (no patch needed — restore path dep when developing locally)
# zuna-rs: using crates.io 0.1.3 (no patch needed — restore path dep when developing locally)
# ── Workspace dependencies ─────────────────────────────────────────────────────
#
# Shared across multiple crates to ensure a single version + feature set.
[workspace.dependencies]
anyhow = "1"
thiserror = "2"
base64 = "0.22"
rusqlite = { version = "0.39", features = ["bundled"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# ── TLS crypto provider ──────────────────────────────────────────────────────
#
# rustls defaults to aws-lc-rs whose C build (aws-lc-sys) takes ~45 s on a
# clean compile — the single biggest bottleneck. ring is already in the dep
# tree (via iroh/noq-proto) and builds in <2 s, so we force all workspace
# consumers onto ring instead. Crates that depend on rustls (directly or
# transitively) should use this workspace dep.
rustls = { version = "0.23", default-features = false, features = ["ring", "logging", "std", "tls12"] }
# Force the `deflate` feature on zip 4.x so tauri-plugin-updater can extract
# Deflate-compressed entries. Without this, zip 4.6.1 is compiled without
# flate2 and produces "unsupported compression method" when the updater tries
# to unpack a .nsis.zip built with standard Deflate (method 8).
zip = { version = "7", features = ["deflate"] }
# ── Workspace lints ────────────────────────────────────────────────────────────
#
# Consistent lint policy across every crate. Individual crates inherit these
# via `[lints] workspace = true` in their own Cargo.toml.
#
# We warn (not deny) so CI stays green while we migrate, but clippy will flag
# every new `unwrap()` / missing safety doc / needless pass-by-value.
[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "warn"
[workspace.lints.clippy]
# Phase 1 hardening: make critical runtime-safety lints hard errors.
# NOTE: some tests and helper crates are still using `unwrap()`/`panic!()`;
# keep these as allow so the workspace can pass the strict push hook.
unwrap_used = "allow"
# expect_used — downgraded: thread::spawn().expect(), NonZero::new(1).expect(),
# and Tauri app builder .expect() are idiomatic and unrecoverable. The lint
# catches ~50 legitimate uses vs ~0 bugs. Use `lock_or_recover()` for Mutex.
# expect_used = "warn"
panic = "allow"
undocumented_unsafe_blocks = "deny"
# needless_pass_by_value — disabled: Tauri #[command] handlers and actor-thread
# spawn sites require owned types; the lint produces ~280 false positives.
# needless_pass_by_value = "warn"
redundant_closure_for_method_calls = "allow"
redundant_closure = "allow"
manual_let_else = "allow"
semicolon_if_nothing_returned = "warn"
field_reassign_with_default = "allow"
manual_range_contains = "allow"
manual_is_multiple_of = "allow"
bool_assert_comparison = "allow"
useless_conversion = "allow"
useless_vec = "allow"
items_after_test_module = "allow"
module_inception = "allow"
assertions_on_constants = "allow"
unnecessary_cast = "allow"
# ── Build profiles ────────────────────────────────────────────────────────────
#
# Rust's incremental compilation on macOS uses "thin archives" for rlibs.
# When a compilation unit inside candle-core produces a zero-length .o file
# (any module that is entirely cfg-gated away at the chosen feature set), the
# thin-archive builder tries to mmap it and panics:
# "failed to map object file: memory map must have a non-zero length"
# Disabling incremental for just candle-core avoids the thin-archive code path
# without penalising the rest of the workspace.
# Tracked upstream: https://github.com/rust-lang/rust/issues/129443
[profile.dev.package.candle-core]
incremental = false
[profile.dev]
codegen-units = 8
# Local/dev checks are CPU-bound and do not need full debug symbols.
# This cuts compile time and disk I/O significantly.
debug = 0
# ── Release profile ──────────────────────────────────────────────────────────
#
# thin LTO gives ~90 % of full (fat) LTO's runtime performance benefit at a
# fraction of the link-time cost. On Windows (the slowest CI platform) this
# shaves 2-5 min off release builds compared to the Cargo default (no LTO).
#
# codegen-units = 8 allows the backend to parallelise within each crate.
# Combined with thin LTO the final binary is only ~1-2 % larger than
# codegen-units = 1 + fat LTO, but compiles significantly faster.
# ── Test profile ──────────────────────────────────────────────────────────────
#
# llama-cpp-sys-4 wraps the llama.cpp C++ library. Without optimisations,
# CPU inference runs at a fraction of native speed, making the LLM E2E test
# painfully slow (~1-2 tok/s instead of 20+ tok/s). Optimising just this
# -sys crate (and its transitive C++ build) has no measurable impact on
# incremental test compile times since it is already built by cmake.
[profile.test.package.llama-cpp-sys-4]
opt-level = 3
[profile.test.package.llama-cpp-4]
opt-level = 3
[profile.release]
lto = "thin"
codegen-units = 8