Skip to content

Purge old jemalloc files from cache on cache miss (eg on stack or jemalloc version change) #37

@edmorley

Description

@edmorley

This buildpack compiles jemalloc during the build and caches the result under a stack and jemalloc-specific path:

# 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:

# doesn't exist.
if [[ ! -d $bundle ]]; then
echo "-----> jemalloc: Installing $version from source"
download
compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions