Skip to content

fix(build): leech_core's version tracks leech's, and a mismatch is visible - #204

Merged
jayhesselberth merged 1 commit into
mainfrom
fix/leech-core-version-tracking
Aug 24, 2026
Merged

fix(build): leech_core's version tracks leech's, and a mismatch is visible#204
jayhesselberth merged 1 commit into
mainfrom
fix/leech-core-version-tracking

Conversation

@jayhesselberth

Copy link
Copy Markdown
Member

Answers "is the leech_core version moving with the main version?" — it was not, by ten releases.

leech v0.3.1 → v0.6.4
leech_core 0.3.00.3.0

Across that window the Rust changed repeatedly: #176/#178 (POD5 cache + concurrency), #185, #187, #188, #192, #194, #195, #200, #202. Same version string every time.

Why that string matters

It is not decoration — it is a cache key. uv keys its archive cache on it, so a version that never moves lets uv sync restore a compiled extension built from any earlier revision that shared it, on top of a current build.

I hit this while working on #203: after a routine uv sync --extra rust, 43 tests failed with pre-#188 behaviour — chunk_signal_kmer_inputs no longer snapping map[0] = 0, giving s2s[0] == -232 — against an up-to-date working tree. ~/.cache/uv/archive-v0/ was holding both a leech_core-0.1.0 and a 0.3.0 archive. The only reason I did not blame my own change is that the failing test runs with refinement off, so a Python-only refinement edit could not have caused it.

What changes

1. rust/Cargo.toml tracks leech's version and is the single source. rust/pyproject.toml now declares dynamic = ["version"] instead of carrying a second copy — there were nearly three, since env!("CARGO_PKG_VERSION") reads Cargo.toml while maturin's wheel metadata reads pyproject.

2. leech_core exports __version__, and check_rust() compares it. The two are separate distributions built from one repository, so an extension from one revision can sit beside a leech from another — and that pairing doesn't raise, it produces different numbers. It is how #176 stayed hidden (new Rust, old serial driver). check_rust() previously printed a bare leech_core with no version at all:

Rust acceleration: enabled (leech_core)
Rust acceleration: enabled (leech_core 0.6.4)

and on a mismatch it now names both halves and says which to rebuild — including the case where the stale half is leech's own editable metadata, which goes out of date after any version bump until reinstalled. (That case is real: it fired on me mid-development, which is why the message covers it.)

3. The release process bumps both and re-verifies check_rust() afterwards (.claude/commands/release.md), so it cannot drift again by omission.

Tests

tests/test_rust_version_pairing.py, 5 cases: the declared versions agree in the source tree (no install needed); rust/pyproject.toml defers rather than pinning a third copy; the extension exports a version at all; no mismatch in this environment; and the installed extension matches the source tree — that last one being the stale-build hazard itself.

1001 passed / 27 skipped. ruff (0.16.1), ty, cargo fmt, clippy -D warnings clean.

Patch-level, no behaviour change — happy to fold it into whatever the next release is rather than tagging for it.

…sible

leech_core sat at 0.3.0 from v0.3.1 to v0.6.4 -- ten releases, spanning
#176, #185, #187, #188, #192, #195, #200 and #202 -- while the Rust changed
underneath it. The string is not decoration: uv keys its archive cache on
it, so `uv sync` could restore a compiled extension built from any earlier
revision that shared the version, over a current build. Caught it doing
exactly that: 43 tests failing with pre-#188 behaviour
(chunk_signal_kmer_inputs no longer snapping map[0] = 0) against an
up-to-date working tree.

rust/Cargo.toml is now the single source and tracks leech's version;
rust/pyproject.toml takes it through `dynamic = ["version"]` rather than
carrying a third copy to keep in sync.

leech_core also exports __version__ now, via env!(CARGO_PKG_VERSION), and
check_rust() compares it against leech.__version__. The two are separate
distributions built from one repository, so a cross-revision pairing does
not raise -- it produces different numbers, which is how #176 stayed
hidden. check_rust() printed a bare "leech_core" with no version; it now
names it and says which half to rebuild, including the case where the stale
half is leech's own editable metadata.

The release skill bumps both and re-verifies check_rust() afterwards, so
this cannot drift again by omission.
@jayhesselberth
jayhesselberth merged commit 3c412c5 into main Aug 24, 2026
3 checks passed
@jayhesselberth
jayhesselberth deleted the fix/leech-core-version-tracking branch August 24, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant