tools(docker): Fix python package

* Update build_manylinux1.sh
* Force auditwheel to 2.0.0
  note: last version 3.1.0 reset rpath to a broken one...
This commit is contained in:
Mizux Seiha
2020-04-20 23:11:16 +02:00
parent 83fad1d4f0
commit 5cd01fff84
3 changed files with 29 additions and 16 deletions

View File

@@ -121,6 +121,7 @@ docker_python: manylinux1.Dockerfile export/python/build-manylinux1.sh ../../mak
--tag $(IMAGE):python \
--build-arg SRC_GIT_BRANCH=$(OR_TOOLS_BRANCH) \
--build-arg SRC_GIT_SHA1=$(OR_TOOLS_SHA1) \
--target=build \
-f $< \
export/python

View File

@@ -61,11 +61,19 @@ function export_manylinux_wheel {
make clean_python
make python
#make test_python
make pypi_archive
make package_python
#make test_package_python
# Build and repair wheels
cd temp_python*/ortools/dist
auditwheel repair --plat manylinux2010_x86_64 ./*.whl -w "$export_root"
}
for FILE in *.whl; do
# if no files found do nothing
[[ -e "$FILE" ]] || continue
cp "$FILE" "${export_root}/${FILE%.whl}"_unfixed.whl
auditwheel show "$FILE"
/opt/_internal/cpython-3.7.7/bin/python -m auditwheel -v repair --plat manylinux2010_x86_64 "$FILE" -w "$export_root"
#auditwheel -v repair --plat manylinux2010_x86_64 "$FILE" -w "$export_root"
done
}
function test_installed {
# Run all the specified test scripts using the current environment.
@@ -137,6 +145,9 @@ TESTS=(
# cf pypa/auditwheel#102
#/opt/_internal/cpython-3.6.6/bin/python -m pip install wheel==0.31.1
# Downgrade auditwheel
/opt/_internal/cpython-3.7.7/bin/pip install auditwheel==2.0.0
mkdir -p "${BUILD_ROOT}"
mkdir -p "${EXPORT_ROOT}"

View File

@@ -1,4 +1,4 @@
FROM quay.io/pypa/manylinux2010_x86_64:latest
FROM quay.io/pypa/manylinux2010_x86_64:latest AS env
RUN yum -y update \
&& yum -y install \
@@ -39,16 +39,22 @@ RUN curl --location-trusted \
&& cd .. \
&& rm -rf swig-4.0.1
# Update auditwheel to support manylinux2010
#RUN /opt/_internal/cpython-3.7.6/bin/pip install auditwheel==2.0.0
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV BUILD_ROOT /root/build
ENV EXPORT_ROOT /export
# The build of Python 2.6.x bindings is known to be broken.
# Python3.4 include conflict with abseil-cpp dynamic_annotation.h
ENV SKIP_PLATFORMS "cp27-cp27m cp27-cp27mu cp34-cp34m"
COPY build-manylinux1.sh "$BUILD_ROOT/"
RUN chmod a+x "${BUILD_ROOT}/build-manylinux1.sh"
################
## OR-TOOLS ##
################
ENV BUILD_ROOT /root/build
FROM env AS devel
ENV SRC_GIT_URL https://github.com/google/or-tools
ENV SRC_ROOT /root/src
WORKDIR "$BUILD_ROOT"
@@ -59,14 +65,9 @@ ARG SRC_GIT_SHA1
ENV SRC_GIT_SHA1 ${SRC_GIT_SHA1:-unknown}
RUN git clone -b "$SRC_GIT_BRANCH" --single-branch "$SRC_GIT_URL" "$SRC_ROOT"
FROM devel AS third_party
WORKDIR "$SRC_ROOT"
RUN make third_party
FROM third_party as build
RUN make cc
ENV EXPORT_ROOT /export
# The build of Python 2.6.x bindings is known to be broken.
# Python3.4 include conflict with abseil-cpp dynamic_annotation.h
ENV SKIP_PLATFORMS "cp27-cp27m cp27-cp27mu cp34-cp34m"
COPY build-manylinux1.sh "$BUILD_ROOT"
RUN chmod ugo+x "${BUILD_ROOT}/build-manylinux1.sh"