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

ENH: support shared libraries on Windows when explicitly enabled #551

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dnicolodi
Copy link
Member

No description provided.

@dnicolodi dnicolodi force-pushed the shared-libs-win32 branch 2 times, most recently from 950e49d to d56441c Compare December 9, 2023 19:41
Assume all platforms except Windows and macOS use ELF binaries.
@dnicolodi dnicolodi force-pushed the shared-libs-win32 branch 2 times, most recently from eaa7d4f to d8e872a Compare December 9, 2023 19:52
and uses RPATH or equivalent mechanisms to have Python modules and native
executables load them form there. Windows does not have an equivalent
mechanism to set the DLL load path. Supporting shared libraries on Windows
requires collaboration from the package. To make sure that package authors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to explain (or link to something that explains) what sort of "collaboration" is needed.

@@ -430,6 +432,9 @@ def _install_path(self, wheel_file: mesonpy._wheelfile.WheelFile, origin: Path,

if self._has_internal_libs:
if _is_native(origin):
if sys.platform == 'win32' and not self._shared_libs_win32:
raise NotImplementedError(f'Bundling libraries in wheel is not supported on {sys.platform}')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mention the configuration option?

@@ -757,6 +763,10 @@ def __init__(
if not value:
self._limited_api = False

# Shared library support on Windows requires collaboration
# from the package, make sure the developpers aknowledge this.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# from the package, make sure the developpers aknowledge this.
# from the package; make sure the developers acknowledge this.

Copy link
Contributor

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good approach, I like it. A couple of thoughts:

  1. Internal shared libraries can be made to work today already in a package using meson-python, when explicitly installing the shared library without the package and using delvewheel (in an elaborate way) and install_rpath on other platforms, as demonstrated by BUG: Fix for scipy.special seterr, geterr, errstate scipy/scipy#20321. I think this PR is fine as is; I did have a concern that not having the option set shouldn't start raising an exception, so let's make sure that that remains the case.

  2. As @QuLogic commented, it'd be good to elaborate on the best ways for a package to do this. I think there are two:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants