Skip to content

Commit

Permalink
Set $PY to disambiguate which Py2.7 version to use
Browse files Browse the repository at this point in the history
Interpreter constraints don't work, as previously noted.
  • Loading branch information
Eric-Arellano committed Feb 26, 2019
1 parent 8dd215d commit 2166efe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
- PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" PYENV_ROOT="${HOME}/.pyenv" PATH="${PYENV_ROOT}/shims:${PATH}"

- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
# We set $PY to ensure the UCS4 interpreter is used when bootstrapping the PEX.
- PY=${PYENV_ROOT}/shims/python2.7
before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64 -o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
Expand Down
6 changes: 4 additions & 2 deletions build-support/docker/travis_ci_py27_ucs2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ 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. This allows us to disambiguate which Python 2
# interpreter to use when `ci.sh` sets the interpreter constraints for Pants and PEX.
# interpreter to use when `ci.sh` sets the interpreter constraints for Pants and PEX. We
# set $PY to the exact Python 2.7 version we want to ensure the PEX is bootstrapped
# with UCS 2.
ARG PYTHON_2_VERSION=2.7.15
RUN yum install sqlite-devel -y
ENV PYENV_ROOT /pyenv-docker-build
Expand All @@ -19,7 +21,7 @@ ENV PYTHON_CONFIGURE_OPTS --enable-unicode=ucs2
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 PY "${PYENV_ROOT}/shims/python2.7"

# Setup mount points for the travis ci user & workdir.
VOLUME /travis/home
Expand Down
2 changes: 2 additions & 0 deletions build-support/travis/travis.yml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
- CACHE_NAME=osxwheelsbuild.ucs4
- {{>env_osx_with_pyenv}}
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
# We set $PY to ensure the UCS4 interpreter is used when bootstrapping the PEX.
- PY=${PYENV_ROOT}/shims/python2.7
before_install:
{{>before_install_osx}}
- git clone https://github.com/pyenv/pyenv ${PYENV_ROOT}
Expand Down

0 comments on commit 2166efe

Please sign in to comment.