Skip to content

Documented technique for internal shared libraries does not work under editable installs on Windows #940

Backlog

Description

@lpsinger

The instructions for internal shared libraries on Windows do not work with editable installs. I think the problem is simply that, in an editable install, meson-python does not install the libraries to the .{package}.mesonpy.libs directory.

This could be fixed by either creating and installing such a directory during editable installs, or making their location in the build directory discoverable using importlib.resources in the generated _{package}_editable_loader.py file.

The project in which I came across this issue (https://github.com/healpy/healpy) has several internal shared libraries that come from wrapped subprojects. Here is a minimal reproducer: https://github.com/lpsinger/editable_install_on_windows_with_internal_shared_libraries

Note failed editable install in the GitHub Actions log, here: https://github.com/lpsinger/editable_install_on_windows_with_internal_shared_libraries/actions/runs/46351697574/job/141626481962

The error message is:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\a\editable_install_on_windows_with_internal_shared_libraries\editable_install_on_windows_with_internal_shared_libraries\src\example_project\__init__.py", line 40, in <module>
    _append_to_sharedlib_load_path()
  File "D:\a\editable_install_on_windows_with_internal_shared_libraries\editable_install_on_windows_with_internal_shared_libraries\src\example_project\__init__.py", line 35, in _append_to_sharedlib_load_path
    os.add_dll_directory(subdir)
  File "<frozen os>", line 1154, in add_dll_directory
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'D:\\a\\editable_install_on_windows_with_internal_shared_libraries\\editable_install_on_windows_with_internal_shared_libraries\\src\\example_project\\..\\.example_project.mesonpy.libs'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions