perf(build): gate Matrix channel for faster iteration

This commit is contained in:
Chummy 2026-02-19 21:01:26 +08:00
parent 87dcda638c
commit 05404c6e7a
9 changed files with 135 additions and 60 deletions

View file

@ -69,6 +69,25 @@ Operational notes:
## Channel Matrix
### Build Feature Toggle (`channel-matrix`)
Matrix support is controlled at compile time by the `channel-matrix` Cargo feature.
- Default builds include Matrix support (`default = ["hardware", "channel-matrix"]`).
- For faster local iteration when Matrix is not needed:
```bash
cargo check --no-default-features --features hardware
```
- To explicitly enable Matrix support in custom feature sets:
```bash
cargo check --no-default-features --features hardware,channel-matrix
```
If `[channels_config.matrix]` is present but the binary was built without `channel-matrix`, `zeroclaw channel list`, `zeroclaw channel doctor`, and `zeroclaw channel start` will log that Matrix is intentionally skipped for this build.
---
## 2. Delivery Modes at a Glance

View file

@ -2,7 +2,7 @@
This guide focuses on common setup/runtime failures and fast resolution paths.
Last verified: **February 18, 2026**.
Last verified: **February 19, 2026**.
## Installation / Bootstrap
@ -32,6 +32,51 @@ Fix:
./bootstrap.sh --install-system-deps
```
### Build is very slow or appears stuck
Symptoms:
- `cargo check` / `cargo build` appears stuck at `Checking zeroclaw` for a long time
- repeated `Blocking waiting for file lock on package cache` or `build directory`
Why this happens in ZeroClaw:
- Matrix E2EE stack (`matrix-sdk`, `ruma`, `vodozemac`) is large and expensive to type-check.
- TLS + crypto native build scripts (`aws-lc-sys`, `ring`) add noticeable compile time.
- `rusqlite` with bundled SQLite compiles C code locally.
- Running multiple cargo jobs/worktrees in parallel causes lock contention.
Fast checks:
```bash
cargo check --timings
cargo tree -d
```
The timing report is written to `target/cargo-timings/cargo-timing.html`.
Faster local iteration (when Matrix channel is not needed):
```bash
cargo check --no-default-features --features hardware
```
This skips `channel-matrix` and can significantly reduce compile time.
To build with Matrix support explicitly enabled:
```bash
cargo check --no-default-features --features hardware,channel-matrix
```
Lock-contention mitigation:
```bash
pgrep -af "cargo (check|build|test)|cargo check|cargo build|cargo test"
```
Stop unrelated cargo jobs before running your own build.
### `zeroclaw` command not found after install
Symptom: