-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
The Linux wheels broke our build process #7570
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
Comments
To summarize, the problem is that your build process assumed that numpy does not have binary wheels on Linux, and the right fix - as you say - is to state this explicitly with I think your case is unusual, in that it is much more common for CI setups to want fast installs of earlier numpy, rather than distro specific compiles. At least I know a lot of projects that want to test against earlier numpy, and none of them are building .deb / .rpm packages. Maybe you agree that this is the right way to go in the longer term. It's somewhat hard to take the wheels down and put them back again, because a) I guess that some people will already be relying on them and I'm Cc'ing @yarikoptic because I know he builds a lot of Debian packages. Any thoughts? |
Well, in my case, while building debian packages I am not touching pip even with a long stick (using it otherwise on a daily basis) simply because I want to have guarantees that whatever packages I am building against are available now and in the future from the debian/ubuntu archives and if necessary I could also fetch their sources, thus knowing exact provenance of the materials in the packages I produce. Fetching some binary blobs from other locations dilutes such assurance. Note that debian policy altogether demands absent network communication (beyond apt repositories) exactly for that purpose -- that packages do not require anything but other packages. strip'ing and shlib issues though are intriguing and would be interesting if it is possible to have them resolved (may be not ;) ) |
The virtualenv-inside-deb packaging setup is reasonably common, given the popularity of dh_virtualenv. It's especially appealing when working on older distributions (Ubuntu 12.04), where many interesting Python packages are just not available or available only in ancient versions. In our case, @yarikoptic's approach would be rather painful, as we'd have to backport tons of Python packages to 12.04. It would be easier if there was some reasonable way to communicate this change to users. Having to find this out by digging through your CI failure logs after pushing a harmless change doesn't brighten anyone's day. Fixing the stripping issue (no clue) and the shlib issue (maybe adding an appropriate relative rpath would help) would also go a long way toward solving the issue. If things continue to work, few people will complain, even if they don't get exactly what they used to get. As @matthew-brett said, we can't update the already-published wheels on PyPI, though :-( For reference / Google, here are the errors that dh_shlibdeps generates:
|
I'm sorry this created problems for you. Unfortunately, you're going to have to find a solution for this in Possibly it should be taught to ignore errors in dh_strip -- I guess It also looks like auditwheel is being somewhat buggy in its RPATH handling -- libopenblas is indeed missing any RPATH/RUNPATH. This still works because libopenblas is getting loaded by multiarray.so, and multiarray.so does have a correct RPATH:
It would make sense for auditwheel to set an RPATH on libopenblas too, just to be thorough, and that might make dpkg-shlibs happier. |
On Mon, 25 Apr 2016, Christian Aichinger wrote:
yeah -- 12.04 is quite aged by now... still, just out of interest, what I saw dh_virtualenv lightning talk at pycon but never used it myself and
hm... interesting point. I saw tweets about wheels for numpy on linux
indeed, version was completely screwed up by joining with the git Yaroslav O. Halchenko |
Haha oh no, there's a whole epic story behind that filename -- it's an intentionally unique name (original name + truncated hash of content), and it's necessary to work around this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19884 |
Wheels by themselves are not the problem. The problems are wheels
But by this point it may be easier to keep everything as is (given that the PyPI packages can't be changed any more), and hope that this issue doesn't affect too many people. In hindsight, it might have been a better idea to add wheels to new versions for a year or so before pushing them for all the historic releases, especially given how many users numpy has and how little wiggle room PyPI gives you for fixing problems. I hope I'm not sounding too negative, it's a tremendous technical achievement and a great addition to NumPy. Thanks to all of you for working on this! |
…cts fails without this "fix". Also relevant, spotify/dh-virtualenv#150 and numpy/numpy#7570.
Has anyone confirmed that pre-built libraries (libgfortran-ed201abd.so.3.0.0 and libopenblasp-r0-39a31c03.2.18.so) are stripped? The file sizes lead me to believe that they're not and this is a huge issue when trying to do something like deploy to AWS lambda with it's 50mb zip limit. |
@EvenOldridge: I don't think anyone has followed up on that, no. If you're interested then the scripts used to build the numpy wheels are here. There's also a patch that might make the binaries strippable here, and in general it might be nice if auditwheel were modified to automatically strip the binaries it vendors. |
Thanks @njsmith I'll do some follow up and report back. |
@njsmith I also share the use case of AWS lambda. |
@danlg: I don't know, I haven't tried :-). I think the latest numpy wheels are using the new version of patchelf that's supposed to result in strippable binaries, but I don't know if it actually works. I don't think we're stripping before distribution, and we probably should be one way or another. If you wanted to fix that then many people might be grateful. |
@njsmith Update: I've tried to strip on Linux (with docker-lambda) and the stripped scipy libraries do not load: "ELF load command address/offset not properly aligned". But not stripping them result in AWS Lambda complaining about the zip over 250 MB when unzipped... Pandas seems to load though. So no solution at this stage for me. |
@danlg: can you confirm which version of the scipy wheel you're using that cause the problem? I just want to make sure they actually used the new patchelf... |
Can confirm the problem regarding stripping scipy shared object files with numpy 1.14.0 and scipy 1.0.0.
|
Updating the scipy and numpy build to the latest revision of |
@xoviat @matthew-brett Let me know when multibuild is in a good state so that I can update the numpy-wheels submodule commit. |
The wheels for the 1.14.1 release look to be stripped. I don't know that there is anything to be done about wheels for older versions. Kicking this off to 1.15 to wait for more feedback, but I don't think there is much more we can do. |
Someone could spend a chunk of their time rebuilding old wheels with build tags 🥇: |
I think this issue is exactly an example of why we should not mess with old releases. Imho we should document that as a policy (only change old releases in case of serious issues) and then close this. |
Closing. Although I believe the wheels for older versions could be fixed, the wheels have a version as part of the name so it is doable without new releases of old versions. @matthew-brett Ping. |
Yes, it could work - someone would have to rebuild all those wheels using the current stripping, and then post them with build tags. Is this still enough of an issue to justify that work, and the smallish risk that we'll break something? |
Not sure if it's worth it --- moreover, it will invalidate any checksums listed in release notes (although I guess the build tag changes file names, in which case it would not be such a problem?). |
Tangential, but I started seeing this building my own wheel with manylinux, due to numpy being built as a dependency. Fix was to avoid repairing third party wheels, including numpy, with pypa/python-manylinux-demo#7 (comment) |
…gfortran-ed201abd.so.3.0.0(GFORTRAN_1.0)(64bit) numpy/numpy#7570
We are running Ubuntu 12.04 and 16.04 on amd64 and we're building several Debian packages that contain NumPy in a Python 2.7 virtualenv. Recently, several of our build processes started failing because of the addition of Linux wheels to NumPy.
The wheels contain pre-built libraries (libgfortran-ed201abd.so.3.0.0 and libopenblasp-r0-39a31c03.2.18.so). For whatever reason, the Ubuntu
strip
command (used to remove debugging information) fails when called for these two libraries:Since
strip
is automatically called bydh_strip
during package build, that lead to the build errors. Even disabling stripping for this binary package lead to errors asdh_shlibdeps
(which generates Debian package dependencies based on ELF executable/shlib dependencies) also fails for these binaries.Steps to reproduce
In a freshly installed Ubuntu 12.04 or Ubuntu 16.04 on amd64, e.g. inside Vagrant:
Possible solutions
--no-binary
option in the futureFixing the
strip
problem alone is not a viable solution, sincedh_shlibdeps
still fails after that, because the two libraries are not native to Ubuntu.Broader issues
The pre-built wheel is great for individual users, but it's the wrong thing to use for anyone building RPM/Debian packages for others. Even if our build continued to work, we still wouldn't want to ship generic pre-built libraries. Silently slipping this change into older releases, is going to surprise a lot of people.
It's still going to surprise people if you start doing this in new releases only, but you could communicate this change more vocally via release notes, etc. so distributors/packagers are aware of it. Ultimately, they should all move to installing NumPy with
pip install --no-binary numpy numpy
, but that's not going to happen over night.The text was updated successfully, but these errors were encountered: