rattler-build
rattler-build copied to clipboard
Improve our bash preamble for better error reporting and less noise
Our bash preamble currently only sources the build_script_env.sh file.
set -x is relatively noisy. We could instead install an error trap and return the line number where the script was failing. Inside the error handler we could also execute e.g. printenv to collect all the current env vars.
E.g.
error_handler() {
echo "Error on line $1"
echo "## ENVIRONMENT ##"
printenv
}
trap 'error_handler $LINENO' ERR
if [ -z ${CONDA_BUILD+x} ]; then
source ((script_path))
fi