From 44b4ab3f46639e1ab506f70367e796d69f9cfbe5 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 15 Sep 2026 19:53:07 +0000 Subject: [PATCH] fix(release): repair `make publish` crate set, order and dev-dep cycles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `make publish` could not complete. It failed at `cargo publish -p aimdb-tokio-adapter`, and no reordering of the list could fix it: three workspace library crates were absent from the list entirely, and the dependency graph was cyclic once dev-dependencies were counted. Three changes, no code movement. Add the three missing connectors. `aimdb-uds-connector`, `aimdb-serial-connector` and `aimdb-tcp-connector` are published API — `aimdb-client` already exposes all three behind its `transport-*` features, and `cargo publish` requires every dependency to resolve on the registry, optional ones included. Replace the hand-numbered 16-step list with a `PUBLISH_ORDER` variable driving a loop, so the order has one source of truth and the step numbering derives from it. The order is topological over normal and build dependencies, verified against `cargo metadata`. `PUBLISH_NO_VERIFY` carries the two crates that skip verification, keeping the existing behaviour explicit rather than buried in one line of the sequence. Drop `version =` from the workspace-internal dev-dependencies, keeping `path`. Cargo omits path-only dev-dependencies when packaging, so the cycle disappears at publish time while `cargo test` still resolves locally. Five needed it, not the three first identified: the edge `aimdb-tokio-adapter -> aimdb-client` appears in four of the five elementary cycles, and `aimdb-embassy-adapter -> aimdb-core = "1.1.0"` would have built the packaged tests against the previously published core rather than the code being released. Conversely, `aimdb-websocket-connector -> aimdb-tokio-adapter` forms no cycle — nothing reaches the websocket connector from the tokio adapter — but it carries the same stale-version hazard and is fixed on that basis. Also mark `remote-access-demo` as `publish = false`. It was the only example crate missing the flag, which left it as a 20th publishable crate that no publish list mentioned. Verified: the target runs end to end against a stubbed `cargo`, emitting 19 publishes in the listed order with `--no-verify` on exactly the two intended crates, and aborting on the first failure; `cargo metadata` reports no versioned workspace-internal dev-dependencies remain and the list matches the publishable set exactly; the packaged-manifest behaviour was reproduced on a scratch workspace, whose `.crate` carries an empty `[dev-dependencies]` section; and `cargo check --all-targets` passes for every affected crate. `make publish` is still not runnable end to end: `aimdb-embassy-adapter` needs embassy-sync's `poll_next_message` / `poll_changed`, which are merged upstream but absent from the released 0.8.0 and supplied locally through `[patch.crates-io]`. That is recorded on `PUBLISH_NO_VERIFY` and is the remaining blocker. Refs #242 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GgvcFC4S8Kii5H6xzW56mi --- Makefile | 117 ++++++++++++------------- aimdb-embassy-adapter/Cargo.toml | 2 +- aimdb-tokio-adapter/Cargo.toml | 4 +- aimdb-uds-connector/Cargo.toml | 2 +- aimdb-websocket-connector/Cargo.toml | 2 +- examples/remote-access-demo/Cargo.toml | 1 + 6 files changed, 60 insertions(+), 68 deletions(-) diff --git a/Makefile b/Makefile index d5cd9056..3be1a8ce 100644 --- a/Makefile +++ b/Makefile @@ -639,6 +639,45 @@ publish-check: @printf "$(BLUE)ℹ Other crates cannot be fully validated until dependencies are published.$(NC)\n" @printf "$(BLUE) Run 'make publish' to publish all crates in dependency order.$(NC)\n" +# Topological publish order over normal + build dependencies (issue #242). +# Verified against `cargo metadata`: every crate is listed after everything it +# depends on. Dev-dependencies are deliberately excluded from the ordering — +# they form cycles (aimdb-tokio-adapter <-> aimdb-uds-connector, and four more +# through aimdb-client), and every workspace-internal one is now path-only, so +# Cargo drops it from the packaged manifest. +PUBLISH_ORDER := \ + aimdb-codegen \ + aimdb-derive \ + aimdb-core \ + aimdb-data-contracts \ + aimdb-embassy-adapter \ + aimdb-persistence \ + aimdb-tokio-adapter \ + aimdb-uds-connector \ + aimdb-knx-connector \ + aimdb-mqtt-connector \ + aimdb-persistence-sqlite \ + aimdb-serial-connector \ + aimdb-sync \ + aimdb-tcp-connector \ + aimdb-wasm-adapter \ + aimdb-websocket-connector \ + aimdb-client \ + aimdb-cli \ + aimdb-mcp + +# Crates published without a verification build. +# +# `aimdb-embassy-adapter` needs embassy-sync's `poll_next_message` / +# `poll_changed`. Those are merged upstream but absent from the released 0.8.0, +# so the workspace supplies them through `[patch.crates-io]` (Cargo.toml). +# Patches are never published, and the vendored copy carries the same `0.8.0` +# version number as the registry release, so no version mismatch flags it: the +# packaged crate's `embassy-sync` feature cannot build for a downstream user +# until a release carries those APIs. Drop this entry — and the patch — once +# one does (issue #242). +PUBLISH_NO_VERIFY := aimdb-embassy-adapter aimdb-wasm-adapter + publish: @printf "$(GREEN)Publishing AimDB crates to crates.io...$(NC)\n" @printf "$(YELLOW)⚠ This will publish crates in dependency order$(NC)\n" @@ -654,69 +693,21 @@ publish: else \ printf "$(BLUE)Running in CI mode - skipping confirmation$(NC)\n"; \ fi - @printf "$(YELLOW) → Publishing aimdb-derive (1/16)$(NC)\n" - @cargo publish -p aimdb-derive - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-codegen (2/16)$(NC)\n" - @cargo publish -p aimdb-codegen - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-core (3/16)$(NC)\n" - @cargo publish -p aimdb-core - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-data-contracts (4/16)$(NC)\n" - @cargo publish -p aimdb-data-contracts - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-tokio-adapter (5/16)$(NC)\n" - @cargo publish -p aimdb-tokio-adapter - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-embassy-adapter (6/16)$(NC)\n" - @cargo publish -p aimdb-embassy-adapter --no-verify - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-client (7/16)$(NC)\n" - @cargo publish -p aimdb-client - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-sync (8/16)$(NC)\n" - @cargo publish -p aimdb-sync - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-persistence (9/16)$(NC)\n" - @cargo publish -p aimdb-persistence - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-persistence-sqlite (10/16)$(NC)\n" - @cargo publish -p aimdb-persistence-sqlite - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-mqtt-connector (11/16)$(NC)\n" - @cargo publish -p aimdb-mqtt-connector - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-knx-connector (12/16)$(NC)\n" - @cargo publish -p aimdb-knx-connector - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-websocket-connector (13/16)$(NC)\n" - @cargo publish -p aimdb-websocket-connector - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-wasm-adapter (14/16)$(NC)\n" - @cargo publish -p aimdb-wasm-adapter --no-verify - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-cli (15/16)$(NC)\n" - @cargo publish -p aimdb-cli - @printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n" - @sleep 10 - @printf "$(YELLOW) → Publishing aimdb-mcp (16/16)$(NC)\n" - @cargo publish -p aimdb-mcp - @printf "$(GREEN)✓ All 16 crates published successfully!$(NC)\n" + @total=$(words $(PUBLISH_ORDER)); i=0; \ + for pkg in $(PUBLISH_ORDER); do \ + i=$$((i + 1)); \ + flags=""; \ + case " $(PUBLISH_NO_VERIFY) " in \ + *" $$pkg "*) flags="--no-verify";; \ + esac; \ + printf "$(YELLOW) → Publishing $$pkg ($$i/$$total)$(NC)\n"; \ + cargo publish -p "$$pkg" $$flags || exit 1; \ + if [ "$$i" -lt "$$total" ]; then \ + printf "$(YELLOW) → Waiting 10s for crates.io propagation...$(NC)\n"; \ + sleep 10; \ + fi; \ + done + @printf "$(GREEN)✓ All $(words $(PUBLISH_ORDER)) crates published successfully!$(NC)\n" @printf "$(BLUE)🎉 AimDB v$(shell grep '^version' Cargo.toml | head -1 | cut -d '"' -f 2) is now live on crates.io!$(NC)\n" ## Drift guards diff --git a/aimdb-embassy-adapter/Cargo.toml b/aimdb-embassy-adapter/Cargo.toml index a5b8eb40..435b9020 100644 --- a/aimdb-embassy-adapter/Cargo.toml +++ b/aimdb-embassy-adapter/Cargo.toml @@ -87,7 +87,7 @@ tracing = { workspace = true, optional = true, default-features = false } # `run_client` engine on the EmbassyAdapter clock — pull in aimdb-core's # `connector-session` gate. Dev-only, so the normal no_std lib build (and the # thumbv7em checks) stay `alloc`-only. -aimdb-core = { version = "1.1.0", path = "../aimdb-core", default-features = false, features = [ +aimdb-core = { path = "../aimdb-core", default-features = false, features = [ "alloc", "connector-session", ] } diff --git a/aimdb-tokio-adapter/Cargo.toml b/aimdb-tokio-adapter/Cargo.toml index 5ca5ba96..ce007301 100644 --- a/aimdb-tokio-adapter/Cargo.toml +++ b/aimdb-tokio-adapter/Cargo.toml @@ -72,8 +72,8 @@ tokio-test = { workspace = true } futures = { workspace = true } # For drain integration tests -aimdb-client = { version = "0.6.0", path = "../aimdb-client" } +aimdb-client = { path = "../aimdb-client" } # Stands up the AimX UDS server (`UdsServer`) the drain tests connect to. -aimdb-uds-connector = { version = "0.1.0", path = "../aimdb-uds-connector" } +aimdb-uds-connector = { path = "../aimdb-uds-connector" } serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/aimdb-uds-connector/Cargo.toml b/aimdb-uds-connector/Cargo.toml index 32f898d3..51e9a665 100644 --- a/aimdb-uds-connector/Cargo.toml +++ b/aimdb-uds-connector/Cargo.toml @@ -31,7 +31,7 @@ tokio = { version = "1", features = ["net", "io-util"] } [dev-dependencies] -aimdb-tokio-adapter = { version = "0.6.0", path = "../aimdb-tokio-adapter" } +aimdb-tokio-adapter = { path = "../aimdb-tokio-adapter" } tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] } # For the crate-level doc example (a mirrored record needs a JSON shape) serde = { version = "1.0", features = ["derive"] } diff --git a/aimdb-websocket-connector/Cargo.toml b/aimdb-websocket-connector/Cargo.toml index 6701513e..420f9d54 100644 --- a/aimdb-websocket-connector/Cargo.toml +++ b/aimdb-websocket-connector/Cargo.toml @@ -68,7 +68,7 @@ tracing = { version = "0.1", optional = true } [dev-dependencies] tokio = { version = "1", features = ["full", "test-util"] } tokio-tungstenite = "0.26" -aimdb-tokio-adapter = { version = "0.6.0", path = "../aimdb-tokio-adapter" } +aimdb-tokio-adapter = { path = "../aimdb-tokio-adapter" } # Runnable demos — see their headers for the two-terminal workflow. [[example]] diff --git a/examples/remote-access-demo/Cargo.toml b/examples/remote-access-demo/Cargo.toml index 487cf35d..c1f51049 100644 --- a/examples/remote-access-demo/Cargo.toml +++ b/examples/remote-access-demo/Cargo.toml @@ -3,6 +3,7 @@ name = "remote-access-demo" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [[bin]] name = "server"