Repository navigation
fix: put the pinned version in the component wasm filename - #292
Merged
Merged
Conversation
Closes #286. The cache path was version-agnostic (rustledger_ffi_component.wasm) and the download was guarded by `not exists()`, so bumping RUSTLEDGER_VERSION never re-downloaded: a working tree kept using the previous release's component indefinitely. The failure mode is the bad one. While preparing #284 this reported "669 passed" against a tree pinned to v0.22.0 while actually running a component from a previous release; after deleting the stale file the true result was 5 failed, 645 passed, matching CI. A stale run is GREEN, so nothing prompts anyone to look. CI was unaffected because it starts from a clean checkout, which means this hit contributors specifically, and hit them exactly when bumping the version — the moment the component matters most. Putting the version in the filename makes a bump a cache miss by construction, rather than relying on a staleness check that has to be maintained. desktop/scripts/ensure-rustledger.ts solves the same problem for a sibling wasm with a .wasm-version marker; a marker would have been ambiguous here, because CI provisions the file directly and a missing marker cannot be distinguished from an externally provisioned file that happens to be stale — which is the bug. Blast radius, all updated: the three CI download sites (test.yml twice, desktop-release.yml, all of which already have the tag to hand), the PyInstaller spec (now globs, so it need not know the version), and the _default_wasm_path assertion. Versioned names would otherwise accumulate one ~7 MB artifact per upgrade, so a successful download now prunes its superseded siblings and the pre-#286 unversioned file, which is dead in every existing checkout. Pruning is best-effort: a file that cannot be removed is left alone, since tidy-up must never break a working engine. 671 passed, coverage gate still 100%.
mypy runs with no-implicit-reexport, so importing it via component_engine (which only re-exports it) fails attr-defined.
This was referenced Aug 22, 2026
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.
Closes #286.
The bug
The cache path was version-agnostic (
rustledger_ffi_component.wasm) and the download was guarded bynot exists(). Together those mean bumpingRUSTLEDGER_VERSIONnever re-downloads — a working tree keeps using the previous release's component indefinitely.The failure mode is the bad one. While preparing #284 this reported "669 passed" against a tree pinned to v0.22.0 while actually running a component from an earlier release; after deleting the stale file the true result was 5 failed, 645 passed, matching CI. A stale run is green, so nothing prompts anyone to look. CI is unaffected because it starts from a clean checkout — which means this hits contributors specifically, and hits them exactly when they bump the version, the moment the component matters most.
Why the filename and not a marker
Putting the version in the filename makes a bump a cache miss by construction, rather than relying on a staleness check somebody has to maintain.
desktop/scripts/ensure-rustledger.tssolves this for a sibling wasm with a.wasm-versionmarker, and that was my first instinct. It's the wrong fit here: CI provisions the file directly without writing a marker, so a missing marker can't be distinguished from an externally provisioned file that happens to be stale — which is precisely the bug.Blast radius
I grepped for the literal filename before changing it; there were four other consumers, all updated:
.github/workflows/test.yml(two download sites) anddesktop-release.yml— all three already had the tag to handcontrib/pyinstaller_spec.spec— now globs, so it needn't know the version_default_wasm_pathassertion intest_rustledger_component_marshal.pyCleanup
Versioned names would otherwise accumulate one ~7 MB artifact per upgrade, so a successful download prunes its superseded siblings and the pre-#286 unversioned file, which is now dead in every existing checkout. Pruning is best-effort — a file that can't be removed is left alone, since tidy-up must never break a working engine.
Verification
just test-py: 671 passed, 1 skipped, coverage 100.00% — the gate is--cov-fail-under=100andcomponent_engine.pyisn't in the omit list, so the new function needed real tests rather than a pragma. Two were added, including one that asserts an unremovable file doesn't propagate.Note
desktop-release.ymlcarries a few unrelated quote-style changes: prettier normalizes the whole file whenever it's touched.