-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow to skip downloading manylinux wheels #3689
Comments
You can drop a manylinux1_compatible = False Does that satisfy your use case? |
Thank you for quick response. It might -- need to test this. But I'd still prefer some kind of command line option (ie |
Got bitten by this too. Creating a |
We got bitten by this too. Builds that used to work (on CentOS 5, CentOS 6) still seemed to work but the final PyInstaller build does not work. |
@dstufft -- I'm wondering it you decided on implementing an option to skip manylinux1 wheels download? FOr some reason, I'm getting bitten by this over and over. Keeping |
There is an issue suggesting that the non-manylinux1 tag should have precedence over the manylinux1 tag. Would that solve your issue? |
No it will not. I'd like a flag to ignore manylinux entirely (and download source distribution or other wheels). |
Have you tried publishing a package that provides _manylinux.py and installing that into your virtual environments as a matter of course? |
Yes, but I consider it a dirty hack (why should installing a package have a side-effect of changing how pip functions?). It also doesn't work in all cases for example system pip where I do not control dist-packages. |
If anyone is interested in writing a PR for this, that would probably help move it forward (a command line option would make the most sense, as that would automatically support setting it in the ini file or via an environment variable). Otherwise, supplying |
I started working on a patch, does this seem sane before I start figuring out how to test this? https://github.com/pypa/pip/compare/master...asottile:no_manylinux?expand=1 For example: Default
With
|
@asottile -- why don't you submit pull request so somebody could review it and provide comments? |
Sure, felt like I should get a first round of feedback on the initial approach since it is untested currently but I can do that |
Could this be a problem wIth the new manylinux download being run unnecessarily? Then if someone really wants pip to not use a locally available wheel, they shouldnt put it in a place that pip is looking for local wheels. |
This too. But most importantly, I want an option in pip which will disable manylinux completely. Currently, I need to check if manylinux wheel somehow got downloaded and kill it in the wheelhouse. This is very annoying at times. |
Our main usecase is we do a one-time download / build of wheels to put in our internal pypi server and manylinux wheels are very much incompatible with our security requirements. |
Any solution which focuses on
If I understand correctly, you want pip to not download binary from a foreign repo, but you are happy with a binary being built and used locally. But there could be a Windows shop which has the same security requirements, and a In which case you want to be able to disable binary for foreign repo, and then the Windows shop will also be able to use the solution. |
It's not that it's binary from a foreign repo, it's that shared object files of libraries (that often have security fixes such as libxml, libssl, etc.) are straight vendored into the wheel. The windows shop is probably already ok with |
Can you give an example? Maybe there is a generic way to improve pip such that it excludes/rejects those prebuilt wheels, only when they include undesirable contents, which could also occur on Windows. |
@jayvdb example is numpy -- it comes as manylinux wheel, with builtin libraries which aren't compatible with the system and caused me couple hours of headache when I accidentally downloaded manylinux wheel and used it to install numpy. So I'd rather have |
numpy/numpy#7570 appears to be the only open issue related to manylinux. It does confirm they are shipping .so's and causing many problems in the process. :/ |
I'd rather not have a "manylinux" specific option. Maybe a more general option |
Manylinux is already a special case in pip. I also still want to be able to download normal binary wheels (such as from an internal pypi server). |
Is manylinux not simply a specific compatibility tag? (I'm not that familiar with how manylinux is implemented). I would assume that Linux platforms state that they support a set of compatibility tags that includes manylinux, but that they prefer platform-specific binaries over manylinux. In which case, the more general option would be to have something that allows users to remove tags from the list of supported compatibility tags. In any case, I agree with @xavfernandez that we should prefer general solutions over special cases. The compatibility tag mechanism handles this (or should, it's what it was designed for) so I'd prefer manylinux to work within that framework (and then this issue becomes "we need a way to override the default platform compatibility list"). |
Here's where pip special cases manylinux: Line 278 in a88beb1
|
OK. I wonder why it replaces linux with manylinux, rather than just adding a lower-priority manylinux. |
The biggest reason being it's not possible to avoid them in a single install command, the other reason is it's yet another thing to update when new manylinux standards appear (apparently it's been years since 2010 but hadn't been updated until today for instance). The other is it's not really a system per se, it's more akin to the |
Oh, the number is reflecting the date of the oldest systems that is compatible with that version. I don't have he dates for manylinux2010 off hand but manylinux2014 became an approved PEP last month. 🙃 |
Alrighty. Let's add an option to pip to handle this on a per-install basis. I honestly don't think this is high priority for me but we'll be happy to accept a PR for this (subject to the regular PR reviews). |
I'm still not convinced we need a special case option in pip. We already have a plethora of options for special-case tweaking of what gets installed, and the maintenance overhead is non-trivial. While I don't particularly think that a "no manylinux" option will add significantly to that burden, it is nonetheless another step down that slope. I'm not going to block a PR for this, but I want to strongly advise caution when considering it. How many users will it benefit? How often will it be the only possible solution for such users? How does that measure against the added technical debt (and user confusion cost) that this incurs? |
I know this is a long conversation already, but one thing that has not been pointed out is that, from a security perspective, this seems not to be a As mentioned above:
This vendoring can occur not just via |
With PEP 600 and pip moving to use As it is already possible to disable this behavior, via |
the |
For what it's worth, there's a usecase here that isn't easily covered by the For example, packaging up a package and its dependencies with
Alpine does not support Essentially, this is similar to cross-compiling, so would it be acceptable to allow constraining which packages pip is allowed to use in a |
@tobyp I believe that's a related but entirely separate problem -- and in general building wheels on a disparate platform is not going to work. for example, if you produce a wheel which links against libc (even if it isn't downloading this wheel which is what this issue is about) |
@asottile Thanks for the reply, and explaining the difference between this issue and my use case! I've managed to solve my problem using multi-stage docker builds that produce For what it's worth, if it's only about preventing the installation of |
With the latest version of pip ( |
@ccoulombe same as above, install |
Thanks @asottile
|
works fine for me: $ pip install orjson-3.7.8-cp38-cp38-manylinux_2_28_x86_64.whl
ERROR: orjson-3.7.8-cp38-cp38-manylinux_2_28_x86_64.whl is not a supported wheel on this platform. |
Right! On my personal computer, it works as expected.
I'm still able to install the orjson manylinux wheel. With and without the If I add the The system Thanks @asottile! |
yeah your _manylinux.py file is wrong |
What is the action item for pip here? If there’s not one, should we close this issue? |
As user perspective, document how to achieve this? This being, ignore manylinux wheels by using a system/site |
Retagged to reflect that documentation for this is the right thing to do here. |
Description:
When PIP 8.1 introduced support for manylinux1 wheels, few issues started to show up when attempting to build wheels. We use custom Python installation, installed in other than system Python location. When we upgrade our package requirements, we re-build wheels ourself using command below:
Pre-PIP 8.1, this command did what I expected: build wheels for new packages in the requirements.txt file. After PIP 8.1, it just download manylinux wheels despite the fact that
/path/to/wheel
already has an wheel for the requirement.Let's take an example: One of the packages we use is numpy. Requirements string looks like this:
numpy==1.10.4
. This ensures we use only this package version. What PIP pre-8.1 did: It detected that wheel for numpy 1.10.4 was already built and did nothing else. What PIP 8.1.x does: it downloads manylinux1 wheel, despite the fact that I already have wheel for 1.10.4 and wasn't updating numpy wheel.You might suggest adding
--no-binary numpy
, but that won't solve my problem either -- I don't want to rebuild numpy package every time I build wheels, and I don't want to select only updated packages to build wheels. I like what I had before:-r requirements.txt
and it did the job.So what I'm asking here is either of two:
The text was updated successfully, but these errors were encountered: