Skip to content

Commit

Permalink
Add config.pre to override envvars used in library_builders.sh (#117)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
native-api authored and xoviat committed Jan 30, 2018
1 parent 594c32b commit a2193fa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -79,6 +79,7 @@ following bash scripts:

* multibuild/common_utils.sh
* multibuild/manylinux_utils.sh
* env_vars.sh
* multibuild/library_builders.sh
* config.sh

Expand Down Expand Up @@ -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).
Expand All @@ -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).
Expand Down
3 changes: 3 additions & 0 deletions docker_build_wrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions travis_linux_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
4 changes: 4 additions & 0 deletions travis_osx_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a2193fa

Please sign in to comment.