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

Automatically repair to the most compatible/oldest platform tag #390

Open
sevagh opened this issue Jul 28, 2022 · 1 comment
Open

Automatically repair to the most compatible/oldest platform tag #390

sevagh opened this issue Jul 28, 2022 · 1 comment

Comments

@sevagh
Copy link

sevagh commented Jul 28, 2022

Hello all,

I'm wondering if I'm thinking about this correctly; wouldn't I want my wheels to have the lowest manylinux, such that more users can install it?

I'm building wheels using the manylinux_2_28 environment. Some of the C++ code uses newer symbols than others and need a more constrained/newer manylinux platform.

As an example, I build both foo.whl and bar.whl in manylinux_2_28;

  • foo.whl can be repaired to manylinux_2_24_x86_64
  • bar.whl can be repaired to manylinux_2_17_x86_64

auditwheel show will give you this information, by printing it with a bunch of text.

Foo:

$ auditwheel show foo.whl

foo.whl
is consistent with the following platform tag:
"manylinux_2_24_x86_64".

The wheel references external versioned symbols in these
...

Bar:

$ auditwheel show bar.whl

bar.whl
is consistent with the following platform tag:
"manylinux_2_17_x86_64".

The wheel references external versioned symbols in these

Next, I want to run auditwheel repair --plat=${most-compatible-platform} *.whl

  1. I can either try to parse the output of auditwheel show (using grep etc.) - little bit tricky, especially when using cibuildwheel
CIBW_REPAIR_COMMAND_LINUX=auditwheel repair --plat=$(auditwheel show {wheel} | grep | awk | whatever) {wheel}
  1. Maybe auditwheel show can have a shorter output flag, e.g. auditwheel show --only-plat, so it can be more easily used:
$ auditwheel show --only-plat bar.whl
manylinux_2_17_x86_64

More usable in a compound bash command:

CIBW_REPAIR_COMMAND_LINUX=auditwheel repair --plat=$(auditwheel show --only-plat {wheel}) {wheel}
  1. Or, perhaps an auditwheel repair --auto-plat to combine the logic

Perhaps I'm missing some knowledge as well:

  • Is it even desirable to have this behavior?
  • Is there a downside I'm not considering?
  • Can this already be achieved with auditwheel by some feature or flag I missed?

Thanks in advance.

@jvolkman
Copy link
Contributor

I agree and have the same question. Ideally auditwheel would have a --plat auto mode which would just select the best possible compatibility tag. Then I could adjust the compatibility of my wheels by adjusting the target sysroot - which I'd need to do anyway - without messing with auditwheel parameters.

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

No branches or pull requests

2 participants