Skip to content

Commit 8049f83

Browse files
committed
manylinux2014
1 parent 99c1938 commit 8049f83

15 files changed

+86
-779
lines changed

.travis.yml

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: c
2+
os: linux
23
sudo: required
3-
dist: trusty
44
services:
55
- docker
66

@@ -10,48 +10,25 @@ branches:
1010
except:
1111
- /^pyup-/
1212

13-
cache:
14-
directories:
15-
- $HOME/docker
16-
1713
env:
1814
global:
1915
# QUAY_USERNAME and QUAY_PASSWORD for docker image upload
2016
- secure: "lKaTzEL6UNiEfp+BWLOUILG9BMtjwEMpwt6Yag0cQGHix7qJ/ElZ0t3oFw6ZwuDmA5qceAXIdxHLUK9HGVI2MloLk8czGhjvtfJ4XhOxtEJRQ0VkDGPsKN4cfhB4ZjGo6GAPtNqStMyNiY7BZuTrZa7coDLCoUeYcOmTpi6pmd1rrkk725B9QCTuhFHbPhkuL2yu/Jk6WxkHJBKjmuZek+iQa7lRItgMrG0/319PXLvwIGGl00nLFy+Ly5Ciwzux4wuHLTySZQKu0H9FX81A7smM0FW/42kg3ckGa2qLxRw/Pi8Nm/aIk8LD0QXzI5N7HhFfidOTgDS8Mt1HgfxmTk4wUXZ/KvCCshqjimzMc/s9i9wPZX9UqqcfrpZkmwz8dzhm1bndN45ZOCy6xAYT6dzf8T4mLMDjVWSW4+DUoW4sYHRLVujjcMk7ybcwGV43VruPTJnc8XVAhT+VIMQkoPjhQmTOn8h82LRNGYtLa5RReCh9OPKVYB2Quz18FXMWgFt7A6VWudL0c7/8CusLvuo+pLcxt9pnV40rvu1YEohpEj8qR/qTSaDUBZM0J9SVf5zrZR80pZUnXkDF8nm+mcLOTley3YWipU19lCR7dzVyCAiQdVAuNPdnyem3Yk8enGkAJbfLd6eaIDs+p73D0JXh1Nx1px1movVLQH3ohIw="
2117
- secure: "w1614pomHLltkBhqWM2bOvbymFWIWKqSqqIBDvaNn9tbQScioItJoELBT7g7+cD7nyU7OvpQ1U2fk0xVkCeNvYU0xS1vP4o/VnZRpup7f7Tkiq+2rf4fjwYr3HHnJjwak1l9bsw6FkgzKaVvSdiUJHMVxiIuLd3fVozR7qjBBhTDxSlWGOpSgd+ttpgMZwU5zQjdaVQr1D7E8M0979ZnWMrNRyLiAUeHaPILS815b+ijgqR+i5nmu0/FTCGM9Ik4KIzIfWq8AdfPdbRiq8c+LrrTPfyKcIQJaHmfduYRM4LycGWwzkXFBNtLrJ7uFLG9RDVemOHuHOWIJX8qCUIV4XuESXxH3fUQr6r+yxquTJbzXxNtoaLa6tBOTQWKDrRjT4z9Mf9Im14F2V59EUDoQowHx5bjunOH5wg3ruYNKYYBFRYra5kx0CkKrqFBzyl8fTUEQLyx1HWTVUC1WTXEeD/aFKOSIxW5DxZr5W4LLlW2+Raa52ZzY28Q6AdueFQCRzoJ70/GsJRlSsBdWNOHN4gSp1cZuToLWY15y64QhAMVDpikB+V4hmkbceLiTqeWzTStNL1sa32RHr6i/9zeFZw1pMD1+eOg9x6fgODfh2sqr/zPbu2oONsHnc4D2jwsEax4o+Dv5QHLvK7jdyWUmu47a9QReoexXK60jZXs3CA="
2218

23-
# use YAML aliases and anchors to avoid duplication in stages
24-
# c.f. https://github.com/travis-ci/travis-ci/issues/8295#issuecomment-454457787
25-
manylinux-build: &manylinux-build
26-
stage: "Build manylinux images"
27-
before_install:
28-
# Load cached docker images
29-
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
30-
script:
31-
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
32-
deploy:
33-
provider: script
34-
script: docker/deploy.sh
35-
on:
36-
branch: master
37-
repo: pypa/manylinux
38-
39-
jobs:
19+
matrix:
4020
include:
41-
- stage: "Patch glibc"
42-
env:
43-
- PLATFORM="x86_64"
44-
before_install:
45-
# Load cached docker images
46-
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
47-
script:
48-
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh glibc_only
49-
before_cache:
50-
# Save tagged docker images
51-
- mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}' | grep 'centos-with-vsyscall:latest' | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
52-
- <<: *manylinux-build
53-
env:
54-
- PLATFORM="x86_64"
55-
- <<: *manylinux-build
56-
env:
57-
- PLATFORM="i686"
21+
- arch: amd64
22+
env: PLATFORM="x86_64"
23+
- arch: arm64
24+
env: PLATFORM="aarch64"
25+
26+
script:
27+
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
28+
29+
deploy:
30+
provider: script
31+
script: docker/deploy.sh
32+
on:
33+
branch: master
34+
repo: pypa/manylinux

build.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,4 @@
44
set -ex
55

66

7-
if [ $PLATFORM == x86_64 ] || [ "$1" == "glibc_only" ]; then
8-
# Output something every 10 minutes or Travis kills the job
9-
while sleep 9m; do echo -n -e " \b"; done &
10-
docker build --rm -t centos-with-vsyscall:latest --cache-from centos-with-vsyscall:latest --target centos-with-vsyscall -f docker/glibc/Dockerfile docker/glibc/
11-
# Killing background sleep loop
12-
kill %1
13-
if [ "$1" == "glibc_only" ]; then
14-
exit 0
15-
fi
16-
docker build --rm -t quay.io/pypa/manylinux2010_centos-6-no-vsyscall --cache-from quay.io/pypa/manylinux2010_centos-6-no-vsyscall:latest --cache-from centos-with-vsyscall:latest -f docker/glibc/Dockerfile docker/glibc/
17-
fi
18-
19-
docker build --rm -t quay.io/pypa/manylinux2010_$PLATFORM:$TRAVIS_COMMIT -f docker/Dockerfile-$PLATFORM docker/
7+
docker build --rm -t quay.io/pypa/manylinux2014_$PLATFORM:$TRAVIS_COMMIT -f docker/Dockerfile-$PLATFORM docker/

docker/Dockerfile-aarch64

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM arm64v8/centos:7
2+
LABEL maintainer="The ManyLinux project"
3+
4+
ENV AUDITWHEEL_ARCH aarch64
5+
ENV AUDITWHEEL_PLAT manylinux2014_$AUDITWHEEL_ARCH
6+
ENV LC_ALL C
7+
ENV LANG C
8+
ENV LANGUAGE C
9+
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-8/root
10+
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
11+
ENV LD_LIBRARY_PATH $DEVTOOLSET_ROOTPATH/usr/lib64:$DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib64/dyninst:$DEVTOOLSET_ROOTPATH/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib
12+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
13+
14+
COPY build_scripts /build_scripts
15+
RUN bash build_scripts/build.sh && rm -r build_scripts
16+
17+
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
18+
19+
CMD ["/bin/bash"]

docker/Dockerfile-i686

Lines changed: 0 additions & 27 deletions
This file was deleted.

docker/Dockerfile-x86_64

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# See docker/glibc/
2-
FROM quay.io/pypa/manylinux2010_centos-6-no-vsyscall
1+
FROM centos:7
32
LABEL maintainer="The ManyLinux project"
43

54
ENV AUDITWHEEL_ARCH x86_64
6-
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
5+
ENV AUDITWHEEL_PLAT manylinux2014_$AUDITWHEEL_ARCH
76
ENV LC_ALL en_US.UTF-8
87
ENV LANG en_US.UTF-8
98
ENV LANGUAGE en_US.UTF-8

docker/build_scripts/build.sh

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}")
1010

1111
# Dependencies for compiling Python that we want to remove from
1212
# the final image after compiling Python
13-
PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel expat-devel ncurses-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel"
13+
PYTHON_COMPILE_DEPS="zlib-devel bzip2-devel expat-devel ncurses-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel"
1414

15-
# Libraries that are allowed as part of the manylinux2010 profile
16-
# Extract from PEP: https://www.python.org/dev/peps/pep-0571/#the-manylinux2010-policy
15+
# Libraries that are allowed as part of the manylinux2014 profile
16+
# Extract from PEP: https://www.python.org/dev/peps/pep-0599/#the-manylinux2014-policy
1717
# On RPM-based systems, they are provided by these packages:
1818
# Package: Libraries
1919
# glib2: libglib-2.0.so.0, libgthread-2.0.so.0, libgobject-2.0.so.0
20-
# glibc: libresolv.so.2, libutil.so.1, libnsl.so.1, librt.so.1, libcrypt.so.1, libpthread.so.0, libdl.so.2, libm.so.6, libc.so.6
20+
# glibc: libresolv.so.2, libutil.so.1, libnsl.so.1, librt.so.1, libpthread.so.0, libdl.so.2, libm.so.6, libc.so.6
2121
# libICE: libICE.so.6
2222
# libX11: libX11.so.6
2323
# libXext: libXext.so.6
@@ -51,42 +51,26 @@ esac
5151
# Decided not to clean at this point: https://github.com/pypa/manylinux/pull/129
5252
yum -y update
5353

54-
# EPEL support (for cmake28 & yasm)
55-
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
54+
# Software collection (for devtoolset-8)
55+
yum -y install centos-release-scl
5656

57-
case $AUDITWHEEL_ARCH in
58-
x86_64)
59-
# Install devtoolset-8
60-
yum -y install centos-release-scl
61-
yum -y install \
62-
devtoolset-8-binutils \
63-
devtoolset-8-gcc \
64-
devtoolset-8-gcc-c++ \
65-
devtoolset-8-gcc-gfortran \
66-
;;
67-
i686)
68-
# Install devtoolset-7 (binutils, gcc, gcc-c++, gcc-gfortran)
69-
devtoolset7s=(
70-
"devtoolset-7-runtime-7.1-4.el6.i686.rpm"
71-
"devtoolset-7-binutils-2.28-11.el6.i686.rpm"
72-
"devtoolset-7-gcc-7.3.1-5.10.el6.i686.rpm"
73-
"devtoolset-7-libstdc++-devel-7.3.1-5.10.el6.i686.rpm"
74-
"devtoolset-7-gcc-c++-7.3.1-5.10.el6.i686.rpm"
75-
"devtoolset-7-libquadmath-devel-7.3.1-5.10.el6.i686.rpm"
76-
"devtoolset-7-gcc-gfortran-7.3.1-5.10.el6.i686.rpm"
77-
)
78-
for rpm in "${devtoolset7s[@]}"; do
79-
yum install -y "https://www.repo.cloudlinux.com/cloudlinux/6.10/sclo/devtoolset-7/i386/$rpm"
80-
done
81-
;;
82-
esac
57+
if [ "$(uname -m)" == "x86_64" ]; then
58+
# EPEL support (for yasm)
59+
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
60+
YASM=yasm
61+
elif [ "$(uname -m)" == "aarch64" ]; then
62+
yum -y erase centos-release-scl
63+
fi
8364

8465
# Development tools and libraries
8566
yum -y install \
8667
automake \
8768
bison \
8869
bzip2 \
89-
cmake28 \
70+
devtoolset-8-binutils \
71+
devtoolset-8-gcc \
72+
devtoolset-8-gcc-c++ \
73+
devtoolset-8-gcc-gfortran \
9074
diffutils \
9175
gettext \
9276
file \
@@ -96,17 +80,12 @@ yum -y install \
9680
patch \
9781
unzip \
9882
which \
99-
yasm \
83+
${YASM} \
10084
${PYTHON_COMPILE_DEPS}
10185

102-
# Install a git we link against system OpenSSL/Curl
103-
yum -y install openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel
86+
# Install git
10487
build_git $GIT_ROOT $GIT_HASH
10588
git version
106-
yum -y erase openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel
107-
108-
# Build an OpenSSL for Pythons. We'll delete this at the end.
109-
build_openssl $OPENSSL_ROOT $OPENSSL_HASH
11089

11190
# Install newest autoconf
11291
build_autoconf $AUTOCONF_ROOT $AUTOCONF_HASH
@@ -155,8 +134,6 @@ ln -s $($PY37_BIN/python -c 'import certifi; print(certifi.where())') \
155134
# Dockerfiles:
156135
export SSL_CERT_FILE=/opt/_internal/certs.pem
157136

158-
# Now we can delete our built OpenSSL headers/static libs since we've linked everything we need
159-
rm -rf /usr/local/ssl
160137

161138
# Install patchelf (latest with unreleased bug fixes)
162139
curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION.tar.gz

docker/build_scripts/build_env.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# source me
22

33
PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python
4-
CPYTHON_VERSIONS="2.7.16 3.4.10 3.5.7 3.6.9 3.7.4 3.8.0rc1"
5-
6-
# openssl version to build, with expected sha256 hash of .tar.gz
7-
# archive.
8-
OPENSSL_ROOT=openssl-1.0.2t
9-
OPENSSL_HASH=14cb464efe7ac6b54799b34456bd69558a749a4931ecfd9cf9f71d7881cac7bc
10-
OPENSSL_DOWNLOAD_URL=https://www.openssl.org/source
4+
CPYTHON_VERSIONS="3.5.7 3.6.9 3.7.4 3.8.0rc1"
115

126
PATCHELF_VERSION=0.10
137
PATCHELF_HASH=b3cb6bdedcef5607ce34a350cf0b182eb979f8f7bc31eae55a93a70a3f020d13

docker/build_scripts/build_utils.sh

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,18 @@ function pyver_dist_dir {
3131
function do_cpython_build {
3232
local py_ver=$1
3333
check_var $py_ver
34-
local ucs_setting=$2
35-
check_var $ucs_setting
3634
tar -xzf Python-$py_ver.tgz
3735
pushd Python-$py_ver
38-
if [ "$ucs_setting" = "none" ]; then
39-
unicode_flags=""
40-
dir_suffix=""
41-
else
42-
local unicode_flags="--enable-unicode=$ucs_setting"
43-
local dir_suffix="-$ucs_setting"
44-
fi
45-
local prefix="/opt/_internal/cpython-${py_ver}${dir_suffix}"
36+
local prefix="/opt/_internal/cpython-${py_ver}"
4637
mkdir -p ${prefix}/lib
47-
./configure --prefix=${prefix} --disable-shared $unicode_flags > /dev/null
48-
make -j2 > /dev/null
49-
make install > /dev/null
38+
./configure --prefix=${prefix} --disable-shared > /dev/null
39+
make -j$(nproc) > /dev/null
40+
make -j$(nproc) install > /dev/null
5041
popd
5142
rm -rf Python-$py_ver
5243
# Some python's install as bin/python3. Make them available as
5344
# bin/python.
54-
if [ -e ${prefix}/bin/python3 ]; then
45+
if [ -e ${prefix}/bin/python3 ] && [ ! -e ${prefix}/bin/python ]; then
5546
ln -s python3 ${prefix}/bin/python
5647
fi
5748
${prefix}/bin/python get-pip.py
@@ -74,12 +65,7 @@ function build_cpython {
7465
curl -fsSLO $PYTHON_DOWNLOAD_URL/$py_dist_dir/Python-$py_ver.tgz
7566
curl -fsSLO $PYTHON_DOWNLOAD_URL/$py_dist_dir/Python-$py_ver.tgz.asc
7667
gpg --verify Python-$py_ver.tgz.asc
77-
if [ $(lex_pyver $py_ver) -lt $(lex_pyver 3.3) ]; then
78-
do_cpython_build $py_ver ucs2
79-
do_cpython_build $py_ver ucs4
80-
else
81-
do_cpython_build $py_ver none
82-
fi
68+
do_cpython_build $py_ver
8369
rm -f Python-$py_ver.tgz
8470
rm -f Python-$py_ver.tgz.asc
8571
}
@@ -102,13 +88,6 @@ function build_cpythons {
10288
}
10389

10490

105-
function do_openssl_build {
106-
./config no-ssl2 no-shared -fPIC --prefix=/usr/local/ssl > /dev/null
107-
make > /dev/null
108-
make install_sw > /dev/null
109-
}
110-
111-
11291
function fetch_source {
11392
# This is called both inside and outside the build context (e.g. in Travis) to prefetch
11493
# source tarballs, where curl exists (and works)
@@ -136,19 +115,6 @@ function check_sha256sum {
136115
}
137116

138117

139-
function build_openssl {
140-
local openssl_fname=$1
141-
check_var ${openssl_fname}
142-
local openssl_sha256=$2
143-
check_var ${openssl_sha256}
144-
fetch_source ${openssl_fname}.tar.gz ${OPENSSL_DOWNLOAD_URL}
145-
check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256}
146-
tar -xzf ${openssl_fname}.tar.gz
147-
(cd ${openssl_fname} && do_openssl_build)
148-
rm -rf ${openssl_fname} ${openssl_fname}.tar.gz
149-
}
150-
151-
152118
function build_git {
153119
local git_fname=$1
154120
check_var ${git_fname}
@@ -158,15 +124,15 @@ function build_git {
158124
fetch_source v${git_fname}.tar.gz ${GIT_DOWNLOAD_URL}
159125
check_sha256sum v${git_fname}.tar.gz ${git_sha256}
160126
tar -xzf v${git_fname}.tar.gz
161-
(cd git-${git_fname} && make install prefix=/usr/local NO_GETTEXT=1 NO_TCLTK=1 > /dev/null)
127+
(cd git-${git_fname} && make -j$(nproc) install prefix=/usr/local NO_GETTEXT=1 NO_TCLTK=1 > /dev/null)
162128
rm -rf git-${git_fname} v${git_fname}.tar.gz
163129
}
164130

165131

166132
function do_standard_install {
167133
./configure "$@" > /dev/null
168-
make > /dev/null
169-
make install > /dev/null
134+
make -j$(nproc) > /dev/null
135+
make -j$(nproc) install > /dev/null
170136
}
171137

172138

0 commit comments

Comments
 (0)