Comments (5)
I also have been running into an issue using the work-around where maturin build
cannot find the dylib (I'm on macOS) built by uniffi because the library built is called libuniffi_uniffi_test
, which I can see when I unpack the wheel after running pip install .
This doesn't match with the command above, which is pulling the correct dylib from the target directory, so I'm not sure what is going on here. I will try and create a MWE repo for this issue, but again, I'm having trouble because it seems that maturin new -b uniffi
uses a UDL file, while I'm using their proc macros and v0.26 of the uniffi crate.
I have found another work-around for this issue, which is to first call maturin develop
, which generates an additional module within my python directory with the incorrectly named dylib. I then re-name the dylib manually to what it is supposed to be (libuniffi_test.dylib
), and then run maturing build
and pip install .
. This somehow collects the "correct" library.
I think this is also related to the fact that I get an ImporError
when using maturin develop
. Again, I apologize for the lack of a MWE, but as you can tell, there is a lot of complexity to this issue! I'll keep digging and report back.
from maturin.
I also ran into this incompatibility but on my machine (Arch Linux) the build suceeds but fails to load. For example installing test-crates/uniffi-mixed
from the maturin repo and running python test-crates/uniffi-mixed/check_installed/check_installed.py
Traceback (most recent call last):
File "maturin/test-crates/uniffi-mixed/check_installed/check_installed.py", line 3, in <module>
import uniffi_mixed
File "maturin/test-crates/uniffi-mixed/uniffi_mixed/__init__.py", line 1, in <module>
from .uniffi_mixed import * # NOQA
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "maturin/test-crates/uniffi-mixed/uniffi_mixed/uniffi_mixed/__init__.py", line 1, in <module>
from .math import * # NOQA
^^^^^^^^^^^^^^^^^^^
File "maturin/test-crates/uniffi-mixed/uniffi_mixed/uniffi_mixed/math.py", line 766, in <module>
_uniffi_check_contract_api_version(_UniffiLib)
File "maturin/test-crates/uniffi-mixed/uniffi_mixed/uniffi_mixed/math.py", line 476, in _uniffi_check_contract_api_version
raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
uniffi_mixed.uniffi_mixed.math.InternalError: UniFFI contract version mismatch: try cleaning and rebuilding your project
The error is triggered by bindings_contract_version = 25
and scaffolding_contract_version = 24
after installing uniffi-bindgen==0.25.0
after rebuilding check_installed.py
prints SUCCESS
from maturin.
You need to make sure your uniff crate major.minor version is aligned with the python uniffi-bindgen
package version.
from maturin.
FYI, the python uniffi-bindgen
package exists as an optimization to reduce compilation time for uniffi bindings, you can use the official recommended way of creating the uniffi-bindgen
binary in your project to better satisfy the version requirement.
from maturin.
Thank you for the additional info! Yes, on further inspection, my uniffi
crate version was 0.25
, and it just so happened that I began using maturin
a day after the 0.26
release happened 😆 .
from maturin.
Related Issues (20)
- [cffi] Allow generated shared library to have a name other than `native.so` HOT 2
- When the .pyd file is in use and Maturin develop mentions the Pip warning, that needs to be much more obvious that that's really bad.
- Python can't find DLL when linking external C library (gtstreamer) on Windows HOT 7
- Automatic `.pyi` stub file generation HOT 2
- maturin and uniffi doesn't appear to be using pyproject.toml HOT 3
- `maturin sdist` includes extraneous files in source distribution tar.gz HOT 1
- Add a way to include non-python/rust files in generated sdist/wheel despite .gitignore HOT 3
- Use virtualenv for pytest in generated GitHub Actions configuration
- Use macOS M1 runner in generated GitHub Actions configuration
- Improve error when cross compiling to windows without llvm-dlltool HOT 1
- Maturin Fails to x-compile for target `--target i686-pc-windows-msvc` HOT 2
- cross compile to x86_64-pc-windows-gnu from linux builds but not working HOT 1
- option to use uv HOT 4
- error: the configured Python interpreter version (3.13) is newer than PyO3's maximum supported HOT 14
- pytest-step in provided GitHub action prefers remote package over local HOT 1
- `maturin generate-ci github` still generates `upload-artifact@v3`, which is deprecated HOT 2
- build meta wheel does not respect `metadata_directory` per PEP-517 HOT 2
- idea: "import hook" automatically installed with editable builds HOT 1
- Make `--find-interpreter` require opt-in to prereleases HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maturin.