I found a fix that doesn’t depend on the image:
machine:
pre:
- test $(pyenv install --list | grep 2.7.12) || (cd /home/ubuntu/.pyenv/plugins/python-build/../.. && git pull && cd -)
- pyenv local 2.7.12 || (PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.12 -v)
- pyenv local 2.7.12
- pip install virtualenv
python:
version:
2.7.12
The first ‘pre’ line updates pyenv (if needed) so that 2.7.12 is available.
The second line installs Python 2.7.12 (if not installed already) in the system, with the ‘–enable_shared’ flag that’s missing in all the pre-installed available pyenv versions.
The third chooses Python 2.7.12 as the currently active python.
The fourth installs virtualenv for our Python 2.7.12, so that the automatic ‘machine: virtualenv’ step can run.
Shiboken builds successfully on Precise this way, but it does involve re-building Python each time, which takes ~2:13 minutes.
Then I tried to bypass building Python over and over by using the share-enabled executable that is cached in the project’s virtualenv at the end of the build, but I couldn’t get it to work.