-
Notifications
You must be signed in to change notification settings - Fork 263
Adding support for building manylinux2010 wheels #135
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
Conversation
84f1964
to
6487e25
Compare
This is actually happening in the tests. I'm not entirely sure why, but I'll see if we can test that the right wheels are copied. See here, for example: https://travis-ci.org/joerick/cibuildwheel/jobs/522327295#L976 |
] | ||
|
||
# skip builds as required | ||
python_configurations = [c for c in python_configurations if build_selector(c.identifier)] | ||
|
||
platforms = [ | ||
('manylinux1_x86_64', manylinux1_images.get('x86_64') or 'quay.io/pypa/manylinux1_x86_64'), | ||
('manylinux1_i686', manylinux1_images.get('i686') or 'quay.io/pypa/manylinux1_i686'), | ||
('manylinux1_x86_64', manylinux_images.get('manylinux1_x86_64') or 'quay.io/pypa/manylinux1_x86_64'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these default images be here, or should they actually be in main.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joerick This is about the code style, rather than platform/ABI-related. Any preferences, here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joerick Thus linor code organizational detail is still open, as well.
I'm not sure we'll be seeing
I'm not sure the |
I'm not a fan of this feature in fact. I don't know if you are but I'll probably open an issue and/or PR over at auditwheel to at least having an option to enforce the Would |
It's a bit weird indeed; but then again, it's nice to signal to the user that it's even more compatible than expected/asked for? In principle, there's no good reason for uploading
I thought of that as well, but it doens't work with the pure Python case:
|
9774c26
to
17ccf6b
Compare
Thanks for the quick replies, @mayeut! I hope this commit has a workaround for multiple repaired images, if we want to only return one, instead of all, to the On a separate note, @joerick: we should rework the tests, I feel. There's no way of specifying what output wheels are expected by each test, so I don't see an obvious and clean way of checking the |
Agreed for signaling.
Once again, agreed. Now that I'm reading it again, I might change my point of view. The thing I disliked was that the wheels produced might change from manylinux1 to manylinux2010 silently (and I want to know this, not discover it, but maybe I'm too paranoid). This can be overcome by forcing manylinux1 with the Still remains the fact that they're are 2 wheels to deal with which, as you saw, is something that needs work when integrating. Maybe only one shall be produced, i.e. the manylinux1 rather than the manylinux2010 when possible. If you want a test that only produces manylinux2010 wheel, you can add that to one of the tests (I did add it on test/01_basic/spam.c when testing the manylinux2010 image):
|
@YannickJadoul yes the tests are much overdue some improvements. I'm thinking each test folder gets some kind of script that can set env, run cibuildwheel and then assert what ever it likes. I can maybe look at this early next week On the multiple wheel thing - (I'm very happy to delegate decisions to you both since you're way more knowledgeable than me!) I'm a little confused about the difference between the ABI and the toolchain. i.e. what it means to have a manylinux1 wheel produced with the manylinux2010 toolchain... is that better or worse than a manylinux1 wheel from the manylinux1 toolchain? |
This is a good point, actually. I hadn't considered that.
But indeed, I think this is the most confusing/hard-to-deal-with part. But I like your suggestion, there. If you consider it like this, the To relate it to my previous comment:
There are probably efficiency advantages of building on the I'll wait for further discussion in pypa/manylinux2010#179 before deciding whether to revert that Thanks for the test example, by the way! That seems very useful. I'll quickly add it in a new test :-) |
I like that idea! Though maybe we'd only move the asserts to this script, and have the main test-script still call
@mayeut definitely is. I've just been forced into this thing, when I wanted to use C++14 for
As far as I understand (please correct me if I'm wrong), the newer toolchains are allowed to use the newer ABI, but if they happen to not (as in our very basic test, apparently), the produced wheel is still |
@mayeut Am I doing something wrong, there? I made a mistake when specifying the |
Exactly my thought. We could benefit from a newer toolchain with probably an improved optimizer (or support for extended instruction set like AVX512) and still be I'm quite surprised the |
Good point; it does indeed seem as if no tests are run. And given that the file it's |
30cc3e1
to
2a787e8
Compare
Just following this logic... can we, then, drop the manylinux1 image and build both manylinux1 and manylinux2010 wheels on the manylinux2010 image? Then, by default, our users get an updated toolchain, even if they're still building manylinux1-compatible wheels? EDIT- I guess i686 would have to be the old manylinux1 image, though. |
Hmmm, I don't think so, because things built inside the |
…r different platforms
07ac0ae
to
231a705
Compare
231a705
to
cf1d9ac
Compare
cf1d9ac
to
ecd9a02
Compare
Right, rebased on #137, and tests are working again. So now the last things before this can be merged are:
Anything else missing? I don't think so, but I might be forgetting something important, ofc. |
My best guess would be not to change the defaults for now in As for what to do with the 2 wheels, they're still being produced and I don't think it'll change in the short term. However, it was also confirmed by former |
I think I agree, but technically this is not entirely straightforward, since the current solution just offers more 'build tags', rather than a switch between Alternatively, we could approach this in a different way, and rather than adding build tags, add something like
OK, good to know, thanks! |
Hello! Looks like this is waiting on a decision on UI/options? Maybe I can try a recap of this, let me know if I've got this right:
Have I got that right 😬 ? |
Yes, except for a few minor decisions, this should be ready.
Kind of.
Yes.
No. EDIT: |
…ckcross/manylinux2010-x64
173892d
to
235567c
Compare
else | ||
auditwheel repair "$built_wheel" -w /tmp/delocated_wheel | ||
auditwheel repair --plat {platform_tag} "$built_wheel" -w /tmp/delocated_wheel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mayeut I saw your PR pypa/manylinux#293 adding AUDITWHEEL_PLAT
was merged. Do you suggest removing the --plat
flag (being simpler), or do you advise keeping it here?
Is there anything that prevents this from being merged? Based on the recent discussion at pypa/manylinux#179, it would be ideal to make the manylinux2010 image the default builder (because it's CentOS 6), even when manylinux1 policy is the target. For security. pypa no longer links to the manylinux1 Docker image because it's a few years beyond EOL. |
@jbarlow83 I've been following that thread and Elana's post today is exactly what I was waiting for in terms of how we support manylinux2010 in cibuildwheel. Which is, I think- we should build both manylinux1 and manylinux2010 wheels using the manylinux2010 image, and discontinue the manylinux1 image going forward. For cibuildwheel's API, building using manylinux1 image should be discontinued (or at best, available via an option), and the Linux builds should take place on the manylinux2010 images, by default. Thoughts @YannickJadoul @mayeut? I'm wondering- Does this put us in a tricky place wrt how the CIBW_BUILD and CIBW_SKIP options work? Now auditwheel decides whether to output a manylinux1 wheel or not, rather than the options provided to cibuildwheel. Perhaps we should now consider manylinux1 wheels a bonus side effect, but not request them explicitly in the CIBW_BUILD param. (We could add another option to fail the build if they're not produced) |
@jbarlow83 @joerick Sorry for the delay; I'm currently on holiday and I've been putting off thinking about and replying to this messy matter 😉 My 5 cents:
If I understand correctly, the problem with that is that you're not guaranteed to build This means that if you are lucky, and your library/compiler uses only symbols that are already present in the However, because a later version of So sometimes, a wheel built on a platform that isn't built on the
In the current version of the PR, this wouldn't be the default. The default would be to produce both. Which might be a bit of overkill?
In this PR, I just added
I've just checked, and NumPy seems to still produce |
It's not overkill to make the manylinux2010 image the default builder. It's preferable, because that image can still produce manylinux1 wheels and will do a better job of that thanks to newer compilers. numpy is a good source for best practices, but not on this topic. The best practice for numpy is to use the system version rather than a wheel, because the version from a wheel is currently built with the CentOS 5 version of As for how auditwheel does its thing, it determines what symbols are missing just by reading the relevant sections of the ELF and comparing to them a built-in policy. cibuildwheel could either call |
OK, yes, I agree with that :-) I thought the suggestion was to abolish manylinux1 completely, in
Yeah, but it won't reliably do that, will it? There's no way to force building a manylinux1 wheel on a manylinux2010 image, is there?
OK, fair enough. Thanks for the explanation! Either way, maybe the current PR is not the best way to do this, then, given that |
Closed in favour of #155 |
That was actually easier than expected (if it now also works, of course). See also #65.
A few comments/remarks/things to consider:
cibuildwheel
generate bothmanylinux1
andmanylinux2010
wheels, by default?manylinux2010
is almost there, but still considered experimental. If this works, do we release a new version that buildsmanylinux2010
by default, or do we turn it of by default?manylinux2010_i686
is not available yet. This page seems to indicate it will still be created at some point.--plat
argument toauditwheel repair
anymore: https://github.com/matthew-brett/multibuild/issues/238#issuecomment-484684645manylinux1
andmanylinux2010
compatible,auditwheel repair
will produce both (see Tracking issue for manylinux2010 rollout manylinux#179 (comment) and ENH: add multilinux2010 python-manylinux-demo#19). Sodelocated_wheel=(/tmp/delocated_wheel/*.whl)
and"$delocated_wheel"
to select the first won't work anymore? (I'm testing this in a minute to confirm this.)