Commit de388143 authored by native-api's avatar native-api Committed by xoviat
Browse files

Add config.pre to override envvars used in `library_builders.sh` (#117)

* Add config.pre to override envvars used in `library_builders.sh`
Fixes part 2 of https://github.com/matthew-brett/multibuild/issues/116

* rename config_pre.sh to env_vars.sh as suggested
parent 9330c3dc
......@@ -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
......@@ -320,6 +321,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).
......
......@@ -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
......
......@@ -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" \
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment