-
Notifications
You must be signed in to change notification settings - Fork 219
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
stripping some manylinux generated files produces broken shared objects #119
Comments
This must be a bug in patchelf. NixOS/patchelf#117 is the PR that allegedly reworked how it works to make binaries strippable... We might also want to reconsider having auditwheel strip binaries, to sidestep the whole mess around stripping-after-patchelf. |
CC @rpurdie as the author of that patchelf PR, in case they have some idea. |
I am not opposed to that pragmatic choice. |
Stripping by default in auditwheel sounds like a bad idea, but if patchelf works properly after stripping, I would be fine with adding stripping as an option to auditwheel. |
These particular versions don't cause "ELF load command address/offset not properly aligned" errors when stripped. Everything else is pinned in case they start triggering similar problems in the future. See pypa/manylinux#119
These particular versions don't cause "ELF load command address/offset not properly aligned" errors when stripped. Everything else is pinned in case they start triggering similar problems in the future. See pypa/manylinux#119
Still occuring in scipy as of 1.0.0. Comparing to a package that doesn't have the issue, like numpy, it appears that scipy is using a significantly older https://github.com/matthew-brett/multibuild, https://github.com/matthew-brett/multibuild/tree/e6ebbfa42588c26579eff99c50e84326dd9f6b3e in scipy as compared to https://github.com/matthew-brett/multibuild/tree/07480be3e0b3490495cb8a9629e55be54c3adac3 in numpy, so maybe that could have something to do with it? At this point I'm not even sure at what point in the build chain this issue might be getting introduced, but getting any traction on this would be a big help to us. |
I still think it makes sense for auditwheel to strip by default (though of
course with an option to disable that). One option would be to write such a
patch for auditwheel. Alternatively if Robert is still opposed, a patch to
allow opt-in stripping plus patches to the scipy build scripts to enable
that option would probably be accepted. I don't think anyone else is likely
to address this soon if you don't.
On Nov 7, 2017 18:28, "gotyaoi" <[email protected]> wrote:
Still occuring in scipy as of 1.0.0. Comparing to a package that doesn't
have the issue, like numpy, it appears that scipy is using a significantly
older https://github.com/matthew-brett/multibuild,
https://github.com/matthew-brett/multibuild/tree/
e6ebbfa42588c26579eff99c50e84326dd9f6b3e in scipy as compared to
https://github.com/matthew-brett/multibuild/tree/
07480be3e0b3490495cb8a9629e55be54c3adac3 in numpy, so maybe that could have
something to do with it? At this point I'm not even sure at what point in
the build chain this issue might be getting introduced, but getting any
traction on this would be a big help to us.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#119 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAlOaNIBu1BEwvjismctVbSiu9AXxEqcks5s0PW4gaJpZM4OF7T7>
.
|
Likewise. Where's the best place to find (and reproduce) how scipy's manylinux release wheels are built? For anyone else who's hitting this a crude workaround for now is avoiding stripping the problematic binaries via something to the effect of
but that doesn't help with size as much as I'd like. If stripping before running patchelf will work, I may create my own wheels with that performed. It's not easy to find where the pypi released wheels are built from though. |
Scipy's wheels built from https://github.com/MacPython/scipy-wheels |
Thanks @matthew-brett, I'm trying to dissect that enough to re-run a build myself either locally or on CI so I can manually add a strip call before auditwheel/patchelf corrupt things. I tried with the latest nightly build at http://8b8c47f30575e674b56d-47bd50c35cd79bd838daf386af554a83.r59.cf2.rackcdn.com/scipy-1.1.0.dev0+20171221163716_bdc562f-cp27-cp27mu-manylinux1_x86_64.whl and it also has this issue, despite being built with a more recent multibuild as far as I can tell from MacPython/scipy-wheels@db2510b |
https://github.com/tkelman/scipy-wheels/raw/v1.0.0-stripped-before-auditwheel/wheelhouse/scipy-1.0.0-cp27-cp27mu-manylinux1_x86_64.whl seems to work so far, generated via tkelman/multibuild@dd1220b and tkelman/scipy-wheels@ce9385e. I hope that looks sane to people who are familiar with the wheel-building process. It's roughly half the size of the non-stripped release wheels. One thing to note is that you'll have to exclude even these already-stripped scipy binaries from any later attempts to strip them, since that would break again. |
I'll note that libhdf5-b2d0cb23.so.10.2.1 from the manylinux wheel for h5py 2.7.1 has the same problem if you try to strip |
we were running into pypa/manylinux#119 here apparently, @sdrave
Similar to @tkelman - using a work-around to exclude some files from the strip, but hope to track progress on this issue for an upstream solution. While trying to optimize lambda layer build for python3.6 on lambci, using something like this: strip_binary_libs() {
site=$1
echo "Optimizing binary libraries *.so.* in $site ..."
find "$site" -type f \( iname '*.so.*' ! iname '*libgfortran*' ! -iname '*libgdal*' ! -iname '*libproj*' \) -exec strip {} \;
echo "Optimizing cpython compiled libraries in $site ..."
find "$site" -type f \( iname '*.cpython*.so' ! iname '*netCDF4*' \) -exec strip {} \;
}
package_dst=$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')
strip_binary_libs "$package_dst" Running a project test suite on the venv indicates whether or not the venv will work for the project involved. Some packages in the venv may have various levels of optimization for lazy-loading modules that are not touched by the project - those modules might load stripped libraries that are broken, but never imported by the project. It's not a comprehensive solution, only a trial-n-error exclusion for the project concerned (rather than a test of all packages in the venv). |
Running into this as I'm trying to package an RPM with PySide in it on CentOS 7... I've been working around these |
The option |
Our bundled binaries seem to have been not working for some time. We had two separate issues: - The `av` dependency (via `aiortc`) wasn't being properly discovered by PyInstaller. This has been fixed with a hook. - On Linux stripping of the libraries apparently causes some corruption See: pypa/manylinux#119 Therefore stripping is disabled for now. This also fixes: - Don't include unnecessary av libraries in the bundle - Remove no longer used GETH_URL and SOLC_URL build args from the `bundle-docker` make target. - On CI: Invoke the built binaries with `--help` as a minimal functionality sanity check.
Our bundled binaries seem to have been not working for some time. We had two separate issues: - The `av` dependency (via `aiortc`) wasn't being properly discovered by PyInstaller. This has been fixed with a hook. - On Linux stripping of the libraries apparently causes some corruption See: pypa/manylinux#119 Therefore stripping is disabled for now. - The gevent runtime hook would attempt to start the aio event loop. This caused a warning about an already running loop. This also fixes: - Don't include unnecessary av libraries in the bundle - Remove no longer used GETH_URL and SOLC_URL build args from the `bundle-docker` make target. - On CI: Invoke the built binaries with `--help` as a minimal functionality sanity check.
Our bundled binaries seem to have been not working for some time. We had two separate issues: - The `av` dependency (via `aiortc`) wasn't being properly discovered by PyInstaller. This has been fixed with a hook. - On Linux stripping of the libraries apparently causes some corruption See: pypa/manylinux#119 Therefore stripping is disabled for now. - The gevent runtime hook would attempt to start the aio event loop. This caused a warning about an already running loop. This also fixes: - Don't include unnecessary av libraries in the bundle - Remove no longer used GETH_URL and SOLC_URL build args from the `bundle-docker` make target. - On CI: Invoke the built binaries with `--help` as a minimal functionality sanity check.
Attempting to strip some of the .so files from some manylinux generated packages will run without error messages, but the resulting file is broken. ldd claims it is "not a dynamic executable" and trying to import it from python gives "ELF load command address/offset not properly aligned".
perhaps related to #78
Here's an example with scipy/special/_ufuncs.so, though the problem affects about 21 of the 91 .so files in scipy
steps to reproduce:
The text was updated successfully, but these errors were encountered: