diff --git a/README.rst b/README.rst index 837cf9d7..47b9689d 100644 --- a/README.rst +++ b/README.rst @@ -49,8 +49,8 @@ functions and variables in earlier scripts: * multibuild/common_utils.sh * multibuild/osx_utils.sh +* env_vars.sh * multibuild/library_builders.sh -* multibuild/travis_osx_steps.sh * config.sh See ``travis_osx_steps.sh`` to review source order. @@ -79,6 +79,7 @@ following bash scripts: * multibuild/common_utils.sh * multibuild/manylinux_utils.sh +* env_vars.sh * multibuild/library_builders.sh * config.sh @@ -319,6 +320,14 @@ To use these scripts Optionally you can specify a different location for ``config.sh`` file with the ``$CONFIG_PATH`` environment variable. + +* Optionally, create an ``env_vars.sh`` file to set defaults for any build + environment variables used in ``library_builders.sh``. In Linux, they cannot + be just set in the global environment because the build runs in Docker, so + only the variables explicitly passed to ``docker run`` are propagated. + + Likewise, you can specify a different location for the file by setting the + the ``$ENV_VARS_PATH`` environment variable. * Make sure your project is set up to build on travis-ci, and you should now be ready (to begin the long slow debugging process, probably). @@ -330,8 +339,9 @@ To use these scripts - https://github.com/MacPython/nipy-wheels/blob/master/appveyor.yml - https://github.com/MacPython/pytables-wheels/blob/master/appveyor.yml - Note the Windows test customisations etc are inside ``appveyor.yml``, - and that ``config.sh`` is only for the Linux/Mac builds on TravisCI. + Note the Windows test customizations etc are inside ``appveyor.yml``, + and that ``config.sh`` and ``env_vars.sh`` are only for the + Linux/Mac builds on TravisCI. * Make sure your project is set up to build on appveyor, and you should now be ready (for what could be another round of slow debugging). diff --git a/docker_build_wrap.sh b/docker_build_wrap.sh index 8abf07f5..38eeaccd 100755 --- a/docker_build_wrap.sh +++ b/docker_build_wrap.sh @@ -17,10 +17,13 @@ WHEEL_SDIR=${WHEEL_SDIR:-wheelhouse} # Location of `config.sh` file, default "./config.sh" CONFIG_PATH=${CONFIG_PATH:-config.sh} +ENV_VARS_PATH=${ENV_VARS_PATH:-env_vars.sh} + # Always pull in common and library builder utils MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}") # These routines also source common_utils.sh source $MULTIBUILD_DIR/manylinux_utils.sh +if [ -r "$ENV_VARS_PATH" ]; then source "$ENV_VARS_PATH"; fi source $MULTIBUILD_DIR/library_builders.sh if [ "$USE_CCACHE" == "1" ]; then diff --git a/travis_linux_steps.sh b/travis_linux_steps.sh index 8df5613d..96f48118 100644 --- a/travis_linux_steps.sh +++ b/travis_linux_steps.sh @@ -87,6 +87,7 @@ function build_multilinux { -e UNICODE_WIDTH="$UNICODE_WIDTH" \ -e BUILD_COMMIT="$BUILD_COMMIT" \ -e CONFIG_PATH="$CONFIG_PATH" \ + -e ENV_VARS_PATH="$ENV_VARS_PATH" \ -e WHEEL_SDIR="$WHEEL_SDIR" \ -e MANYLINUX_URL="$MANYLINUX_URL" \ -e BUILD_DEPENDS="$BUILD_DEPENDS" \ diff --git a/travis_osx_steps.sh b/travis_osx_steps.sh index f27d2fa3..a67adfc4 100644 --- a/travis_osx_steps.sh +++ b/travis_osx_steps.sh @@ -5,8 +5,12 @@ set -e # Get needed utilities MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}") MB_PYTHON_VERSION=${MB_PYTHON_VERSION:-$TRAVIS_PYTHON_VERSION} + +ENV_VARS_PATH=${ENV_VARS_PATH:-env_vars.sh} + # These load common_utils.sh source $MULTIBUILD_DIR/osx_utils.sh +if [ -r "$ENV_VARS_PATH" ]; then source "$ENV_VARS_PATH"; fi source $MULTIBUILD_DIR/library_builders.sh # NB - config.sh sourced at end of this function.