-
Notifications
You must be signed in to change notification settings - Fork 15
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
manylinux wheel doesn't work on Centos 7 / Python 3.8.2 #5
Comments
I was able to solve this by compiling locally. In case this is not fixed in the .whl yet, the steps for this are
|
Thanks for the thorough report. This is my first project with binary wheels, so I'm learning as I go, and I wouldn't be at all surprised if I've missed something important. Do you think this could be solved by building the Linux wheels inside a CentOS Docker container? Or, maybe this issue would go away if we built against musl instead of glibc? |
No, I don't think that will help, for two reasons:
I suspect that the Rust can use an older version of glibc (because otherwise I would not have been able to compile using rustup/cargo), but maybe not as old as the pre-installed libraries in manylinux1 containers. Where is your |
I don't maintain a
That is, whenever I push a tag, it builds a wheel on each CI target platform and uploads it as a tag asset on GitHub. Finally, if all those builds succeed, another job fetches each tag asset and uploads them to PyPI. Here's an example of one of these packaging CI runs: https://github.com/oconnor663/blake3-py/actions/runs/66240625 |
maturin has no home-page link on their PyPI page, but fortunately the page includes a reference to the docker container konstin2/maturin and the page for that has a link to a github project with a Dockerfile. I built a container from that file and expected its contents. It only has It would be good for maturin to document the restrictions in the documentation, to prevent false expectations. It might be easier to recommend building/installing libc 2.18 on CentOS 7... |
I've linked to this issue from the README. |
Here's how I would install
Then inside the container (where I'm root, so I don't need # You likely have some of these installed already, but the Docker container doesn't.
$ yum install -y git python3 gcc
# Install nightly Rust. Note that if you already have rustup installed, the Cargo
# command below will automatically download the nightly toolchain (because of the
# rust-toolchain file in the repo), and you can skip this part.
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh
$ sh /tmp/rustup.sh --default-toolchain nightly --profile minimal -y
# Get a copy of blake3-py. You could also download a release tarball.
$ git clone https://github.com/oconnor663/blake3-py /tmp/blake3-py
$ cd /tmp/blake3-py
# Build the shared library. I'm using an absolute path to Cargo, because although
# rustup edited my ~/.profile to add ~/.cargo/bin to my $PATH above, I haven't yet
# restarted the shell or sourced ~/.profile to make that take effect.
$ ~/.cargo/bin/cargo build --release
# Install the shared library. You will need to tweak this for the Python version
# and install path you're using.
$ cp target/release/libblake3.so /usr/lib/python3.6/site-packages/blake3.so
$ python3
Python 3.6.8 (default, Apr 2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import blake3
>>> blake3.__file__
'/usr/lib/python3.6/site-packages/blake3.so'
>>> blake3.blake3(b"foo").hexdigest()
'04e0bb39f30b1a3feb89f536c93be15055482df748674b00d26e5a75777702e9' |
Is there a supported way to go about that, without the risk of breaking all sorts of programs on the machine? |
I don't think that is a problem, as long you leave the link I am using manylinux1 for my ruamel.yaml.clib wheels without problem, but maybe that is because I only need to compile C code that is as about as old CentOS 5. If you start with a manylinux1 container, you can successfully build blake3 and run it, with some minor changes (older curl, python3 not in PATH) to your steps for the CentOS 7 container. If you create a
And then run:
You'll end up with |
So wait, have I just been doing everything wrong? 😅 I thought
I guess I'll try to integrate the Docker commands they have in the docs there with what I'm doing in CI. It sounds like that might just fix all the issues we're having? It's unclear to me how much of this was clear to you before, and how much you're learning at the same time as me :) |
Yes I thought that was what maturin was doing, but since I use manylinux1 myself directly that is what I tried. And that is what works with both manylinux1 and manylinux2010. I'll update the comment above. I would just include the docker command and the Dockerfile in your build process directly. |
#5 I had misread the documentation at https://github.com/PyO3/maturin#manylinux-and-auditwheel and thought that Maturin would do this automatically.
#5 I had misread the documentation at https://github.com/PyO3/maturin#manylinux-and-auditwheel and thought that Maturin would do this automatically.
I've just released version 0.1.5, which is built properly in the manylinux Docker container recommended by the Maturin docs. Testing it by hand in a CentOS 7 container seems to work, so hopefully this issue is resolved. Please let me know if you get a chance to test it yourself. Many thanks for reporting it and for helping me get it fixed. |
I installed and tested in 3.5, 3.6, 3.7, 3.8, and they all worked. The only hickup was that for Python 3.5 I got a message
which was caused by its old pip version not knowing about wheel files. I had to do Thanks for fixing this. |
I searched for the error message, which might be similar to PyO3/maturin#47 referenced in ijl/orjson#2 . I could not determine if that is indeed adressed in rust or Pyo3
The text was updated successfully, but these errors were encountered: