From 0b2e4e9b22e27389cc49fef909310bd8ea24e03b Mon Sep 17 00:00:00 2001 From: Tom van Neerijnen Date: Wed, 12 Aug 2015 10:53:51 +0100 Subject: [PATCH 1/3] preserve ORIG_BUILD_DIR during the build process using the apt buildpack in combination with the multi buildpack exports some paths out of ORIG_BUILD_DIR. By copying instead of moving this should allow building of python modules that have dependancies on any packages installed into ORIG_BUILD_DIR. --- bin/compile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 1ef70c6..236d63c 100755 --- a/bin/compile +++ b/bin/compile @@ -83,7 +83,7 @@ if [[ ! "$DOCKER_BUILD" ]]; then # Copy Application code in. bpwatch start appdir_stage - deep-mv $BUILD_DIR $APP_DIR + deep-cp $BUILD_DIR $APP_DIR bpwatch stop appdir_stage fi @@ -218,6 +218,7 @@ bpwatch stop dump_cache if [[ ! "$DOCKER_BUILD" ]]; then bpwatch start appdir_commit + deep-rm $ORIG_BUILD_DIR deep-mv $BUILD_DIR $ORIG_BUILD_DIR bpwatch stop appdir_commit From da96cdf21efc6864a7f172bf2c143d9ac496f7fb Mon Sep 17 00:00:00 2001 From: Tom van Neerijnen Date: Wed, 12 Aug 2015 11:33:06 +0100 Subject: [PATCH 2/3] set *PROFILE_PATH after context change PROFILE_PATH and WEBCONCURRENCY_PROFILE_PATH must land in the new build context and so should be set after the new context is created --- bin/compile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 236d63c..0260238 100755 --- a/bin/compile +++ b/bin/compile @@ -25,8 +25,6 @@ CACHED_DIRS=".heroku" # Static configurations for virtualenv caches. VIRTUALENV_LOC=".heroku/venv" LEGACY_TRIGGER="lib/python2.7" -PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh" -WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh" DEFAULT_PYTHON_VERSION="python-2.7.10" DEFAULT_PYTHON_STACK="cedar" @@ -92,6 +90,10 @@ fi ORIG_BUILD_DIR=$BUILD_DIR BUILD_DIR=$APP_DIR +# Set up outputs under new context +PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh" +WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh" + # Prepend proper path buildpack use. export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH export PYTHONUNBUFFERED=1 From a91e9c2fc1af8889732455f235c38f62c1bcc302 Mon Sep 17 00:00:00 2001 From: Tom van Neerijnen Date: Wed, 12 Aug 2015 11:43:39 +0100 Subject: [PATCH 3/3] export BUILD_DIR and friends after context change Anything using theses exported variables should be using them in the new context rather than the old --- bin/compile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/compile b/bin/compile index 0260238..5a94069 100755 --- a/bin/compile +++ b/bin/compile @@ -55,10 +55,6 @@ TMP_APP_DIR=$CACHE_DIR/tmp_app_dir bpwatch start compile - -# We'll need to send these statics to other scripts we `source`. -export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH - # Syntax sugar. source $BIN_DIR/utils @@ -94,6 +90,9 @@ BUILD_DIR=$APP_DIR PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh" WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh" +# We'll need to send these statics to other scripts we `source`. +export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH + # Prepend proper path buildpack use. export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH export PYTHONUNBUFFERED=1