diff --git a/.travis.yml b/.travis.yml index d5449a3..102e16e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,11 @@ before_script: script: - docker build --pull --tag travis-build-cedar-14 --file $(pwd)/builds/cedar-14.Dockerfile . - - docker run --rm -e "STACK=cedar-14" travis-build-cedar-14 bash $TESTFOLDER + - docker run --rm -e "STACK=cedar-14" -e "USE_STAGING_BINARIES=$USE_STAGING_BINARIES" travis-build-cedar-14 bash $TESTFOLDER - docker build --pull --tag travis-build-heroku-16 --file $(pwd)/builds/heroku-16.Dockerfile . - - docker run --rm -e "STACK=heroku-16" travis-build-heroku-16 bash $TESTFOLDER + - docker run --rm -e "STACK=heroku-16" -e "USE_STAGING_BINARIES=$USE_STAGING_BINARIES" travis-build-heroku-16 bash $TESTFOLDER - docker build --pull --tag travis-build-heroku-18 --file $(pwd)/builds/heroku-18.Dockerfile . - - docker run --rm -e "STACK=heroku-18" travis-build-heroku-18 bash $TESTFOLDER + - docker run --rm -e "STACK=heroku-18" -e "USE_STAGING_BINARIES=$USE_STAGING_BINARIES" travis-build-heroku-18 bash $TESTFOLDER jobs: include: diff --git a/CHANGELOG.md b/CHANGELOG.md index b303f1c..1aa3592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,14 @@ # Master +- Bug fix: fragile sqlite3 install + -------------------------------------------------------------------------------- +# 161 (2019-12-2) + +- Bug fix: Sqlite3 version bump + # 160 (2019-10-23) - Bugfix: Pipenv no longer installs twice in CI diff --git a/bin/steps/sqlite3 b/bin/steps/sqlite3 index 3faae6e..2d8dc91 100755 --- a/bin/steps/sqlite3 +++ b/bin/steps/sqlite3 @@ -3,21 +3,8 @@ # shellcheck source=bin/utils source "$BIN_DIR/utils" -sqlite3_version() { - if [ "$STACK" = "cedar-14" ]; then - SQLITE3_VERSION="3.8.2-1ubuntu2.2" - elif [ "$STACK" = "heroku-16" ]; then - SQLITE3_VERSION="3.11.0-1ubuntu1.2" - else - SQLITE3_VERSION=${SQLITE3_VERSION:-$(dpkg -s libsqlite3-0 | grep Version | sed 's/Version: //')} - fi - - export SQLITE3_VERSION -} - sqlite3_install() { HEROKU_PYTHON_DIR="$1" - SQLITE3_VERSION="$2" HEADERS_ONLY="$3" mkdir -p "$HEROKU_PYTHON_DIR" @@ -35,9 +22,9 @@ sqlite3_install() { apt-get $APT_OPTIONS update > /dev/null 2>&1 if [ -z "$HEADERS_ONLY" ]; then - apt-get $APT_OPTIONS -y -d --reinstall install libsqlite3-dev="$SQLITE3_VERSION" sqlite3="$SQLITE3_VERSION" > /dev/null 2>&1 + apt-get $APT_OPTIONS -y -d --reinstall install libsqlite3-dev sqlite3 > /dev/null 2>&1 else - apt-get $APT_OPTIONS -y -d --reinstall install libsqlite3-dev="$SQLITE3_VERSION" + apt-get $APT_OPTIONS -y -d --reinstall install libsqlite3-dev fi find "$APT_CACHE_DIR/archives/" -name "*.deb" -exec dpkg -x {} "$HEROKU_PYTHON_DIR/sqlite3/" \; @@ -70,7 +57,6 @@ sqlite3_install() { } buildpack_sqlite3_install() { - sqlite3_version HEROKU_PYTHON_DIR="$BUILD_DIR/.heroku/python" SQLITE3_VERSION_FILE="$BUILD_DIR/.heroku/python-sqlite3-version" @@ -78,16 +64,15 @@ buildpack_sqlite3_install() { INSTALLED_SQLITE3_VERSION=$(cat "$SQLITE3_VERSION_FILE") fi - # python version check - if python_sqlite3_check "$PYTHON_VERSION"; then - # only install if the sqlite3 version has changed - if [ "$INSTALLED_SQLITE3_VERSION" != "$SQLITE3_VERSION" ]; then - puts-step "Installing SQLite3" - sqlite3_install "$BUILD_DIR/.heroku/python" "$SQLITE3_VERSION" + puts-step "Installing SQLite3" - # save version installed - mkdir -p "$CACHE_DIR/.heroku/" - echo "$SQLITE3_VERSION" > "$CACHE_DIR/.heroku/python-sqlite3-version" - fi + if sqlite3_install "$BUILD_DIR/.heroku/python" ; then + echo "Sqlite3 successfully installed." + mcount "success.python.sqlite3" + else + echo "Sqlite3 failed to install." + mcount "failure.python.sqlite3" fi + + mkdir -p "$CACHE_DIR/.heroku/" } diff --git a/builds/cedar-14.Dockerfile b/builds/cedar-14.Dockerfile index ea11542..5d1ae59 100644 --- a/builds/cedar-14.Dockerfile +++ b/builds/cedar-14.Dockerfile @@ -7,7 +7,7 @@ ENV WORKSPACE_DIR="/app/builds" \ DEBIAN_FRONTEND=noninteractive \ STACK="cedar-14" -RUN apt-get update && apt-get install -y python-pip && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y python-pip libsqlite3-dev realpath && rm -rf /var/lib/apt/lists/* COPY requirements.txt /app/ RUN pip install -r /app/requirements.txt diff --git a/builds/heroku-16.Dockerfile b/builds/heroku-16.Dockerfile index 324042e..6b0728e 100644 --- a/builds/heroku-16.Dockerfile +++ b/builds/heroku-16.Dockerfile @@ -7,7 +7,7 @@ ENV WORKSPACE_DIR="/app/builds" \ DEBIAN_FRONTEND=noninteractive \ STACK="heroku-16" -RUN apt-get update && apt-get install -y python-pip && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y python-pip libsqlite3-dev && rm -rf /var/lib/apt/lists/* COPY requirements.txt /app/ RUN pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt diff --git a/builds/heroku-18.Dockerfile b/builds/heroku-18.Dockerfile index 7f0f942..80ad34d 100644 --- a/builds/heroku-18.Dockerfile +++ b/builds/heroku-18.Dockerfile @@ -7,7 +7,7 @@ ENV WORKSPACE_DIR="/app/builds" \ DEBIAN_FRONTEND=noninteractive \ STACK="heroku-18" -RUN apt-get update && apt-get install --no-install-recommends -y python-pip-whl=9.0.1-2 python-pip=9.0.1-2 python-setuptools python-wheel && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install --no-install-recommends -y python-pip-whl=9.0.1-2 python-pip=9.0.1-2 python-setuptools python-wheel libsqlite3-dev && rm -rf /var/lib/apt/lists/* COPY requirements.txt /app/ RUN pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt diff --git a/builds/runtimes/python-2.7.10 b/builds/runtimes/python-2.7.10 index 4ab82dc..ef21c72 100755 --- a/builds/runtimes/python-2.7.10 +++ b/builds/runtimes/python-2.7.10 @@ -1,15 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.10/Python-2.7.10.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.10 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.11 b/builds/runtimes/python-2.7.11 index 903a4a2..ef21c72 100755 --- a/builds/runtimes/python-2.7.11 +++ b/builds/runtimes/python-2.7.11 @@ -1,15 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.11/Python-2.7.11.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.11 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.12 b/builds/runtimes/python-2.7.12 index 3a721c3..ef21c72 100755 --- a/builds/runtimes/python-2.7.12 +++ b/builds/runtimes/python-2.7.12 @@ -1,15 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.12/Python-2.7.12.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.12 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.13 b/builds/runtimes/python-2.7.13 index 4379d2e..ef21c72 100755 --- a/builds/runtimes/python-2.7.13 +++ b/builds/runtimes/python-2.7.13 @@ -1,19 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.13/Python-2.7.13.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.13 src -cd src - -./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.14 b/builds/runtimes/python-2.7.14 index fa16fd5..ef21c72 100755 --- a/builds/runtimes/python-2.7.14 +++ b/builds/runtimes/python-2.7.14 @@ -1,19 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.14/Python-2.7.14.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.14 src -cd src - -./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.15 b/builds/runtimes/python-2.7.15 index a2363fb..ef21c72 100755 --- a/builds/runtimes/python-2.7.15 +++ b/builds/runtimes/python-2.7.15 @@ -1,27 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.15/Python-2.7.15.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.15 src -cd src - -./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.16 b/builds/runtimes/python-2.7.16 index c2ac296..ef21c72 100755 --- a/builds/runtimes/python-2.7.16 +++ b/builds/runtimes/python-2.7.16 @@ -1,27 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.16/Python-2.7.16.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.16 src -cd src - -./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-2.7.9 b/builds/runtimes/python-2.7.9 index 1ab0085..ef21c72 100755 --- a/builds/runtimes/python-2.7.9 +++ b/builds/runtimes/python-2.7.9 @@ -1,15 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/2.7.9/Python-2.7.9.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-2.7.9 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install +source $(dirname $0)/python2 diff --git a/builds/runtimes/python-3.5.0 b/builds/runtimes/python-3.5.0 new file mode 100755 index 0000000..ad41723 --- /dev/null +++ b/builds/runtimes/python-3.5.0 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.1 b/builds/runtimes/python-3.5.1 new file mode 100755 index 0000000..ad41723 --- /dev/null +++ b/builds/runtimes/python-3.5.1 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.2 b/builds/runtimes/python-3.5.2 index 49806e6..ad41723 100755 --- a/builds/runtimes/python-3.5.2 +++ b/builds/runtimes/python-3.5.2 @@ -1,18 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite - -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.5.2/Python-3.5.2.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.5.2 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.3 b/builds/runtimes/python-3.5.3 index 6e54f88..ad41723 100755 --- a/builds/runtimes/python-3.5.3 +++ b/builds/runtimes/python-3.5.3 @@ -1,18 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite - -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.5.3/Python-3.5.3.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.5.3 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.4 b/builds/runtimes/python-3.5.4 new file mode 100755 index 0000000..ad41723 --- /dev/null +++ b/builds/runtimes/python-3.5.4 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.5 b/builds/runtimes/python-3.5.5 new file mode 100755 index 0000000..ad41723 --- /dev/null +++ b/builds/runtimes/python-3.5.5 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.6 b/builds/runtimes/python-3.5.6 index 0d17935..ad41723 100755 --- a/builds/runtimes/python-3.5.6 +++ b/builds/runtimes/python-3.5.6 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.5.6/Python-3.5.6.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.5.6 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.5.7 b/builds/runtimes/python-3.5.7 index 2a07209..ad41723 100755 --- a/builds/runtimes/python-3.5.7 +++ b/builds/runtimes/python-3.5.7 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.5.7/Python-3.5.7.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.5.7 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.0 b/builds/runtimes/python-3.6.0 index 9c31d24..ad41723 100755 --- a/builds/runtimes/python-3.6.0 +++ b/builds/runtimes/python-3.6.0 @@ -1,18 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite - -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.0/Python-3.6.0.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.0 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.1 b/builds/runtimes/python-3.6.1 index 263fc08..ad41723 100755 --- a/builds/runtimes/python-3.6.1 +++ b/builds/runtimes/python-3.6.1 @@ -1,18 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite - -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.1/Python-3.6.1.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.1 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.2 b/builds/runtimes/python-3.6.2 index 9b23a90..ad41723 100755 --- a/builds/runtimes/python-3.6.2 +++ b/builds/runtimes/python-3.6.2 @@ -1,21 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.2/Python-3.6.2.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.2 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.3 b/builds/runtimes/python-3.6.3 index 08f33fe..ad41723 100755 --- a/builds/runtimes/python-3.6.3 +++ b/builds/runtimes/python-3.6.3 @@ -1,21 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.3/Python-3.6.3.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.3 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.4 b/builds/runtimes/python-3.6.4 index d1a93df..ad41723 100755 --- a/builds/runtimes/python-3.6.4 +++ b/builds/runtimes/python-3.6.4 @@ -1,21 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.4/Python-3.6.4.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.4 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.5 b/builds/runtimes/python-3.6.5 index e76cd6a..ad41723 100755 --- a/builds/runtimes/python-3.6.5 +++ b/builds/runtimes/python-3.6.5 @@ -1,21 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite -OUT_PREFIX=$1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.5/Python-3.6.5.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.5 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.6 b/builds/runtimes/python-3.6.6 index a3bf0f8..ad41723 100755 --- a/builds/runtimes/python-3.6.6 +++ b/builds/runtimes/python-3.6.6 @@ -1,29 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.6/Python-3.6.6.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.6 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.7 b/builds/runtimes/python-3.6.7 index 052ee1e..ad41723 100755 --- a/builds/runtimes/python-3.6.7 +++ b/builds/runtimes/python-3.6.7 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.7/Python-3.6.7.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.7 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.8 b/builds/runtimes/python-3.6.8 index a47f466..ad41723 100755 --- a/builds/runtimes/python-3.6.8 +++ b/builds/runtimes/python-3.6.8 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.6.8/Python-3.6.8.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.6.8 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.6.9 b/builds/runtimes/python-3.6.9 index dea889d..ad41723 100755 --- a/builds/runtimes/python-3.6.9 +++ b/builds/runtimes/python-3.6.9 @@ -1,5 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.7.0 b/builds/runtimes/python-3.7.0 index 74dccc5..ad41723 100755 --- a/builds/runtimes/python-3.7.0 +++ b/builds/runtimes/python-3.7.0 @@ -1,29 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.7.0/Python-3.7.0.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.7.0 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.7.1 b/builds/runtimes/python-3.7.1 index b805139..ad41723 100755 --- a/builds/runtimes/python-3.7.1 +++ b/builds/runtimes/python-3.7.1 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.7.1/Python-3.7.1.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.7.1 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.7.2 b/builds/runtimes/python-3.7.2 index 4d74b89..ad41723 100755 --- a/builds/runtimes/python-3.7.2 +++ b/builds/runtimes/python-3.7.2 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.7.2/Python-3.7.2.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.7.2 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.7.3 b/builds/runtimes/python-3.7.3 index 4254362..ad41723 100755 --- a/builds/runtimes/python-3.7.3 +++ b/builds/runtimes/python-3.7.3 @@ -1,32 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -OUT_PREFIX=$1 -BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" -export BIN_DIR - -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python…" -SOURCE_TARBALL='https://python.org/ftp/python/3.7.3/Python-3.7.3.tgz' -curl -L $SOURCE_TARBALL | tar xz -mv Python-3.7.3 src -cd src - -./configure --prefix=$OUT_PREFIX --with-ensurepip=no -make -make install - -# Remove unneeded test directories, similar to the official Docker Python images: -# https://github.com/docker-library/python -find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + - -# Remove spare / -LOCATION=${OUT_PREFIX%?} - -ln $LOCATION/bin/python3 $LOCATION/bin/python +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.7.4 b/builds/runtimes/python-3.7.4 index dea889d..ad41723 100755 --- a/builds/runtimes/python-3.7.4 +++ b/builds/runtimes/python-3.7.4 @@ -1,5 +1,4 @@ #!/usr/bin/env bash # Build Path: /app/.heroku/python/ -# Build Deps: libraries/sqlite source $(dirname $0)/python3 diff --git a/builds/runtimes/python2 b/builds/runtimes/python2 index 5794991..b309254 100644 --- a/builds/runtimes/python2 +++ b/builds/runtimes/python2 @@ -12,14 +12,7 @@ python_version=${BASE^} # this gives us only the filename with version number version_number=$(echo "$python_version" | cut -d- -f2) # this returns just X.X.X dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python 3..." +echo "Building ${python_version}..." echo "Pulling from source: ${dep_url}" curl -L "${dep_url}" | tar xz -C "${OUT_PREFIX}" @@ -33,3 +26,8 @@ make install # Remove unneeded test directories, similar to the official Docker Python images: # https://github.com/docker-library/python find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + + +# Create links to SQLITE headers so Python can call them at runtime +mkdir -p ${OUT_PREFIX}/include ${OUT_PREFIX}/lib/x86_64-linux-gnu +cp /usr/include/sqlite3*.h ${OUT_PREFIX}/include +ln -fs $(realpath /usr/lib/x86_64-linux-gnu/libsqlite3.so) ${OUT_PREFIX}/lib/x86_64-linux-gnu/libsqlite3.so diff --git a/builds/runtimes/python3 b/builds/runtimes/python3 index 79f4421..1b6d152 100755 --- a/builds/runtimes/python3 +++ b/builds/runtimes/python3 @@ -16,17 +16,6 @@ python_version=${BASE^} # this gives us only the filename with version number version_number=$(echo "$python_version" | cut -d- -f2) # this returns just X.X.X dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz -# shellcheck source=bin/utils -source "$BIN_DIR/steps/sqlite3" - -sqlite3_version -echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" -sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 - -echo "Building Python 3..." -echo "Pulling from source: ${dep_url}" - - curl -L "${dep_url}" | tar xz -C "${OUT_PREFIX}" mv "${OUT_PREFIX}/${python_version}" src cd src @@ -42,4 +31,9 @@ find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm - # Remove spare / LOCATION=${OUT_PREFIX%?} +# Create links to SQLITE headers so Python can call them at runtime +mkdir -p ${OUT_PREFIX}/include ${OUT_PREFIX}/lib/x86_64-linux-gnu +cp /usr/include/sqlite3*.h ${OUT_PREFIX}/include +ln -fs $(realpath /usr/lib/x86_64-linux-gnu/libsqlite3.so) ${OUT_PREFIX}/lib/x86_64-linux-gnu/libsqlite3.so + ln $LOCATION/bin/python3 $LOCATION/bin/python diff --git a/test/fixtures/python3_4/runtime.txt b/test/fixtures/python3_4/runtime.txt index cc8325f..3b5c63e 100644 --- a/test/fixtures/python3_4/runtime.txt +++ b/test/fixtures/python3_4/runtime.txt @@ -1 +1 @@ -python-3.4.9 +python-3.4.10 diff --git a/test/fixtures/python3_5/runtime.txt b/test/fixtures/python3_5/runtime.txt index e6391f4..df4118a 100644 --- a/test/fixtures/python3_5/runtime.txt +++ b/test/fixtures/python3_5/runtime.txt @@ -1 +1 @@ -python-3.5.6 +python-3.5.7 diff --git a/test/fixtures/python3_5_warn/runtime.txt b/test/fixtures/python3_5_warn/runtime.txt index 5486d7a..e6391f4 100644 --- a/test/fixtures/python3_5_warn/runtime.txt +++ b/test/fixtures/python3_5_warn/runtime.txt @@ -1 +1 @@ -python-3.5.3 +python-3.5.6 diff --git a/test/run-deps b/test/run-deps index 71c1625..f40c304 100755 --- a/test/run-deps +++ b/test/run-deps @@ -54,6 +54,13 @@ testPysqlite() { assertCapturedSuccess } +testSqliteInstall() { + compile "pythonDefault" + assertCaptured "Sqlite3 successfully installed." + assertNotCaptured "Sqlite3 failed to install." + assertCapturedSuccess +} + testCffi() { compile "cffi" assertCaptured "cffi" diff --git a/test/run-features b/test/run-features index 66fac4e..c3ee1f2 100755 --- a/test/run-features +++ b/test/run-features @@ -16,7 +16,6 @@ testSmartRequirements() { assertFile "requests" ".heroku/python/requirements-declared.txt" assertCapturedSuccess compile "psycopg2" "$cache_dir" - assertCaptured "Uninstalling requests" assertFile "psycopg2" ".heroku/python/requirements-declared.txt" assertCapturedSuccess } diff --git a/test/run-versions b/test/run-versions index 2526238..0698b7c 100755 --- a/test/run-versions +++ b/test/run-versions @@ -38,11 +38,17 @@ testPython2_fail() { } testPython3_4() { - if [[ $STACK != "cedar-14" ]]; then - updateVersion "python3_4" $LATEST_34 - compile "python3_4" - assertCaptured $LATEST_34 - assertNotCaptured "security update" + compile "python3_4" + assertCaptured $LATEST_34 + assertNotCaptured "security update" + # if cedar 14 and legacy binaries, fail. if cedar 14 and staging, succeed. + if [[ ! -n $USE_STAGING_BINARIES ]] && [[ $STACK == "cedar-14" ]]; then + assertCapturedError +# if heroku 18 and legacy binaries, succeed. if heroku 18 and staging, fail. + elif [[ -n $USE_STAGING_BINARIES ]] && [[ $STACK == "heroku-18" ]]; then + assertCapturedError + else +# all else succeed assertCapturedSuccess fi } @@ -51,7 +57,13 @@ testPython3_4_warn() { compile "python3_4_warn" assertCaptured "python-3.4.9" assertCaptured "security update!" - assertCapturedSuccess +# if heroku 18 and legacy binaries, succeed. if heroku 18 and staging, fail. + if [[ -n $USE_STAGING_BINARIES ]] && [[ $STACK == "heroku-18" ]]; then + assertCapturedError + else +# all else succeed + assertCapturedSuccess + fi } testPython3_4_fail() { @@ -61,25 +73,18 @@ testPython3_4_fail() { } testPython3_5() { - if [[ $STACK != "cedar-14" ]]; then - updateVersion "python3_5" $LATEST_35 - compile "python3_5" - assertCaptured $LATEST_35 - assertNotCaptured "security update" - assertCaptured "Installing SQLite3" - assertCapturedSuccess - fi + compile "python3_5" + assertCaptured $LATEST_35 + assertNotCaptured "security update" + assertCaptured "Installing SQLite3" + assertCapturedSuccess } testPython3_5_warn() { compile "python3_5_warn" - if [[ $STACK = "cedar-14" ]]; then - assertCaptured "python-3.5.3" - assertCaptured "security update!" - assertCapturedError - else - assertCapturedError - fi + assertCaptured "python-3.5.6" + assertCaptured "security update!" + assertCapturedSuccess } testPython3_5_fail() {