Skip to content

Recognise the engine wheel's real layout - #9

Merged
ShahriarAhnaf merged 1 commit into
mainfrom
agent/rust-engine-layout-5f31
Aug 24, 2026
Merged

ShahriarAhnaf merged 1 commit into
mainfrom
agent/rust-engine-layout-5f31

Conversation

@ShahriarAhnaf

Copy link
Copy Markdown
Contributor

Blocks the 0.3.0 release: with this bug the Rust engine re-downloads on every process.

maturin build ships the extension as a package, not a bare .so:

simantic_rust/__init__.py
simantic_rust/simantic_rust.abi3.so
simantic_rust-0.3.0.dist-info/...

is_rust_engine() only matched a flat simantic_rust.<ext>, so it returned False for every wheel we would publish.

It fails quietly. import simantic_rust still works, because putting the directory on sys.path imports the package either way, so the first run looks fine. But installed_rust_engine() never recognises the managed copy, so each new process downloads the wheel again instead of reusing ~/.simantic/engine-rust/<version>.

Now accepts either shape. Tests pin the maturin package layout, the flat layout, and a directory that has neither (a simantic_rust/ with no __init__.py, which is not importable).

Found by building the wheel with maturin and unpacking it, not by reasoning about what it ought to contain. Verified against the real artifact: is_rust_engine() on the unpacked wheel is now True. 40 tests in test_install.py pass.

Companion fix in pyrite: the release workflow's own wheel assertion checks for the same flat name and fails the build.

maturin ships the Rust engine as a package: simantic_rust/__init__.py beside
simantic_rust/simantic_rust.abi3.so. is_rust_engine only matched a flat
simantic_rust.<ext>, so it returned False for every wheel we would actually
publish.

That failed quietly in the worst way. Importing still worked, because putting
the directory on sys.path imports the package either way, so a first run looked
fine. But installed_rust_engine() never found the managed copy, so every new
process re-downloaded the wheel instead of reusing ~/.simantic/engine-rust.

Accept either shape, since the only thing that matters is whether the module
imports. Found by building the wheel with maturin and unpacking it rather than
by reasoning about what it should contain; the tests pin both layouts and the
directory that has neither.
@ShahriarAhnaf
ShahriarAhnaf merged commit 483a56c into main Aug 24, 2026
6 checks passed
@ShahriarAhnaf
ShahriarAhnaf deleted the agent/rust-engine-layout-5f31 branch August 24, 2026 16:35
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