puppet-python
puppet-python copied to clipboard
PIP installing with /tmp mounted noexec
trafficstars
I have found that certain PIP packages won't mount if the /tmp directory is mounted with the noexec mount option.
Example:
1485888563,,ui,message, default: Error: /Stage[main]/Role::Packer::Orchestration/Python::Pip[ansible]/Exec[pip_install_ansible]/returns: change from notrun to 0 failed: pip wheel --help > /dev/null 2>&1 && { pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { pip --log /tmp/pip.log install $wheel_support_flag ansible==1.9.4 || pip --log /tmp/pip.log install ansible==1.9.4 ;} returned 1 instead of one of [0]
...
/Stage[main]/Role::Packer::Orchestration/Python::Pip[ansible]/Exec[pip_install_ansible]/returns: Command "/usr/bin/python -u -c "import setuptools%!(PACKER_COMMA) tokenize;__file__='/tmp/pip-build-KGpbhZ/pycrypto/setup.py';f=getattr(tokenize%!(PACKER_COMMA) 'open'%!(PACKER_COMMA) open)(__file__);code=f.read().replace('\r\n'%!(PACKER_COMMA) '\n');f.close();exec(compile(code%!(PACKER_COMMA) __file__%!(PACKER_COMMA) 'exec'))" install --record /tmp/pip-ENqJTX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-KGpbhZ/pycrypto/
It looks like we could make this work by adding a feature to access pip install --build see doco.
Ok, I realised this can be achieved with
# [*install_args*]
# String. Any additional installation arguments that will be supplied
# when running pip install.
#
Actually, I realise that people might be using $install_args for other purposes - e.g. passing in --upgrade to wheel. If so, it becomes pretty difficult to globally set $install_args to --build /my/builddir. Maybe it would be useful to support an explicitly build dir feature after all?