Skip to content

Commit bcc3ba0

Browse files
committed
Make vendored libraries available at compile time (fixes heroku#57)
When building, BUILD_DIR is set to a temporary directory. Vendored libraries (e.g., pylibmc) are downloaded and unpacked in $BUILD_DIR/.heroku/vendor/lib, but this is not currently in LIBRARY_PATH or LD_LIBRARY_PATH. Fix this by doing the following: * Add $BUILD_DIR/.heroku/vendor/lib to LIBRARY_PATH/LD_LIBRARY_PATH * Add $BUILD_DIR/.heroku/vendor/include to C_INCLUDE_PATH/CPLUS_INCLUDE_PATH * Add $BUILD_DIR/.heroku/vendor/bin to PATH, so vendored commands can be used at compile time (e.g., curl-config) * Add $BUILD_DIR/.heroku/vendor/lib/pkg-config to PKG_CONFIG_PATH, so vendored packages can be found with pkg-config
1 parent 31e65dc commit bcc3ba0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/compile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ ORIG_BUILD_DIR=$BUILD_DIR
7979
BUILD_DIR=$APP_DIR
8080

8181
# Prepend proper path buildpack use.
82-
export PATH=$BUILD_DIR/.heroku/python/bin:$PATH
82+
export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH
8383
export PYTHONUNBUFFERED=1
8484
export LANG=en_US.UTF-8
85-
export LIBRARY_PATH=/app/.heroku/vendor/lib
86-
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib
85+
export C_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include
86+
export CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include
87+
export LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib
88+
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib
89+
export PKG_CONFIG_PATH=/app/.heroku/vendor/lib/pkg-config:$BUILD_DIR/.heroku/vendor/lib/pkg-config
8790

8891
# Switch to the repo's context.
8992
cd $BUILD_DIR

0 commit comments

Comments
 (0)