Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,36 @@ jobs:
echo "tag=${tag}"
} >> "$GITHUB_OUTPUT"

# Bumps the root `[package]` version only. That is sufficient *because* no
# intra-workspace path dependency carries a `version = "…"` requirement —
# a `minor` bump to 0.2.0 against a sibling asking for `^0.1.0` fails
# resolution here with "failed to select a version", which is exactly how
# the first attempt at this release died. Those requirements only ever
# existed to satisfy crates.io publishing, which this repo does not do.
#
# So: do not add `version` back to a `tinymemory*` path dependency. The
# guard below fails with that explanation rather than cargo's, which does
# not mention the cause.
- name: Update crate version
env:
CRATE_NAME: ${{ steps.version.outputs.crate_name }}
NEXT_VERSION: ${{ steps.version.outputs.next_version }}
run: |
set -euo pipefail

offenders="$(
grep -rn --include=Cargo.toml -E \
'^tinymemory(-api|-core|-tinycortex)? *= *\{[^}]*version *=' . || true
)"
if [[ -n "$offenders" ]]; then
echo "An intra-workspace path dependency carries a version requirement:" >&2
echo "$offenders" >&2
echo >&2
echo "Bumping the root package will fail to resolve against it. Nothing here" >&2
echo "is published to crates.io, so drop the 'version' key and keep 'path'." >&2
exit 1
fi

perl -0pi -e 's/(\[package\][\s\S]*?\nversion = ")[^"]+(")/$1$ENV{NEXT_VERSION}$2/' Cargo.toml
cargo update -p "$CRATE_NAME" --precise "$NEXT_VERSION"

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ exclude = [
# The contract itself. Re-exported wholesale from `src/lib.rs` so a host takes
# one dependency rather than two, and so `tinymemory::MemoryProvider` and
# `tinymemory_api::provider::MemoryProvider` are the same type.
tinymemory-api = { path = "api", version = "0.1.1" }
tinymemory-api = { path = "api" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique likely

Restore version requirement on the tinymemory-api path dependency

The original entry pinned the dependency with version = "0.1.1" (a caret range). Removing the version field means the dependency is no longer pinned with a caret range, contrary to the repository rule. More importantly, if this crate is published to crates.io, Cargo requires every path dependency to specify a version requirement (unless it is a workspace member); without one, cargo publish will fail. The surrounding comment indicates the crate is meant for external consumption, so publishing is a real path.

[RULE] Dependencies should be pinned with a caret range; path dependencies intended for publishing need a version requirement. ·

# The mandatory capability families are `async fn`s on object-safe traits.
async-trait = "0.1"
# `Memory` is anyhow-typed; `mandatory::engine_error` maps it onto `MemoryError`.
Expand Down
4 changes: 2 additions & 2 deletions adapters/tinycortex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repository = "https://github.com/tinyhumansai/tinymemory"

[dependencies]
# The contract this adapter targets.
tinymemory = { path = "../..", version = "0.1" }
tinymemory-api = { path = "../../api", version = "0.1.1" }
tinymemory = { path = "../.." }
tinymemory-api = { path = "../../api" }
# The engine being adapted. A version requirement rather than a path, so a host
# that already pins its own TinyCortex checkout unifies both onto one copy
# through its `[patch.crates-io]`; the workspace root patches it to the nested
Expand Down
6 changes: 3 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ readme = "../README.md"
[dependencies]
# The contract. `tinymemory-core` implements and consumes it; the host seam
# traits (config, event sink, embeddings, chat) live in `tinymemory_api::host`.
tinymemory-api = { path = "../api", version = "0.1.1" }
tinymemory = { path = "..", version = "0.1.0" }
tinymemory-api = { path = "../api" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique uncertain

Restore version requirements on path dependencies

These path dependencies dropped their version fields. Cargo requires every path dependency to have a version requirement when publishing to crates.io; without it cargo publish errors with "path dependency ... does not have a version requirement." The dev-dependency entry for tinymemory-api is affected the same way. If this crate (or anything that depends on it for publishing) is released to crates.io, this change breaks publication. Confidence is moderate because the diff alone does not show whether these crates are actually published; if this workspace is purely local-only, the removal is safe.

[RULE] Keep path dependencies publishable ·

tinymemory = { path = ".." }

# The default embedded engine. `store/`, `tree/` and `sync/` drive it directly;
# `tinycortex-api` is a direct dependency because `tinycortex::memory` aliases
Expand Down Expand Up @@ -67,7 +67,7 @@ block2 = { version = "0.6", optional = true }
[dev-dependencies]
# `TestHostConfig` — the concrete `MemoryHostConfig` the extracted test suites
# build, since `Config` is a trait object and cannot be `Default`ed.
tinymemory-api = { path = "../api", version = "0.1.1", features = ["test-support"] }
tinymemory-api = { path = "../api", features = ["test-support"] }
tempfile = "3"
tokio = { version = "1", features = ["test-util"] }

Expand Down
8 changes: 4 additions & 4 deletions crates/tinymemory-module/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ crate-type = ["rlib", "cdylib"]
# The contract. Every type crossing the bus is one of these, and all of them
# already carry serde impls — which is why this module needs no `wire` module of
# its own, unlike the tinywallet one.
tinymemory-api = { path = "../../api", version = "0.1.1" }
tinymemory-api = { path = "../../api" }
# `MemoryTraitProvider`, which pairs a `Memory` backend with a driver id.
tinymemory = { path = "../..", version = "0.1.0" }
tinymemory = { path = "../.." }
# The engine and the seam that adapts it. Carrying these is the entire point of
# the module: they are 14.7s of the host's critical build path, and a host that
# loads this binary compiles neither.
tinymemory-core = { path = "../../core", version = "0.1.0" }
tinymemory-tinycortex = { path = "../../adapters/tinycortex", version = "0.1.0" }
tinymemory-core = { path = "../../core" }
tinymemory-tinycortex = { path = "../../adapters/tinycortex" }
tinycortex = { version = "0.1" }
# TinyBus provides the typed service interface and the dynamic module host ABI.
# Reached by path now that this crate is its own workspace root: the nested
Expand Down
17 changes: 17 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ confidence-threshold = 0.9
# Duplicate versions bloat build times; review them rather than ignoring them.
multiple-versions = "warn"
wildcards = "deny"
# ...except on a path dependency of a crate that is never published.
#
# `wildcards = "deny"` exists to stop an *unpinned registry* dependency, where
# "any version" means whatever crates.io serves next. A version-less `{ path =
# "api" }` is not that: it resolves to the copy in this repo, at this commit, and
# cannot float.
#
# The version keys were removed from the intra-workspace path deps deliberately
# (see the release workflow's bump step): they only ever existed to satisfy
# crates.io publishing, which this repo does not do, and a sibling requiring
# `^0.1.0` makes a `minor` release bump fail to resolve. cargo-deny scores those
# as wildcards, so without this the two requirements contradict each other.
#
# Scoped, not blanket: cargo-deny only applies it to crates marked
# `publish = false`, which every crate here is. Publishing one again would put
# this error back, correctly.
allow-wildcard-paths = true
# Crates that must never enter the dependency graph.
deny = []

Expand Down