fix(build): reduce release-build memory pressure on low-RAM devices (#303)

This commit is contained in:
Chummy 2026-02-16 23:40:40 +08:00 committed by GitHub
parent 23b0f360c2
commit 3fd901a5ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -114,8 +114,8 @@ path = "src/main.rs"
[profile.release] [profile.release]
opt-level = "z" # Optimize for size opt-level = "z" # Optimize for size
lto = true # Link-time optimization lto = "thin" # Lower memory use during release builds
codegen-units = 1 # Better optimization codegen-units = 8 # Faster, lower-RAM codegen for small devices
strip = true # Remove debug symbols strip = true # Remove debug symbols
panic = "abort" # Reduce binary size panic = "abort" # Reduce binary size

View file

@ -114,6 +114,7 @@ zeroclaw migrate openclaw
``` ```
> **Dev fallback (no global install):** prefix commands with `cargo run --release --` (example: `cargo run --release -- status`). > **Dev fallback (no global install):** prefix commands with `cargo run --release --` (example: `cargo run --release -- status`).
> **Low-memory boards (e.g., Raspberry Pi 3, 1GB RAM):** run `CARGO_BUILD_JOBS=1 cargo build --release` if the kernel kills rustc during compilation.
## Architecture ## Architecture
@ -425,6 +426,7 @@ See [aieos.org](https://aieos.org) for the full schema and live examples.
```bash ```bash
cargo build # Dev build cargo build # Dev build
cargo build --release # Release build (~3.4MB) cargo build --release # Release build (~3.4MB)
CARGO_BUILD_JOBS=1 cargo build --release # Low-memory fallback (Raspberry Pi 3, 1GB RAM)
cargo test # 1,017 tests cargo test # 1,017 tests
cargo clippy # Lint (0 warnings) cargo clippy # Lint (0 warnings)
cargo fmt # Format cargo fmt # Format