From f810849d58c1cd0fbdb9af10f8bb4c6c8c27ce65 Mon Sep 17 00:00:00 2001 From: Eric Arellano Date: Tue, 26 Feb 2019 08:43:42 -0700 Subject: [PATCH] Move interpreter constraints to Docker env entry Docker does not pull in external env vars. Instead, we must specify this in the Dockerfile. This change has added benefit that it moves all of the Py2 logic into the Dockerfile out of .travis.yml, and leaves .travis.yml solely to call the Dockerfile. --- .travis.yml | 3 --- build-support/docker/travis_ci_py27_ucs2/Dockerfile | 3 ++- build-support/travis/travis.yml.mustache | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25fd9acaefa..5743e286139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -400,9 +400,6 @@ py27_linux_build_wheels_ucs2: &py27_linux_build_wheels_ucs2 name: "Build wheels - Linux and cp27m (UCS2)" env: - *base_build_wheels_env - # While we install 2.7.15 with UCS2, the Centos6 image already has 2.7.13 (UCS4). To disambiguate - # what `python2` resolves to and ensure we always use UCS2, we require exactly 2.7.15. - - PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==2.7.15']" - CACHE_NAME=linuxwheelsbuild.ucs2 script: - docker build --rm -t travis_ci_py27_ucs2 diff --git a/build-support/docker/travis_ci_py27_ucs2/Dockerfile b/build-support/docker/travis_ci_py27_ucs2/Dockerfile index 7500311345f..1dd7edece79 100644 --- a/build-support/docker/travis_ci_py27_ucs2/Dockerfile +++ b/build-support/docker/travis_ci_py27_ucs2/Dockerfile @@ -9,7 +9,7 @@ FROM pantsbuild/centos6:latest # Note we use 2.7.15, rather than 2.7.13, as the centos6 image already comes with 2.7.13 # installed, which uses UCS4 instead of UCS2. We pair this change with setting -# PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS to exactly 2.7.15 in `.travis.yml` to disambiguate +# PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS to exactly 2.7.15 to disambiguate # the two and always choose the UCS2 interpeter. ARG PYTHON_2_VERSION=2.7.15 RUN yum install sqlite-devel -y @@ -21,6 +21,7 @@ RUN /usr/bin/scl enable devtoolset-7 -- bash -c '\ ${PYENV_ROOT}/bin/pyenv install ${PYTHON_2_VERSION} \ && ${PYENV_ROOT}/bin/pyenv global ${PYTHON_2_VERSION}' ENV PATH "${PYENV_ROOT}/shims:${PATH}" +ENV PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS "['CPython==${PYTHON_2_VERSION}']" # Setup mount points for the travis ci user & workdir. VOLUME /travis/home diff --git a/build-support/travis/travis.yml.mustache b/build-support/travis/travis.yml.mustache index 23aad330b78..4e130b3ba98 100644 --- a/build-support/travis/travis.yml.mustache +++ b/build-support/travis/travis.yml.mustache @@ -379,9 +379,6 @@ py27_linux_build_wheels_ucs2: &py27_linux_build_wheels_ucs2 name: "Build wheels - Linux and cp27m (UCS2)" env: - *base_build_wheels_env - # While we install 2.7.15 with UCS2, the Centos6 image already has 2.7.13 (UCS4). To disambiguate - # what `python2` resolves to and ensure we always use UCS2, we require exactly 2.7.15. - - PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==2.7.15']" - CACHE_NAME=linuxwheelsbuild.ucs2 script: - docker build --rm -t travis_ci_py27_ucs2