Unverified Commit 1826f1fd authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge pull request #256 from matthew-brett/add-ml-ver

MRG: more explicit support for manylinux > 1

Add MB_ML_VER variable to choose Manylinux version.

Closes gh-238.
parents 8756d58e 54912473
...@@ -15,6 +15,12 @@ matrix: ...@@ -15,6 +15,12 @@ matrix:
dist: xenial dist: xenial
env: env:
- TEST_BUILDS=1 - TEST_BUILDS=1
# 64-bit builds, manylinux2014
- os: linux
dist: xenial
env:
- TEST_BUILDS=1
- MB_ML_VER=2010
# 32-bit builds # 32-bit builds
- os: linux - os: linux
dist: xenial dist: xenial
......
...@@ -10,8 +10,8 @@ The Travis CI scripts are designed to build *and test*: ...@@ -10,8 +10,8 @@ The Travis CI scripts are designed to build *and test*:
* Dual 32/64-bit architecture macOS wheels built for macOS 10.6+; * Dual 32/64-bit architecture macOS wheels built for macOS 10.6+;
* 64-bit macOS wheels built for macOS 10.9+; * 64-bit macOS wheels built for macOS 10.9+;
* 64-bit ``manylinux1_x86_64`` wheels, both narrow and wide Unicode builds; * 64-bit ``manylinuxX_x86_64`` wheels, both narrow and wide Unicode builds, where `X` is any valid Manylinux version, such as `1`, or `2010`.
* 32-bit ``manylinux1_i686`` wheels, both narrow and wide Unicode builds. * 32-bit ``manylinuxX_i686`` wheels, both narrow and wide Unicode builds.
You can currently build and test against Pythons 2.7, 3.5, 3.6, 3.7. You can currently build and test against Pythons 2.7, 3.5, 3.6, 3.7.
...@@ -75,12 +75,31 @@ default definitions of these functions. See below for more details. ...@@ -75,12 +75,31 @@ default definitions of these functions. See below for more details.
Manylinux Manylinux
========= =========
The build phase is in a Manylinux1 Docker container, but the test phase is in The build phase is in a Manylinux Docker container, but the test phase is in
a clean Ubuntu 14.04 container. a clean Ubuntu 14.04 container.
Build phase Build phase
----------- -----------
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:
* `1` (see [PEP 513](https://www.python.org/dev/peps/pep-0513);
* `2010` (see [PEP
571](https://www.python.org/dev/peps/pep-0571).
At some point `2014` will be a valid version - see [PEP
599](https://www.python.org/dev/peps/pep-0599).
The environment variable specified which Manylinux docker container you are building in.
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.
At the time of writing, Manylinux2010 only supports 64-bit
builds, so `MB_ML_VER=2010` and `PLAT=i686` is an invalid
combination, and will generate an error when trying to find the
matching Docker image.
``multibuild/travis_linux_steps.sh`` defines the ``build_wheel`` function, ``multibuild/travis_linux_steps.sh`` defines the ``build_wheel`` function,
which starts up the Manylinux1 Docker container to run a wrapper script which starts up the Manylinux1 Docker container to run a wrapper script
``multibuild/docker_build_wrap.sh``, that (within the container) sources the ``multibuild/docker_build_wrap.sh``, that (within the container) sources the
......
...@@ -46,3 +46,5 @@ fi ...@@ -46,3 +46,5 @@ fi
export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS" export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS"
export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH" export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH"
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH"
# Add binary path for configure utils etc
export PATH="$BUILD_PREFIX/bin:$PATH"
# Test some library builders # Test some library builders
# Smoke test
export BUILD_PREFIX="${PWD}/builds" # The environment
rm_mkdir $BUILD_PREFIX uname -a
source configure_build.sh
source library_builders.sh if [ -n "$IS_OSX" ]; then
# Building on macOS
export BUILD_PREFIX="${PWD}/builds"
rm_mkdir $BUILD_PREFIX
source configure_build.sh
source library_builders.sh
else
# Building on Linux
# Glibc version
ldd --version
# configure_build.sh, library_builders.sh sourced in
# docker_build_wrap.sh
fi
source tests/utils.sh source tests/utils.sh
start_spinner start_spinner
......
...@@ -13,6 +13,11 @@ set -e ...@@ -13,6 +13,11 @@ set -e
MANYLINUX_URL=${MANYLINUX_URL:-https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com} MANYLINUX_URL=${MANYLINUX_URL:-https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com}
# Default Manylinux version
# Warning: ignored if DOCKER_IMAGE variable is set.
# See build_multilinux function.
MB_ML_VER=${MB_ML_VER:-1}
# Get our own location on this filesystem # Get our own location on this filesystem
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}") MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
...@@ -70,6 +75,7 @@ function build_multilinux { ...@@ -70,6 +75,7 @@ function build_multilinux {
# #
# Depends on # Depends on
# MB_PYTHON_VERSION # MB_PYTHON_VERSION
# MB_ML_VER
# UNICODE_WIDTH (optional) # UNICODE_WIDTH (optional)
# BUILD_DEPENDS (optional) # BUILD_DEPENDS (optional)
# DOCKER_IMAGE (optional) # DOCKER_IMAGE (optional)
...@@ -78,7 +84,7 @@ function build_multilinux { ...@@ -78,7 +84,7 @@ function build_multilinux {
local plat=$1 local plat=$1
[ -z "$plat" ] && echo "plat not defined" && exit 1 [ -z "$plat" ] && echo "plat not defined" && exit 1
local build_cmds="$2" local build_cmds="$2"
local docker_image=${DOCKER_IMAGE:-quay.io/pypa/manylinux1_\$plat} local docker_image=${DOCKER_IMAGE:-quay.io/pypa/manylinux${MB_ML_VER}_\$plat}
docker_image=$(eval echo "$docker_image") docker_image=$(eval echo "$docker_image")
retry docker pull $docker_image retry docker pull $docker_image
docker run --rm \ docker run --rm \
...@@ -95,6 +101,7 @@ function build_multilinux { ...@@ -95,6 +101,7 @@ function build_multilinux {
-e USE_CCACHE="$USE_CCACHE" \ -e USE_CCACHE="$USE_CCACHE" \
-e REPO_DIR="$repo_dir" \ -e REPO_DIR="$repo_dir" \
-e PLAT="$PLAT" \ -e PLAT="$PLAT" \
-e MB_ML_VER="$MB_ML_VER" \
-v $PWD:/io \ -v $PWD:/io \
-v $HOME:/parent-home \ -v $HOME:/parent-home \
$docker_image /io/$MULTIBUILD_DIR/docker_build_wrap.sh $docker_image /io/$MULTIBUILD_DIR/docker_build_wrap.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment