wheel2deb icon indicating copy to clipboard operation
wheel2deb copied to clipboard

numpy build fails

Open smartsammler opened this issue 3 years ago • 3 comments

Hello,

Thank you for this nice project. I tried to use it for building debian/ubuntu packages in a CI/CD pipeline for ubuntu focal. Unfortunately numpy does not work out of the box.

For me it looks like wheel2deb has some problems with manylinux2010, because firstly, older versions of numpy (==1.18.5) where a manylinux1 wheel is downloaded when invoking pip3 wheel numpy==1.18.5 work. Secondly, the manylinux2010 wheel works with pip (pip install numpy).

(Only tested interactively, downloading the current manylinux1-wheel and running wheel2deb works, too.)

A small example that shows my problem can be created with the following dockerfile

# Dockerfile
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    git \
        python3-pip \
        python3-apt \
        apt-file \
        dpkg-dev \
        fakeroot \
        build-essential \
        devscripts \
        debhelper \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=

# Install the newest wheel2deb package which fixes some versioning issues.
RUN python3 -m pip install -U git+https://github.com/upciti/wheel2deb.git@master#egg=wheel2deb

COPY failing_test.sh /failing_test.sh

CMD ["/usr/bin/env", "bash", "/failing_test.sh"]

and the bash script that runs the actual failing test cases:

# failing_test.sh
#!/usr/bin/env bash

python3 -m pip wheel numpy
ls *
# numpy-1.20.1-cp38-cp38-manylinux2010_x86_64.whl
mkdir output
wheel2deb
wheel2deb build
dpkg -i output/*.deb

python3 -m pip freeze
echo ""
python3 -c "import numpy" || echo "manylinux 2010 doesn't work via wheel2deb"
echo ""

# But with pip it works
apt remove -y python3-numpy
python3 -m pip install numpy==1.20.1
echo ""
python3 -c "import numpy" && echo "manylinux 2010 works via pip"
echo ""

With these two files and docker one can run

sudo docker build -t wheel2deb-err -f Dockerfile .
sudo docker run -ti wheel2deb-err:latest

to reproduce the error.

Unfortunately, numpy is going to drop support for manylinux1 soon https://github.com/pypa/manylinux/issues/542#issuecomment-720164102 so trying to work around this problem by using the manylinux1 wheels does not work in the long run.

smartsammler avatar Mar 10 '21 16:03 smartsammler