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

Support SOVERSION-ed libraries #625

Open
oleksandr-pavlyk opened this issue Jan 14, 2022 · 3 comments · May be fixed by #626
Open

Support SOVERSION-ed libraries #625

oleksandr-pavlyk opened this issue Jan 14, 2022 · 3 comments · May be fixed by #626

Comments

@oleksandr-pavlyk
Copy link

On Linux, for projects that set VERSION/SOVERSION properties on the dynamic library they install CMake generates symbolic links symbolic links for least specified version to the most specified one:

(work) [16:53:47 vmbox dpctl]$ ls -l _skbuild/linux-x86_64-3.9/cmake-install/dpctl/libDP*
_skbuild/linux-x86_64-3.9/cmake-install/dpctl/libDPCTLSyclInterface.so -> libDPCTLSyclInterface.so.0
_skbuild/linux-x86_64-3.9/cmake-install/dpctl/libDPCTLSyclInterface.so.0 -> libDPCTLSyclInterface.so.0.12
_skbuild/linux-x86_64-3.9/cmake-install/dpctl/libDPCTLSyclInterface.so.0.12

scikit-build copies these symbolic links as files, because it uses shutils.copyfile with follow_symlinks=True default (see setuptools_wrap.py#L855-L856). Each file copied into Python layout is a regular file, and this interferes with proper working of the library.

I have fixed this issue locally, by modifying these 2 lines to

    copyfile(src_file, dest_file, follow_symlinks=False)
    copymode(src_file, dest_file, follow_symlinks=False)
@henryiii
Copy link
Contributor

henryiii commented Jan 19, 2022

Would this interfere with producing wheels, though? Wheels do not allow symlinks, since they are internally zip files, and Python (still) has a standard library bug that keeps it from supporting symlinks in zips.

https://bugs.python.org/issue37921 (writing) and https://bugs.python.org/issue27318 (reading).

@oleksandr-pavlyk
Copy link
Author

@henryiii I trust you are aware of https://github.com/cournape/zipfile2 package, which adds metadata to zip files to support read/write of symbolic links.

@henryiii
Copy link
Contributor

henryiii commented Feb 1, 2022

No, given there are only three stars on it, I'm not sure it's common knowledge. And I'm pretty sure pip, pipx, wheel, poetry, pdm, etc. all use the standard lib to work with wheels, not zipfile2, so it would be of no help loading the wheels anywhere.

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 a pull request may close this issue.

2 participants