Background
With the std-crates cleared (#197), aimdb-sync can be made no_std-ready. This is the step that needs actual care: the crate has default = [] today and tokio + aimdb-tokio-adapter as unconditional dependencies, so introducing a default-on std feature touches every downstream consumer.
The feature gate, the no_std flip, and the CI lane belong together — a no_std build that is not in CI rots before anyone notices it, and the feature gate on its own accomplishes nothing observable.
Task
1. Introduce the std feature
2. Flip to no_std
3. Guard it in CI
Why it matters
This is the actual deliverable of #46 Phase 1: aimdb-sync compiles without std, while current users see no change. It is the precondition for any future FreeRTOS or Embassy backend.
Verification
cargo build -p aimdb-sync # std path unchanged
cargo build -p aimdb-sync --no-default-features # no_std path compiles
cargo tree -p aimdb-sync --no-default-features -e features | grep -i tokio # no output
cargo test -p aimdb-sync
make check
examples/sync-api-demo must build and behave identically — "no #[tokio::main] needed" stays true for current users.
Files
aimdb-sync/Cargo.toml, aimdb-sync/src/lib.rs (+ #[cfg] across the crate)
Makefile (build: target)
- Reference:
aimdb-core/src/lib.rs:16, Makefile:75-82
Background
With the std-crates cleared (#197),
aimdb-synccan be madeno_std-ready. This is the step that needs actual care: the crate hasdefault = []today andtokio+aimdb-tokio-adapteras unconditional dependencies, so introducing a default-onstdfeature touches every downstream consumer.The feature gate, the
no_stdflip, and the CI lane belong together — ano_stdbuild that is not in CI rots before anyone notices it, and the feature gate on its own accomplishes nothing observable.Task
1. Introduce the
stdfeaturestdfeature toaimdb-sync/Cargo.toml(default = ["std"]— note it isdefault = []today, line 36).tokioandaimdb-tokio-adapterbehind it (optional = true+ listed in thestdfeature), with no leakage into the defaultno_stdbuild.#[cfg(feature = "std")]the modules and items that need the runtime thread / tokio handle.examples/sync-api-demoand any other consumer — flipping the default set can silently enable features elsewhere.2. Flip to
no_std#![cfg_attr(not(feature = "std"), no_std)]+extern crate allocinaimdb-sync/src/lib.rs.std::imports forcore::/alloc::equivalents wherever they are not behind thestdfeature —StringinSyncError,Arc,Duration, etc.aimdb-core/src/lib.rs:16is alreadyno_std + alloc.3. Guard it in CI
no_stdbuild lane foraimdb-syncto thebuild:target in theMakefile, mirroring theaimdb-corelines atMakefile:75-82.Why it matters
This is the actual deliverable of #46 Phase 1:
aimdb-synccompiles without std, while current users see no change. It is the precondition for any future FreeRTOS or Embassy backend.Verification
examples/sync-api-demomust build and behave identically — "no#[tokio::main]needed" stays true for current users.Files
aimdb-sync/Cargo.toml,aimdb-sync/src/lib.rs(+#[cfg]across the crate)Makefile(build:target)aimdb-core/src/lib.rs:16,Makefile:75-82