From 989351467f28d9af0e47cc120568b9a2a17cb0b6 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Fri, 24 Apr 2020 03:23:38 +0100 Subject: [PATCH] Prevent building libmemcached on stacks that don't vendor it (#964) The `libmemcached` package is available in the base stack image for all stacks newer than `cedar-14`, so at buildpack compile time the vendor step is skipped for those stacks: https://github.com/heroku/heroku-buildpack-python/blob/106f2997fa124852a2a35ee8bfa604ad20c47988/bin/steps/pylibmc#L12-L15 As such, it is not necessary to run the libmemcached bob-builder formula on newer stacks. The conditional has been updated so it correctly handles heroku-18 and also the upcoming heroku-20. An exit code of 1 has been used, otherwise `bob upload` will build and then upload a zero byte archive to S3, which will go unused. (This is in comparison to bob formulas that are nested, where an exit code of 0 is actually desirable, since it allows skipping steps.) Refs W-7485877. Co-authored-by: Joe Kutner --- builds/libraries/vendor/libmemcache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/libraries/vendor/libmemcache b/builds/libraries/vendor/libmemcache index 3d01ce5..8ad617b 100755 --- a/builds/libraries/vendor/libmemcache +++ b/builds/libraries/vendor/libmemcache @@ -3,9 +3,9 @@ OUT_PREFIX=$1 -# Skip the build for heroku-16. -if [[ $S3_PREFIX == "heroku-16" ]]; then - exit 0 +if [[ $S3_PREFIX != "cedar-14" ]]; then + echo "libmemcached only needs to be built for cedar-14, since newer stacks include it in the base image" + exit 1 fi # fail hard