From 452443d420fa67e531a28c63571b8db979e3433d Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 10 Nov 2020 13:58:33 +0000 Subject: [PATCH] Remove support for the Cedar-14 stack (#1110) Since the stack is end of life and builds have been disabled: https://devcenter.heroku.com/changelog-items/1943 There are only two temporarily exempted customers using Python, who can switch to the Cedar-14 support branch if they still need to build their Python apps (most of which haven't been built recently). Closes @W-8054727@. --- .travis.yml | 4 --- CHANGELOG.md | 1 + Makefile | 13 +++------ bin/compile | 29 +++++++++---------- bin/steps/pylibmc | 37 ------------------------ bin/warnings | 11 ------- builds/cedar-14.Dockerfile | 21 -------------- builds/libraries/vendor/libmemcache | 45 ----------------------------- test/run-features | 6 +--- test/run-versions | 24 --------------- 10 files changed, 20 insertions(+), 171 deletions(-) delete mode 100755 bin/steps/pylibmc delete mode 100644 builds/cedar-14.Dockerfile delete mode 100755 builds/libraries/vendor/libmemcache diff --git a/.travis.yml b/.travis.yml index 63b1589..8160c79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,10 +23,6 @@ jobs: env: jobs: - - STACK=cedar-14 TEST_CMD=test/run-deps - - STACK=cedar-14 TEST_CMD=test/run-versions - - STACK=cedar-14 TEST_CMD=test/run-features - - STACK=heroku-16 TEST_CMD=test/run-deps - STACK=heroku-16 TEST_CMD=test/run-versions - STACK=heroku-16 TEST_CMD=test/run-features diff --git a/CHANGELOG.md b/CHANGELOG.md index 62eb3c2..dde59cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Remove support for the Cedar-14 stack (#1110). ## v184 (2020-10-21) diff --git a/Makefile b/Makefile index b1c349e..48b3fef 100644 --- a/Makefile +++ b/Makefile @@ -2,22 +2,17 @@ .PHONY: check test builder-image buildenv deploy-runtimes tools STACK ?= heroku-18 -STACKS ?= cedar-14 heroku-16 heroku-18 heroku-20 +STACKS ?= heroku-16 heroku-18 heroku-20 TEST_CMD ?= test/run-versions && test/run-features && test/run-deps ENV_FILE ?= builds/dockerenv.default BUILDER_IMAGE_PREFIX := heroku-python-build -ifeq ($(STACK),cedar-14) - # Cedar-14 doesn't have a build image varient. - STACK_IMAGE_TAG := heroku/cedar:14 -else - # Converts a stack name of `heroku-NN` to its build Docker image tag of `heroku/heroku:NN-build`. - STACK_IMAGE_TAG := heroku/$(subst -,:,$(STACK))-build -endif +# Converts a stack name of `heroku-NN` to its build Docker image tag of `heroku/heroku:NN-build`. +STACK_IMAGE_TAG := heroku/$(subst -,:,$(STACK))-build check: @shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings bin/default_pythons - @shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/gdal bin/steps/geo-libs bin/steps/mercurial bin/steps/nltk bin/steps/pip-install bin/steps/pip-uninstall bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/pylibmc bin/steps/python + @shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/gdal bin/steps/geo-libs bin/steps/mercurial bin/steps/nltk bin/steps/pip-install bin/steps/pip-uninstall bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/python @shellcheck -x bin/steps/hooks/* test: diff --git a/bin/compile b/bin/compile index 6e71ac9..1ba32a7 100755 --- a/bin/compile +++ b/bin/compile @@ -35,17 +35,20 @@ ENV_DIR=$3 # Export Path variables, for use in sub-scripts. export BUILD_DIR CACHE_DIR ENV_DIR +if [[ "${STACK}" == "cedar-14" ]]; then + puts-warn "The Cedar-14 stack is no longer supported by the latest release of this buildpack." + puts-warn "Please switch to the Cedar-14 support branch by using this buildpack URL:" + puts-warn "https://github.com/heroku/heroku-buildpack-python#cedar-14" + puts-warn "For instructions on how to change the buildpacks used by an app, see:" + puts-warn "https://devcenter.heroku.com/articles/buildpacks#setting-a-buildpack-on-an-application" + exit 1 +fi + # Set the base URL for downloading buildpack assets like Python runtimes. # The user can provide BUILDPACK_S3_BASE_URL to specify a custom target. # Note: this is designed for non-Heroku use, as it does not use the user-provided # environment variable mechanism (the ENV_DIR). -if [[ "${STACK}" == "cedar-14" ]]; then - # Since Cedar-14 is EOL on 2020-11-02 it's not worth migrating it to the new bucket. - DEFAULT_S3_BASE_URL='https://lang-python.s3.amazonaws.com' -else - DEFAULT_S3_BASE_URL='https://heroku-buildpack-python.s3.amazonaws.com' -fi -S3_BASE_URL="${BUILDPACK_S3_BASE_URL:-${DEFAULT_S3_BASE_URL}}" +S3_BASE_URL="${BUILDPACK_S3_BASE_URL:-"https://heroku-buildpack-python.s3.amazonaws.com"}" # This has to be exported since it's used by the geo-libs step which is run in a subshell. # TODO: Stop exporting once the geo-libs step is removed or no longer uses `sub_env`. export S3_BASE_URL @@ -66,7 +69,8 @@ PYPY27="pypy2.7" PYPY36="pypy3.6" # Which stack is used (for binary downloading), if none is provided (e.g. outside of Heroku)? -DEFAULT_PYTHON_STACK="cedar-14" +# TODO: Remove this and require that STACK be set explicitly. +DEFAULT_PYTHON_STACK="heroku-18" # Common Problem Warnings: # This section creates a temporary file in which to stick the output of `pip install`. @@ -131,7 +135,7 @@ export PYTHONUNBUFFERED=1 # Set the locale to a well-known and expected standard. export LANG=en_US.UTF-8 # `~/.heroku/vendor` is an place where the buildpack may stick pre-build binaries for known -# C dependencies (e.g. libmemcached on cedar-14). This section configures Python (GCC, more specifically) +# C dependencies. This section configures Python (GCC, more specifically) # and pip to automatically include these paths when building binaries. export C_INCLUDE_PATH=/app/.heroku/vendor/include:/app/.heroku/python/include:$C_INCLUDE_PATH export CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:/app/.heroku/python/include:$CPLUS_INCLUDE_PATH @@ -265,12 +269,7 @@ source "$BIN_DIR/steps/eggpath-fix" # shellcheck source=bin/steps/mercurial source "$BIN_DIR/steps/mercurial" -# Pylibmc support. -# On cedar-14, libmemcached was not available. The buildpack provides its own version, instead. -# shellcheck source=bin/steps/pylibmc -source "$BIN_DIR/steps/pylibmc" - -# Support for Geo libraries. This is deprecated functionality, only functional on cedar-14. +# Support for Geo libraries. This is deprecated functionality. # It is undocumented. # shellcheck source=bin/steps/geo-libs sub_env "$BIN_DIR/steps/geo-libs" diff --git a/bin/steps/pylibmc b/bin/steps/pylibmc deleted file mode 100755 index a016964..0000000 --- a/bin/steps/pylibmc +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -# This script serves as the Pylibmc build step of the -# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) -# compiler. -# -# A [buildpack](https://devcenter.heroku.com/articles/buildpacks) is an -# adapter between a Python application and Heroku's runtime. -# -# This script is invoked by [`bin/compile`](/). - -if [[ "$STACK" != "cedar-14" ]]; then - # libmemcached is pre-installed in the stack image so there is no need to vendor it. - return 0 -fi - -# The location of the pre-compiled libmemcached binary. -VENDORED_MEMCACHED="${S3_BASE_URL}/${STACK}/libraries/vendor/libmemcache.tar.gz" - -# Syntax sugar. -# shellcheck source=bin/utils -source "$BIN_DIR/utils" - -# If pylibmc exists within requirements, use vendored libmemcached. -if (pip-grep -s requirements.txt pylibmc &> /dev/null) then - - if [ ! -d ".heroku/vendor/lib/sasl2" ]; then - echo "-----> Noticed pylibmc. Bootstrapping libmemcached." - mkdir -p .heroku/vendor - # Download and extract libmemcached into target vendor directory. - curl "$VENDORED_MEMCACHED" -s | tar zxv -C .heroku/vendor &> /dev/null - mcount "steps.vendor.pylibmc" - fi - - LIBMEMCACHED=$(pwd)/vendor - export LIBMEMCACHED -fi diff --git a/bin/warnings b/bin/warnings index b43748b..b987955 100755 --- a/bin/warnings +++ b/bin/warnings @@ -12,16 +12,6 @@ old-platform() { fi } -pylibmc-missing() { - if grep -qi 'fatal error: libmemcached/memcached.h: No such file or directory' "$WARNINGS_LOG"; then - echo - puts-warn "Hello! There was a problem with your build related to libmemcache." - puts-warn "The Python library 'pylibmc' must be explicitly specified in 'requirements.txt' in order to build correctly." - puts-warn "Once you do that, everything should work as expected. -- Much Love, Heroku." - mcount 'warnings.libmemcache' - fi -} - scipy-included() { if grep -qi 'running setup.py install for scipy' "$WARNINGS_LOG"; then echo @@ -58,7 +48,6 @@ six-included() { show-warnings() { old-platform - pylibmc-missing scipy-included distribute-included six-included diff --git a/builds/cedar-14.Dockerfile b/builds/cedar-14.Dockerfile deleted file mode 100644 index 51c8ee3..0000000 --- a/builds/cedar-14.Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM heroku/cedar:14 - -ENV WORKSPACE_DIR="/app/builds" \ - S3_BUCKET="lang-python" \ - S3_PREFIX="cedar-14/" \ - STACK="cedar-14" - -RUN apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ - libsqlite3-dev \ - python3-pip \ - realpath \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /app - -COPY requirements.txt /app/ -# Can't use `--disable-pip-version-check --no-cache-dir` since not supported by Ubuntu 14.04's pip. -RUN pip3 install -r /app/requirements.txt - -COPY . /app diff --git a/builds/libraries/vendor/libmemcache b/builds/libraries/vendor/libmemcache deleted file mode 100755 index 8ad617b..0000000 --- a/builds/libraries/vendor/libmemcache +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -# Build Path: /app/.heroku/vendor/ - -OUT_PREFIX=$1 - -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 -set -o pipefail -# fail harder -set -eux - -DEFAULT_VERSION="1.0.18" -dep_version=${VERSION:-$DEFAULT_VERSION} -dep_dirname=libmemcached-${dep_version} -dep_archive_name=${dep_dirname}.tar.gz -dep_url=https://launchpad.net/libmemcached/1.0/${dep_version}/+download/${dep_archive_name} - -# SASL Support. -echo "-----> Building cyrus-sasl 2.1.26…" - -curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz -# FTP doesn't play well with piping into tar xz -tar xzf cyrus-sasl-2.1.26.tar.gz - -pushd cyrus-sasl-2.1.26 -./configure --prefix=${OUT_PREFIX} --with-plugindir=${OUT_PREFIX}lib/sasl2 --with-configdir=${OUT_PREFIX}lib/sasl2 - -make -s -j 9 -make install -s -popd - -echo "-----> Building libmemcached ${dep_version}…" - -curl -L ${dep_url} | tar xz -pushd ${dep_dirname} -CPPFLAGS=-I${OUT_PREFIX}/include LDFLAGS=-L${OUT_PREFIX}/lib ./configure --prefix=${OUT_PREFIX} --without-memcached -make -s -j 9 -make install -s -popd - -echo "-----> Done." \ No newline at end of file diff --git a/test/run-features b/test/run-features index 7496854..d2e6a3c 100755 --- a/test/run-features +++ b/test/run-features @@ -80,10 +80,6 @@ testPipenvPythonVersion2_7() { } testPipenvPythonFullVersion() { - # Python 3.7+ requires newer libssl than is present on Cedar-14. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi compile "pipenv-full-version" assertCaptured "3.7.8" # Can't use `assertCapturedSuccess` since stderr contains: @@ -140,7 +136,7 @@ testHooks() { SOME_APP_CONFIG_VAR STACK ) - if [[ "${STACK}" == "cedar-14" || "${STACK}" == "heroku-16" ]]; then + if [[ "${STACK}" == "heroku-16" ]]; then # Remove "OLDPWD" from expected_env_vars since for bash <4.4 it's not exported to subshells: # https://github.com/heroku/heroku-buildpack-python/pull/1011#issuecomment-665117835 read -ra expected_env_vars <<< "${expected_env_vars[@]/OLDPWD/}" diff --git a/test/run-versions b/test/run-versions index 63d2751..c171f22 100755 --- a/test/run-versions +++ b/test/run-versions @@ -112,10 +112,6 @@ testPython3_6_warn() { } testPython3_7() { - # Python 3.7+ requires newer libssl than is present on Cedar-14. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi compile "python3_7" assertCaptured "Installing ${LATEST_37}" assertNotCaptured "security update" @@ -125,10 +121,6 @@ testPython3_7() { } testPython3_7_warn() { - # Python 3.7+ requires newer libssl than is present on Cedar-14. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi compile "python3_7_warn" assertCaptured "Installing python-3.7.8" assertCaptured "security update!" @@ -137,10 +129,6 @@ testPython3_7_warn() { } testPython3_8() { - # Python 3.7+ requires newer libssl than is present on Cedar-14. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi compile "python3_8" assertCaptured "Installing ${LATEST_38}" assertNotCaptured "security update" @@ -150,10 +138,6 @@ testPython3_8() { } testPython3_8_warn() { - # Python 3.7+ requires newer libssl than is present on Cedar-14. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi compile "python3_8_warn" assertCaptured "Installing python-3.8.5" assertCaptured "security update!" @@ -162,10 +146,6 @@ testPython3_8_warn() { } testPython3_9() { - # Cedar-14 is EOL, so we're not building new major Python versions for it. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi compile "python3_9" assertCaptured "Installing ${LATEST_39}" assertNotCaptured "security update" @@ -175,10 +155,6 @@ testPython3_9() { } testPython3_9_warn() { - # Cedar-14 is EOL, so we're not building new major Python versions for it. - if [[ "${STACK}" = "cedar-14" ]]; then - return - fi # Can't test the version warning until there is at least one old version of Python 3.9. if [[ "${LATEST_39}" = "python-3.9.0" ]]; then return