Recognise the engine wheel's real layout - #9
Merged
Merged
Conversation
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.
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.
Blocks the 0.3.0 release: with this bug the Rust engine re-downloads on every process.
maturin buildships the extension as a package, not a bare.so:is_rust_engine()only matched a flatsimantic_rust.<ext>, so it returnedFalsefor every wheel we would publish.It fails quietly.
import simantic_ruststill works, because putting the directory onsys.pathimports the package either way, so the first run looks fine. Butinstalled_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 nowTrue. 40 tests intest_install.pypass.Companion fix in pyrite: the release workflow's own wheel assertion checks for the same flat name and fails the build.