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

Add runtime dependency on patchelf-pypi #386

Open
lkollar opened this issue Jul 22, 2022 · 5 comments
Open

Add runtime dependency on patchelf-pypi #386

lkollar opened this issue Jul 22, 2022 · 5 comments

Comments

@lkollar
Copy link
Contributor

lkollar commented Jul 22, 2022

The patchelf-pypi project ships up to date patchelf binaries. Adding this to install_requires would mean that users don't have to track down and install the package with a different package manager.

Any thoughts @mayeut? Any reason not to make this a dependency?

@mayeut
Copy link
Member

mayeut commented Jul 30, 2022

Any reason not to make this a dependency?

There are a few reasons:

  • If I'm not mistaken, pipx installed auditwheel wouldn't work out-of-the-box without care (need to expose the entry point of a dependency which is not the default behavior). This could be solved by reworking the Patchelf class.
  • patchelf is only required for the repair command => this means a auditwheel show or a future auditwheel check could be run on any platform (not only linux for a check command) without patchelf which will probably never have macOS or Windows wheels.
  • OS packagers will want to remove this dependency and use their own version of patchelf (like they are doing today e.g. in Fedora)
  • Someone using a custom/system version of patchelf will need to go the extra mile to use it

Maybe a good first middle ground would be to add the dependency as an extra and update the documentation accordingly ?
e.g. pip install auditwheel[patchelf] or even just pip install auditwheel patchelf with no extra.

@lkollar
Copy link
Contributor Author

lkollar commented Aug 16, 2022

  • patchelf is only required for the repair command => this means a auditwheel show or a future auditwheel check could be run on any platform (not only linux for a check command) without patchelf which will probably never have macOS or Windows wheels.

This could be solved by making patchelf a platform-specific dependency when/if we add support for other platforms.

  • OS packagers will want to remove this dependency and use their own version of patchelf (like they are doing today e.g. in Fedora)

Good point. I agree that this is problematic.

Maybe a good first middle ground would be to add the dependency as an extra and update the documentation accordingly ?
e.g. pip install auditwheel[patchelf] or even just pip install auditwheel patchelf with no extra.

Good idea. And this is pretty simple to implement. We could also note this in the error message if auditwheel cannot find patchelf.

devinrsmith added a commit to jpy-consortium/jpy that referenced this issue Nov 4, 2022
See https://docs.python.org/3.11/whatsnew/3.11.html#whatsnew311-c-api-porting

Added Py_SET_TYPE compatibility
Added Py_SET_SIZE compatibility
Added PyFrame_GetCode compatibility
Added explicit patchelf dependency instead of relying on system binary, not included by default (see pypa/auditwheel#386, pypa/auditwheel#403)
Added Python 3.11 CI logic

Fixes #95
@bigcat88
Copy link

patchelf-pypi do not provide wheels for Alpine at all and for debian\alpine with armv7 CPU.
will adding those dependency will try to install patchelf-pypi from source even if patchelf was installed with package manager or builded from source?

@mayeut
Copy link
Member

mayeut commented Nov 27, 2022

patchelf-pypi do not provide wheels for Alpine

yes it does

patchelf-pypi do not provide for debian\alpine with armv7 CPU

you're right, it doesn't

will adding those dependency will try to install patchelf-pypi from source even if patchelf was installed with package manager or builded from source?

Yes it would and that's one reason I'm not in favor of adding this dependency and proposed something else.

@jvolkman
Copy link
Contributor

FWIW I implemented a pure-python patchelf replacement that I use in my repairwheel tool (which wraps auditwheel and the other two related delocate and delvewheel). One caveat is that strip doesn't like the result, as I took a different, less invasive approach than patchelf. But one could always strip prior to patching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants