Skip to content

Commit 1826f1f

Browse files
Merge pull request multi-build#256 from matthew-brett/add-ml-ver
MRG: more explicit support for manylinux > 1 Add MB_ML_VER variable to choose Manylinux version. Closes multi-buildgh-238.
2 parents 8756d58 + 5491247 commit 1826f1f

File tree

5 files changed

+58
-11
lines changed

5 files changed

+58
-11
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ matrix:
1515
dist: xenial
1616
env:
1717
- TEST_BUILDS=1
18+
# 64-bit builds, manylinux2014
19+
- os: linux
20+
dist: xenial
21+
env:
22+
- TEST_BUILDS=1
23+
- MB_ML_VER=2010
1824
# 32-bit builds
1925
- os: linux
2026
dist: xenial

README.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The Travis CI scripts are designed to build *and test*:
1010

1111
* Dual 32/64-bit architecture macOS wheels built for macOS 10.6+;
1212
* 64-bit macOS wheels built for macOS 10.9+;
13-
* 64-bit ``manylinux1_x86_64`` wheels, both narrow and wide Unicode builds;
14-
* 32-bit ``manylinux1_i686`` wheels, both narrow and wide Unicode builds.
13+
* 64-bit ``manylinuxX_x86_64`` wheels, both narrow and wide Unicode builds, where `X` is any valid Manylinux version, such as `1`, or `2010`.
14+
* 32-bit ``manylinuxX_i686`` wheels, both narrow and wide Unicode builds.
1515

1616
You can currently build and test against Pythons 2.7, 3.5, 3.6, 3.7.
1717

@@ -75,12 +75,31 @@ default definitions of these functions. See below for more details.
7575
Manylinux
7676
=========
7777

78-
The build phase is in a Manylinux1 Docker container, but the test phase is in
78+
The build phase is in a Manylinux Docker container, but the test phase is in
7979
a clean Ubuntu 14.04 container.
8080

81+
8182
Build phase
8283
-----------
8384

85+
Specify the Manylinux version to build for with the `MB_ML_VER` environment variable. The default version is `1`. Versions that are currently valid are:
86+
87+
* `1` (see [PEP 513](https://www.python.org/dev/peps/pep-0513);
88+
* `2010` (see [PEP
89+
571](https://www.python.org/dev/peps/pep-0571).
90+
91+
At some point `2014` will be a valid version - see [PEP
92+
599](https://www.python.org/dev/peps/pep-0599).
93+
94+
The environment variable specified which Manylinux docker container you are building in.
95+
96+
The `PLAT` environment variable can be one of `x86_64` or `i686`, specifying 64-bit and 32-bit builds, respectively. The default is 64-bit.
97+
98+
At the time of writing, Manylinux2010 only supports 64-bit
99+
builds, so `MB_ML_VER=2010` and `PLAT=i686` is an invalid
100+
combination, and will generate an error when trying to find the
101+
matching Docker image.
102+
84103
``multibuild/travis_linux_steps.sh`` defines the ``build_wheel`` function,
85104
which starts up the Manylinux1 Docker container to run a wrapper script
86105
``multibuild/docker_build_wrap.sh``, that (within the container) sources the

configure_build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ fi
4646
export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS"
4747
export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH"
4848
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH"
49+
# Add binary path for configure utils etc
50+
export PATH="$BUILD_PREFIX/bin:$PATH"

tests/test_library_builders.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
# Test some library builders
2-
# Smoke test
3-
export BUILD_PREFIX="${PWD}/builds"
4-
rm_mkdir $BUILD_PREFIX
5-
source configure_build.sh
6-
source library_builders.sh
2+
3+
# The environment
4+
uname -a
5+
6+
if [ -n "$IS_OSX" ]; then
7+
# Building on macOS
8+
export BUILD_PREFIX="${PWD}/builds"
9+
rm_mkdir $BUILD_PREFIX
10+
source configure_build.sh
11+
source library_builders.sh
12+
else
13+
# Building on Linux
14+
# Glibc version
15+
ldd --version
16+
# configure_build.sh, library_builders.sh sourced in
17+
# docker_build_wrap.sh
18+
fi
19+
720
source tests/utils.sh
821

922
start_spinner
@@ -46,4 +59,4 @@ suppress build_new_zlib
4659
stop_spinner
4760

4861
# Exit 1 if any test errors
49-
barf
62+
barf

travis_linux_steps.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ set -e
1313

1414
MANYLINUX_URL=${MANYLINUX_URL:-https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com}
1515

16+
# Default Manylinux version
17+
# Warning: ignored if DOCKER_IMAGE variable is set.
18+
# See build_multilinux function.
19+
MB_ML_VER=${MB_ML_VER:-1}
20+
1621
# Get our own location on this filesystem
1722
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
1823

@@ -70,15 +75,16 @@ function build_multilinux {
7075
#
7176
# Depends on
7277
# MB_PYTHON_VERSION
78+
# MB_ML_VER
7379
# UNICODE_WIDTH (optional)
7480
# BUILD_DEPENDS (optional)
75-
# DOCKER_IMAGE (optional)
81+
# DOCKER_IMAGE (optional)
7682
# MANYLINUX_URL (optional)
7783
# WHEEL_SDIR (optional)
7884
local plat=$1
7985
[ -z "$plat" ] && echo "plat not defined" && exit 1
8086
local build_cmds="$2"
81-
local docker_image=${DOCKER_IMAGE:-quay.io/pypa/manylinux1_\$plat}
87+
local docker_image=${DOCKER_IMAGE:-quay.io/pypa/manylinux${MB_ML_VER}_\$plat}
8288
docker_image=$(eval echo "$docker_image")
8389
retry docker pull $docker_image
8490
docker run --rm \
@@ -95,6 +101,7 @@ function build_multilinux {
95101
-e USE_CCACHE="$USE_CCACHE" \
96102
-e REPO_DIR="$repo_dir" \
97103
-e PLAT="$PLAT" \
104+
-e MB_ML_VER="$MB_ML_VER" \
98105
-v $PWD:/io \
99106
-v $HOME:/parent-home \
100107
$docker_image /io/$MULTIBUILD_DIR/docker_build_wrap.sh

0 commit comments

Comments
 (0)