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

How to Install Libraries from subprojects #1979

Open
WillAyd opened this issue Aug 20, 2024 · 0 comments
Open

How to Install Libraries from subprojects #1979

WillAyd opened this issue Aug 20, 2024 · 0 comments

Comments

@WillAyd
Copy link

WillAyd commented Aug 20, 2024

Description

I am working on a library that uses CMake as build generator, and wraps a third party library that distributes a pre-compiled shared library. My current approach to package this has been to call install(...) within CMake on the components I need from the third party library, and make sure they are placed in my wheel appropriately.

However, by installing the third party library in this manner (let's call the third party library "foo") I must then exclude it from the auditwheel / delocate / delvewheel steps, either with the exclude commands or --ignore-in-wheel for delvewheel

[tool.cibuildwheel.linux]
repair-wheel-command = """
auditwheel repair -w {dest_dir} {wheel} --exclude libfoo.so
"""

[tool.cibuildwheel.macos]
repair-wheel-command = """
delocate-wheel --exclude libfoo.dylib --require-archs {delocate_archs} -w {dest_dir} {wheel}
"""

[tool.cibuildwheel.windows]
before-build = "python -m pip install delvewheel"
repair-wheel-command = "python -m delvewheel repair -v --ignore-in-wheel --add-path C:/Windows/System32 -w {dest_dir} {wheel}"

Unfortunately, another Python package may choose to distribute libfoo, and with a version that is not ABI compatible. At runtime, if the other Python package is loaded first, the linker will use that version instead of what has been installed in my wheel. On Unix systems, I am able to avoid this issue with RPATH linkage, but on Windows I think I really need to figure out a way to get delvewheel to work

Is there a way within cibuildwheel that I can pass the path of the source / build tree where my subproject is located to any of the wheel repair commands, so that they can find the library of interest?

In case it is of use, here is the actual library I am working on https://github.com/innobi/pantab/tree/531566c

Build log

No response

CI config

https://github.com/innobi/pantab/blob/531566c23b3f5208003a6a7e5d48fa519b38dfd5/.github/workflows/unit-test.yml

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

No branches or pull requests

1 participant