Remove std dependencies from aimdb-sync - #204
Merged
Merged
Conversation
What's new: - `thiserror` to 2.x - Use alloc::string::String instead of std::string::String - Use `log_*` instead of `eprintln!` - Use `SyncResult` in doctest What's still not working: - Warning not show up in `examples/sync-api-demo`, possibly due to missing `tracing` feature and `Drop` behavior not executed
lxsaah
requested changes
Jul 23, 2026
lxsaah
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tackling #197, eprintln! to log-facade routing and doctest conversion all look correct.
Two things before merge: the set_value doctest in aimdb-sync/src/producer.rs (line 251) needs use aimdb_sync::{AimDbBuilderSyncExt, SyncResult}; instead of just AimDbBuilderSyncExt, otherwise cargo test --doc --features data-contracts fails with "cannot find type SyncResult". To satisfy the verification step in #197, please also restore the drop-without-detach warning in sync-api-demo by enabling aimdb-sync's tracing feature plus a tracing-subscriber dependency and a tracing_subscriber::fmt::init(); call in main, since the log facade is a no-op without a subscriber.
- Add missing SyncResult in `aimdb-sync/src/producer.rs` - Add `tracing` and `tracing-subscriber` to `examples/sync-api-demo` - Add `graceful-shutdown` feature for `examples/sync-api-demo` so `log_warn!` could surface
This was referenced Jul 25, 2026
lxsaah
added a commit
to solus161/aimdb
that referenced
this pull request
Jul 29, 2026
Follow-on to the review of aimdb-dev#205, applied directly to avoid another round-trip. - consumer.rs: drop the last 4 inert `#[cfg(feature = "std")]` guards in doc examples. `mod consumer` is already std-gated at lib.rs:257, so they can never evaluate false. The one on `get_with_timeout` was also missing the `# ` hide prefix and rendered into the published docs. - consumer.rs: backtick `Arc<Mutex>` in a doc comment — it was the last `cargo doc` warning (unclosed HTML tag), pre-existing from before aimdb-dev#204. - Makefile: add the no_std clippy arm and the thumbv7em-none-eabihf check, matching the per-crate convention. The cross-compile lane is the only one that catches std arriving through a dependency's default features; a host `--no-default-features` build passes regardless because the host has std, which is why CI was green while the no_std path was broken. - Makefile: drop `--lib` from the no_std test arm. The conditional ```ignore fence added in 71102d8 means the full command now passes, so the arm covers unit tests, integration tests and doctests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lxsaah
added a commit
that referenced
this pull request
Jul 29, 2026
* Add std feature gate and no_std clip What's new: - tokio-related features are now optional; - Update `lib.rs` to gate `std` at module level for `consumer.rs`, `handle.rs`, and `producer.rs` as most units are depend on `std` dependencies at the moment. Will gate at finer level in the futures; - Add build with no default feature in Makefile * Update aimdb-sync/Cargo.toml Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/lib.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/Cargo.toml Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/consumer.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/consumer.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/handle.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/handle.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/producer.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update aimdb-sync/src/handle.rs Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update Makefile Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> * Update changes in no diff What's new: - Gate 'lib.rs` internal doctest with conditional `no_run` and `ignore` so `cargo test -p aimdb-sync --no-default-features --doc` does not fail - Several small reverted `std` guard as modules is now std-gated at `lib.rs` * Complete the no_std review sweep for aimdb-sync Follow-on to the review of #205, applied directly to avoid another round-trip. - consumer.rs: drop the last 4 inert `#[cfg(feature = "std")]` guards in doc examples. `mod consumer` is already std-gated at lib.rs:257, so they can never evaluate false. The one on `get_with_timeout` was also missing the `# ` hide prefix and rendered into the published docs. - consumer.rs: backtick `Arc<Mutex>` in a doc comment — it was the last `cargo doc` warning (unclosed HTML tag), pre-existing from before #204. - Makefile: add the no_std clippy arm and the thumbv7em-none-eabihf check, matching the per-crate convention. The cross-compile lane is the only one that catches std arriving through a dependency's default features; a host `--no-default-features` build passes regardless because the host has std, which is why CI was green while the no_std path was broken. - Makefile: drop `--lib` from the no_std test arm. The conditional ```ignore fence added in 71102d8 means the full command now passes, so the arm covers unit tests, integration tests and doctests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Add data-contracts CI lanes for aimdb-sync `aimdb-sync/data-contracts` had no coverage in any make target, so tests/settable_integration.rs and the `set_value` doctest never compiled in CI. No consumer enables the feature either, so nothing reached it transitively. Adds a test arm and a clippy arm, matching the per-feature-combination convention aimdb-client uses. The test arm picks up 4 integration tests and a 26th doctest that were previously invisible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Gate WASM cancel machinery on wasm-runtime `bindings` (lib.rs:39) is the only consumer of CancelToken/CancelHandle and is itself `#[cfg(feature = "wasm-runtime")]`, so the host test lanes (`--no-default-features`) compiled these items with no reachable caller and emitted 6 dead_code warnings. Gating them on the same feature as their consumer keeps the two in step. `Cell` was used only by CancelInner, so it moves behind the same gate to avoid trading dead_code for unused_imports; `RefCell` stays unconditional. Not dead code — the wasm32 path is unchanged and still compiles clean with -D warnings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: sounds.like.lx <147444674+lxsaah@users.noreply.github.com> Co-authored-by: Alexander Schnörch <alexander.schnoerch@outlook.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What's new:
thiserrorto 2.xlog_*instead ofeprintln!SyncResultin doctestWhat's still not working:
examples/sync-api-demo, possibly due to missingtracingfeature in packgage'sCargo.tomlandDropbehavior not executedRelated Issue
Checklist
make check).