From a85fcf43c37222457a4ef29a969c357a68211668 Mon Sep 17 00:00:00 2001 From: Chummy Date: Mon, 16 Feb 2026 23:40:40 +0800 Subject: [PATCH] fix(build): reduce release-build memory pressure on low-RAM devices (#303) --- Cargo.toml | 8 ++++---- README.md | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 61b5d6a..6a6bc78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,10 +114,10 @@ path = "src/main.rs" [profile.release] opt-level = "z" # Optimize for size -lto = true # Link-time optimization -codegen-units = 1 # Better optimization -strip = true # Remove debug symbols -panic = "abort" # Reduce binary size +lto = "thin" # Lower memory use during release builds +codegen-units = 8 # Faster, lower-RAM codegen for small devices +strip = true # Remove debug symbols +panic = "abort" # Reduce binary size [profile.dist] inherits = "release" diff --git a/README.md b/README.md index 7cd5aab..ac9a8b2 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ zeroclaw migrate openclaw ``` > **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 @@ -425,6 +426,7 @@ See [aieos.org](https://aieos.org) for the full schema and live examples. ```bash cargo build # Dev build 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 clippy # Lint (0 warnings) cargo fmt # Format