-
Notifications
You must be signed in to change notification settings - Fork 83
Description
This buildpack compiles jemalloc during the build and caches the result under a stack and jemalloc-specific path:
heroku-buildpack-jemalloc/bin/compile
Lines 37 to 38 in a7fe927
| # bundle is the full path to the cached jemalloc binaries for this version. | |
| bundle=$CACHE_DIR/jemalloc/$STACK/$version |
This correctly ensures that a recompile happens if the stack or requested jemalloc version changes.
However, currently the buildpack does not remove these cached items on cache miss, meaning the cache will continue to grow in size each time the stack or requested jemalloc version changes (unless users know to manually clear their build cache using a special CLI plugin).
To resolve this, the buildpack could do an rm -rf "${CACHE_DIR}/jemalloc/" on cache miss before the download/recompile, here:
heroku-buildpack-jemalloc/bin/compile
Lines 116 to 121 in a7fe927
| # doesn't exist. | |
| if [[ ! -d $bundle ]]; then | |
| echo "-----> jemalloc: Installing $version from source" | |
| download | |
| compile |