forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We must now build pantsbuild.pants with both unicode versions for Py2. So, we introduce Py2 to do this. We use Pyenv to install interpreter with the relevant encoding where necessary. See https://stackoverflow.com/questions/38928942/build-python-as-ucs-4-via-pyenv.
- Loading branch information
1 parent
a02dde1
commit 1e83f37
Showing
3 changed files
with
159 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
# Use our custom Centos6 image for binary compatibility with old linux distros. | ||
FROM pantsbuild/centos6:latest | ||
|
||
ARG PYTHON_2_VERSION=2.7.13 | ||
RUN yum install sqlite-devel -y | ||
ENV PYENV_ROOT /pyenv-docker-build | ||
RUN mkdir ${PYENV_ROOT} | ||
RUN git clone https://github.com/pyenv/pyenv ${PYENV_ROOT} | ||
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}" | ||
|
||
# Setup mount points for the travis ci user & workdir. | ||
VOLUME /travis/home | ||
VOLUME /travis/workdir | ||
|
||
# Setup a non-root user to execute the build under (avoids problems with npm install). | ||
ARG TRAVIS_USER=travis_ci | ||
ARG TRAVIS_UID=1000 | ||
ARG TRAVIS_GROUP=root | ||
ARG TRAVIS_GID=0 | ||
|
||
RUN groupadd --gid ${TRAVIS_GID} ${TRAVIS_GROUP} || true | ||
RUN useradd -d /travis/home -g ${TRAVIS_GROUP} --uid ${TRAVIS_UID} ${TRAVIS_USER} | ||
USER ${TRAVIS_USER}:${TRAVIS_GROUP} | ||
|
||
# Our newly created user is unlikely to have a sane environment: set a locale at least. | ||
ENV LC_ALL="en_US.UTF-8" | ||
|
||
WORKDIR /travis/workdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters