Skip to content
Snippets Groups Projects
Commit 2a82ac5b authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Set LD_LIBRARY_PATH globally, remove run_cmd_ld to simplify

parent 7aad8e9d
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ check_env WHEELS_SERVER ...@@ -11,7 +11,7 @@ check_env WHEELS_SERVER
# Readies the virtualenv to use for installation # Readies the virtualenv to use for installation
if [ ! -d ${PREFIX} ]; then if [ ! -d ${PREFIX} ]; then
log_info "Creating virtualenv installation at ${PREFIX}..." log_info "Creating virtualenv installation at ${PREFIX}..."
run_cmd_ld ${BOB_PREFIX_PATH}/bin/virtualenv --system-site-packages ${PREFIX} run_cmd ${BOB_PREFIX_PATH}/bin/virtualenv --system-site-packages ${PREFIX}
else else
log_warn "Prefix directory ${PREFIX} exists, not re-installing..." log_warn "Prefix directory ${PREFIX} exists, not re-installing..."
fi fi
...@@ -41,21 +41,21 @@ fi ...@@ -41,21 +41,21 @@ fi
PIPOPTS="--find-links ${WHEELS_REPOSITORY} --trusted-host ${WHEELS_SERVER}" PIPOPTS="--find-links ${WHEELS_REPOSITORY} --trusted-host ${WHEELS_SERVER}"
PIPOPTS="${PIPOPTS} --pre --use-wheel --no-index" PIPOPTS="${PIPOPTS} --pre --use-wheel --no-index"
if [ -e requirements.txt ]; then if [ -e requirements.txt ]; then
run_cmd_ld ${use_pip} install ${PIPOPTS} --requirement requirements.txt run_cmd ${use_pip} install ${PIPOPTS} --requirement requirements.txt
else else
log_info "No requirements.txt file found, skipping 'pip install <build-deps>'..." log_info "No requirements.txt file found, skipping 'pip install <build-deps>'..."
fi fi
# Install this package's test dependencies # Install this package's test dependencies
if [ -e test-requirements.txt ]; then if [ -e test-requirements.txt ]; then
run_cmd_ld ${use_pip} install ${PIPOPTS} --requirement test-requirements.txt run_cmd ${use_pip} install ${PIPOPTS} --requirement test-requirements.txt
else else
log_info "No test-requirements.txt file found, skipping 'pip install <test-deps>'..." log_info "No test-requirements.txt file found, skipping 'pip install <test-deps>'..."
fi fi
# Finally, bootstrap the installation from the new environment # Finally, bootstrap the installation from the new environment
if [ -e bootstrap-buildout.py ]; then if [ -e bootstrap-buildout.py ]; then
run_cmd_ld ${use_python} bootstrap-buildout.py run_cmd ${use_python} bootstrap-buildout.py
else else
log_error "No bootstrap-buildout.py file found, stopping..." log_error "No bootstrap-buildout.py file found, stopping..."
exit 1 exit 1
......
...@@ -20,7 +20,7 @@ fi ...@@ -20,7 +20,7 @@ fi
# zc.recipe.egg needs some special installation instructions # zc.recipe.egg needs some special installation instructions
if [ "${CI_PROJECT_NAME}" == "bob.buildout" ]; then if [ "${CI_PROJECT_NAME}" == "bob.buildout" ]; then
run_cmd_ld ${use_pip} install --upgrade --no-binary ":all:" zc.recipe.egg run_cmd ${use_pip} install --upgrade --no-binary ":all:" zc.recipe.egg
fi fi
run_cmd_ld ${use_pip} install --upgrade --use-wheel --no-index --pre dist/*.whl run_cmd ${use_pip} install --upgrade --use-wheel --no-index --pre dist/*.whl
...@@ -3,20 +3,20 @@ ...@@ -3,20 +3,20 @@
source $(dirname ${0})/functions.sh source $(dirname ${0})/functions.sh
run_cmd_ld ./bin/buildout run_cmd ./bin/buildout
if [ -x ./bin/bob_dbmanage.py ]; then if [ -x ./bin/bob_dbmanage.py ]; then
run_cmd_ld ./bin/bob_dbmanage.py all download --force; run_cmd ./bin/bob_dbmanage.py all download --force;
fi fi
if [ -d ./doc ]; then if [ -d ./doc ]; then
run_cmd_ld ./bin/sphinx-build doc sphinx run_cmd ./bin/sphinx-build doc sphinx
fi fi
if [ -z "${WHEEL_TAG}" ]; then if [ -z "${WHEEL_TAG}" ]; then
# C/C++ extensions # C/C++ extensions
run_cmd_ld ./bin/python setup.py bdist_wheel run_cmd ./bin/python setup.py bdist_wheel
else else
# Python-only packages # Python-only packages
run_cmd_ld ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG} run_cmd ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG}
fi fi
...@@ -71,21 +71,9 @@ run_cmd() { ...@@ -71,21 +71,9 @@ run_cmd() {
} }
# Function for running command and echoing results, with LD_LIBRARY_PATH set
run_cmd_ld() {
log_info "$ ${@}"
LD_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib ${@}
local status=$?
if [ ${status} != 0 ]; then
log_error "Command Failed \"${@}\""
exit ${status}
fi
}
# Runs setup.py # Runs setup.py
setup() { setup() {
run_cmd_ld ${PREFIX}/bin/python setup.py ${@} run_cmd ${PREFIX}/bin/python setup.py ${@}
} }
...@@ -116,26 +104,6 @@ EOT ...@@ -116,26 +104,6 @@ EOT
} }
# Fixes the python prompt by setting LD_LIBRARY_PATH permanently
fix_venv() {
local py=${PREFIX}/bin/python
case ${PYVER} in
py3*) py=${py}3 ;;
esac
log_info "Hot-fixing virtualenv provided by ${py}..."
mv ${py} ${py}.orig
cat <<EOT >> ${py}
#!/usr/bin/env bash
LD_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib exec ${py}.orig "\${@}"
EOT
run_cmd chmod 755 ${py}
}
# Uploads a file to our intranet location via curl # Uploads a file to our intranet location via curl
doc_upload() { doc_upload() {
log_info "curl: ${1} -> ${DOCSERVER}/${2}..." log_info "curl: ${1} -> ${DOCSERVER}/${2}..."
...@@ -201,6 +169,7 @@ fi ...@@ -201,6 +169,7 @@ fi
PYVER=py$(echo ${PYTHON_VERSION} | tr -d '.') PYVER=py$(echo ${PYTHON_VERSION} | tr -d '.')
BOB_DOCUMENTATION_SERVER="${DOCSERVER}/software/bob/docs/latest/bob/%s/master/" BOB_DOCUMENTATION_SERVER="${DOCSERVER}/software/bob/docs/latest/bob/%s/master/"
BOB_PREFIX_PATH=${CONDA_FOLDER}/envs/bob-devel-${PYVER} BOB_PREFIX_PATH=${CONDA_FOLDER}/envs/bob-devel-${PYVER}
LD_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib
if [ -z "${PYPISERVER}" ]; then if [ -z "${PYPISERVER}" ]; then
PYPISERVER="https://pypi.python.org/pypi" PYPISERVER="https://pypi.python.org/pypi"
...@@ -218,5 +187,6 @@ check_env PYPISERVER ...@@ -218,5 +187,6 @@ check_env PYPISERVER
check_env TESTSERVER check_env TESTSERVER
check_env CONDA_FOLDER check_env CONDA_FOLDER
check_env CONDA_PREFIX check_env CONDA_PREFIX
export_env LD_LIBRARY_PATH
export_env BOB_PREFIX_PATH export_env BOB_PREFIX_PATH
export_env BOB_DOCUMENTATION_SERVER export_env BOB_DOCUMENTATION_SERVER
...@@ -6,8 +6,8 @@ source $(dirname ${0})/functions.sh ...@@ -6,8 +6,8 @@ source $(dirname ${0})/functions.sh
run_cmd cd ${PREFIX} run_cmd cd ${PREFIX}
# The tests: # The tests:
run_cmd_ld ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=${CI_PROJECT_NAME} ${BOB_PREFIX_PATH}/bin/nosetests -sv ${CI_PROJECT_NAME} run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=${CI_PROJECT_NAME} ${BOB_PREFIX_PATH}/bin/nosetests -sv ${CI_PROJECT_NAME}
run_cmd_ld ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report
run_cmd_ld ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/sphinx-build -b doctest ${CI_PROJECT_DIR}/doc ${CI_PROJECT_NAME}/sphinx run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/sphinx-build -b doctest ${CI_PROJECT_DIR}/doc ${CI_PROJECT_NAME}/sphinx
run_cmd cd ${CI_PROJECT_DIR} run_cmd cd ${CI_PROJECT_DIR}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment