Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maturin develop does not copy/move dylib dependencies in Cargo target directory #1093

Closed
messense opened this issue Sep 10, 2022 · 1 comment · Fixed by #1094
Closed

maturin develop does not copy/move dylib dependencies in Cargo target directory #1093

messense opened this issue Sep 10, 2022 · 1 comment · Fixed by #1094
Labels
bug Something isn't working

Comments

@messense
Copy link
Member

messense commented Sep 10, 2022

Actually maybe I spoke too soon - maturin build --release builds a wheel that properly includes the library and installs just fine. maturin develop however does not seem to move the library to wherever python is looking for it. Was this fix expected to address develop too?

Originally posted by @jdiggans-twist in #1088 (comment)


After #1092 maturin build correctly packages dylib dependencies in Cargo target directory, but for maturin develop we only copy the Python extension module .so file not its dylib dependencies in Cargo target directory which might cause ImportError when try to import the extension module.

(venv) [root@a3493c3871fc maturin]# cargo run dev -m ../dylib-target/Cargo.toml
    Finished dev [unoptimized + debuginfo] target(s) in 1.30s
     Running `target/debug/maturin dev -m ../dylib-target/Cargo.toml`
🔗 Found pyo3 bindings
🐍 Found CPython 3.10 at /io/maturin/venv/bin/python
   Compiling pyo3-build-config v0.17.1
   Compiling pyo3-ffi v0.17.1
   Compiling pyo3 v0.17.1
   Compiling dylib-target v0.1.0 (/io/dylib-target)
    Finished dev [unoptimized + debuginfo] target(s) in 22.03s
📦 Built wheel for CPython 3.10 to /tmp/.tmpuXUpqH/dylib_target-0.1.0-cp310-cp310-linux_x86_64.whl
🛠  Installed dylib-target-0.1.0
(venv) [root@a3493c3871fc maturin]# python3
Python 3.10.7 (main, Sep  7 2022, 22:31:23) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dylib_target
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/io/maturin/venv/lib/python3.10/site-packages/dylib_target/__init__.py", line 1, in <module>
    from .dylib_target import *
ImportError: libcatboostmodel.so.1: cannot open shared object file: No such file or directory
@messense
Copy link
Member Author

messense commented Sep 10, 2022

@jdiggans-twist Please try v0.13.3-beta.4 or later, you can install it by running pip install -U --pre maturin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant