Skip to content

fix(cli): name the build with plugin runtimes when one is missing; plugin conformance on macOS and Windows - #2593

Merged
robcohen merged 8 commits into
mainfrom
docs/plugin-runtimes-platforms
Oct 11, 2026
Merged

robcohen merged 8 commits into
mainfrom
docs/plugin-runtimes-platforms

Conversation

@robcohen

@robcohen robcohen commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

What

#2541: release binaries and the plugin runtimes. This keeps the decision as made: release binaries stay --no-default-features. The PR documents it and makes every runtime-less path say so.

Asked for Before (release-config build) Now
plugin "x.py" Python plugin "x.py" requires the python-plugins feature same, plus , which this build lacks: rledger's release binaries ship without the WASM and Python plugin runtimes; cargo install rustledger includes them
plugin "x.wasm" ... requires the wasm-plugins feature same, plus the same hint
check --plugin x.wasm clap: unexpected argument '--plugin' found cannot load WASM plugin x.wasm: this rledger was built without the WASM and Python plugin runtimes (release binaries ship without them); install it with cargo install rustledger, which includes them
extract --wasm-importer x.wasm / --wasm-importer-dir d accepted and ignored, so the run reported only "no transactions were extracted" cannot load WASM importers from ...: <same>

The loader's "requires the … feature" wording stays as it was, because the corpus-parity sentinel in rustledger-ffi-component-tests matches on it. The hint is added after it. check --plugin is now accepted in every build, ag-rledger included, so a build without the runtimes can give the real error.

wasm_importer_dir in importers.toml (option D, as decided): a slim build still accepts the setting without complaint, but it no longer skips those importers in silence:

  • An error that no importer matches a file, that nothing was extracted, or that the chosen importer failed now ends with note: this rledger has no WASM runtime, so the WASM importer in imp (bank.wasm) was not tried; cargo install rustledger includes it.
  • A CSV entry can read a file the user meant for a WASM importer. On a slim build this happens through a matching filename_pattern or the single-entry fallback, while a full build would offer the file to the WASM importers first. Such a file now gets warning: bank.csv was read by importers.toml entry 'bank', but <the note>. The same applies when the built-in OFX/CSV importer reads it.
  • --list-importers adds (not loaded: …).
  • With an explicit --importer, nothing changes: a named entry is read by its own parser in every build.

To make this possible, wasm_importer_dir and the dependency-free directory scan (rustledger_plugin::wasm_dir_scan) are no longer feature-gated. The slim-deps ratchet still passes. Nine unit tests that load WASM importers are now gated to the runtime: they could not pass in a slim build, and nothing ran them there.

Docs:

  • installation.md gets a Plugin Runtimes section with a table of routes. Release binaries have no runtimes, and Homebrew (the tap installs the release tarballs), Scoop, cargo binstall and rustledger-bin use them. cargo install and source builds have them, and so do the AUR rustledger, COPR, Docker and Nix packages, which build from source with default features. It also gives the install command.
  • plugins.md notes the requirement at WASM plugins and at Python plugins.
  • errors.md E8005 now covers the WASM PLUGIN case and names the fix.

#2537: a macOS + Windows plugin conformance job. .github/workflows/plugin-platforms.yml is not required. It runs nightly (04:30 UTC), on workflow_dispatch, and on a pull request that changes the workflow file (so this PR runs it). It covers macos-latest and windows-latest with fail-fast: false, the pinned 1.98.1 toolchain and wasm32-unknown-unknown. It runs cargo test -p rustledger --test plugin_conformance --test python_plugin_wasi with RLEDGER_REQUIRE_PYTHON_WASI=1 and RLEDGER_REQUIRE_WASM32=1, then fails on any skip marker. workflow_dispatch only becomes available once the file is on main, which is why the pull_request path trigger is there to validate it here.

How tested

  • New cli_commands_test::release_build_names_the_build_with_plugin_runtimes (compiled only without python-plugin-wasm): the five cases above each fail and name cargo install rustledger. It fails without the fix on the .py directive case. The Slim Build (no wasmtime) CI job now runs it, since nothing else in CI tests the slim build.
  • New release_build_names_the_wasm_importers_it_did_not_try (slim): no-match error, CSV-entry warning, --importer silence, no-transactions error with an implicitly found importers.toml, and --list-importers. It fails without the change. The slim CI step now runs every release_build_ test.
  • Main's fix(test): gate the WASM fixture helper behind python-plugin-wasm #2595 already gates wasm_plugins_dir; I took main's version, and the slim test writes its own placeholder .wasm.
  • actionlint (nixpkgs) on plugin-platforms.yml: clean.
  • clippy, both the workspace with all features and the release config (--no-default-features --features mimalloc,ag-rledger --all-targets), is clean with -D warnings. fmt is clean. Tests for rustledger-loader and rustledger (all features) and cargo doc -D warnings for rustledger-loader pass.
  • The macOS/Windows run is reported below once it finishes.

Closes #2541
Closes #2537

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

Release binaries are built without the WASM and Python plugin runtimes
on purpose. Asked for a Python or WASM plugin such a build reported only
that a feature was missing; check --plugin was an unknown argument; and
extract --wasm-importer and --wasm-importer-dir were accepted and
ignored, so extract reported only that nothing was extracted. All of
them now say the build lacks the runtimes, that release binaries ship
without them, and that cargo install rustledger includes them, and the
slim-build CI job runs a test of each.

The installation guide lists which install routes have the runtimes,
and the plugin reference and E8005 point to it.

A new non-required workflow runs plugin_conformance and
python_plugin_wasi on macOS and Windows nightly and on demand, with
RLEDGER_REQUIRE_* set and a skip-marker check.

