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

feat: Integrate wheel repairer #1009

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

Conversation

LecrisUT
Copy link
Collaborator

@LecrisUT LecrisUT commented Mar 4, 2025

The goal of this is:

  • Get the linked libraries from the configure step
  • Check if the paths start with the current build environment's sysconfig.get_path("platlib")
    (pip fake venv is really annoying here)
  • If so patch the RPATH to be relative paths
  • Patch existing RPATHs of the current wheel files, e.g. from CMAKE_INSTALL_RPATH_USE_LINK_PATH
  • For windows systems, add dlls to Scripts path.
    Maybe would be better to use the existing paths instead.
  • Do some other magic that delvewheel does
    Afaict, the only special thing it does is inject os.add_dll_directory. Cannot support subprocess.run right now, but we could do it if we generate the wrappers. Will make a subsequent PR for that.

To discuss:

  • Should this be separated as a standalone plugin and instead expose an entry-point scikit-build.repair-wheel?
  • Initially I was considering using auditwheel/delocate/delvewheel directly, but these do not handle differently the packages in site-package vs external
  • Do we extend the interface to pick up system packages as well? I was thinking that the repairwheel trio can do all the hard work generally, but maybe the user needs more nuanced configuration, e.g. with Qt/PySide the requirement is to bundle the Qt framework uniquely, compared to dlevewheel which creates separate dlls for each wheel.

Depends-on: #1022 #1016

@LecrisUT LecrisUT force-pushed the feat/repair-wheel branch 4 times, most recently from 45d04fd to 04d9881 Compare March 10, 2025 12:05
@LecrisUT

This comment was marked as resolved.

@LecrisUT LecrisUT force-pushed the feat/repair-wheel branch 25 times, most recently from 81f9407 to 9cc8ea9 Compare March 17, 2025 14:13
@LecrisUT LecrisUT force-pushed the feat/repair-wheel branch 4 times, most recently from 4c7cd84 to eed17ef Compare March 17, 2025 17:02
@LecrisUT LecrisUT changed the title [WIP] feat: Integrate wheel repairer feat: Integrate wheel repairer Mar 17, 2025
@LecrisUT LecrisUT marked this pull request as ready for review March 17, 2025 17:03
@LecrisUT LecrisUT force-pushed the feat/repair-wheel branch 5 times, most recently from 06b07c5 to 16f1b26 Compare March 18, 2025 13:37
@LecrisUT LecrisUT requested a review from henryiii March 18, 2025 13:38
@LecrisUT
Copy link
Collaborator Author

Ready for review for this initial proposal. Further proposals that I want to build up from this

  • Expand the wheel.repair to accept more complex repairs
  • Make the repair-wheel plugin-able, allowing to specify either a script (PEP723 looks really nice for this) or a entry-point, to allow more fine-grained repairs
  • Add an option to bundle a glob list of libraries

LecrisUT added 14 commits March 21, 2025 20:43
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
`auditwheel` pacher forces `DT_RPATH`. Here instead we use `DT_RUNPATH` so that it can be overwritten by the user

Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
This is needed because the last delocate package that supports python 3.8 does not have _get_rpaths

Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
@LecrisUT LecrisUT force-pushed the feat/repair-wheel branch from 16f1b26 to 08014a5 Compare March 21, 2025 19:43
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 this pull request may close these issues.

1 participant