Closes #2541
Closes #2537

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 179 masked)
Full AST Match 100%
Total Files 819
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Shape rustledger beancount Speedup RSS (rledger / beancount)
simple 35.2ms ± 1.5ms 577.4ms ± 2.9ms 16.4x 51.2 MB / 50.0 MB
investment 56.3ms ± 1.2ms 2145.5ms ± 27.5ms 38.1x 57.1 MB / 58.1 MB
fifo 55.4ms ± 0.7ms 12055.0ms ± 138.4ms 217.6x 57.3 MB / 57.9 MB

vs base, measured in this run

Shape base this PR Change RSS base → PR
simple 34.8ms ± 1.2ms 35.2ms ± 1.5ms +1.1% ✅ within noise 51.4 MB → 51.2 MB (-0.4%)
investment 55.8ms ± 0.8ms 56.3ms ± 1.2ms +0.8% ✅ within noise 57.4 MB → 57.1 MB (-0.4%)
fifo 55.4ms ± 0.6ms 55.4ms ± 0.7ms +0.0% ✅ within noise 57.5 MB → 57.3 MB (-0.4%)

A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: simple 0.9ms, investment 0.6ms, fifo 0.4ms), and is at least 5%.
10,000 transactions per shape · 20 runs, 3 warmup · hyperfine

What do these numbers mean?
  • simple — Two-posting transfers, one currency. The historical workload — keep as the floor, not as the benchmark.
  • investment — Cost specs, per-unit prices and lot reductions. Exercises booking and inventory, which simple leaves at 0.3%.
  • fifo — Bare {} reductions against a FIFO account — how FIFO sells are normally written. The other four shapes reach the ordered-selection path twice in 2k transactions between them, so it was effectively unprofiled until it turned out to be quadratic (plan_ordered scans every lot per reduction: FIFO ledgers are quadratic (8.8s at 20k transactions) #2083).
  • vs base: the PR and the base-branch commit it is built on, built and measured in the same job
  • RSS: peak resident set size, a single sample — reported without a verdict because there is no spread to test it against
  • A shape with no beancount column is one bean-check reports errors on; it is timed for rledger only

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.45455% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/rustledger/src/cmd/extract_cmd/mod.rs 73.80% 11 Missing ⚠️
crates/rustledger-loader/src/process.rs 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@robcohen

robcohen commented Oct 11, 2026 •

Copy link
Copy Markdown
Member Author

Review loop

Round Scope Finding Fix
1 Every runtime-less path in the release config: plugin directives (.py, python:, .wasm), check --plugin (rledger and ag-rledger), extract --wasm-importer and --wasm-importer-dir. Each install route's real build checked: the Homebrew tap and Scoop install the release tarballs; the AUR rustledger, COPR spec, Docker and the Nix crane package build from source with default features. The corpus-parity sentinel phrase is unchanged none n/a
2 The new workflow: actionlint clean, and its own pull_request run went green on macos-latest and windows-latest with RLEDGER_REQUIRE_* set and no skip marker none n/a
3 Option D, as decided, for wasm_importer_dir in importers.toml on a slim build. Checked whether a CSV [[importers]] entry can read a file meant for a WASM importer: yes, through a matching filename_pattern or the single-entry fallback (a full build offers the file to the WASM importers first) The setting was skipped in silence everywhere 4e13f7e: the error that no importer matches, that nothing was extracted, or that the chosen importer failed gains note: this rledger has no WASM runtime, so the WASM importer in imp (bank.wasm) was not tried; cargo install rustledger includes it. A file read instead by a CSV entry or a built-in importer gets a warning naming the WASM importers. --list-importers shows (not loaded: …). An explicit --importer stays silent. New slim test release_build_names_the_wasm_importers_it_did_not_try fails without the change; the slim CI step now runs every release_build_ test
4 The round-3 change, plus the slim build's own unit tests, which nothing in CI runs 9 extract unit tests load WASM importers and could not pass in a slim build (some already failed on main; the first commit's flag error made the others fail too) Gated to python-plugin-wasm. Slim lib tests: 533 pass. Both clippy configs clean; the slim-deps ratchet still passes (wasm_dir_scan is std-only and now ungated)
5 A re-read of rounds 3 and 4: relative scan dirs resolved as the scanner resolves them, a malformed implicit importers.toml kept quiet (the CSV path reports it), with_wasm_note keeps the error chain, the full build unchanged (untried_wasm_importers is None) none n/a

The loop converged at round 5. Main has been merged three times, with CHANGELOG resolved as main's file plus this PR's two entries, and main's wasm_plugins_dir cfg (#2595) taken. main merged again after #2587, #2588 and #2592 landed (a clean merge; CHANGELOG is main's file plus this PR's two entries). On the merged tree: both clippy configs clean, the rustledger-plugin and rustledger suites and the slim release_build_ tests pass. The required checks are green on b6eddea.

robcohen and others added 7 commits October 11, 2026 04:05
A wasm_importer_dir in importers.toml stays accepted in a build without
the WASM runtime (one file may serve both), but its .wasm importers were
skipped in silence. Now an error that no importer matches a file, or
that nothing was extracted, names them as not tried; a file a CSV entry
or a built-in importer reads instead, where a full build would have
offered it to them first, gets a warning naming them; and
--list-importers lists them as not loaded. Each says cargo install
rustledger includes the runtime.

The wasm_importer_dir setting and the directory scan are no longer
feature-gated, so a slim build can read them. Unit tests that load WASM
importers are now gated to the runtime feature; they could not pass in a
slim build.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
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.

docs: release binaries do not include plugin runtimes ci: run plugin conformance on macOS and Windows (non-required)

1 participant