From 9bd5fa7c7f8c0a7443ded166a9c166abe31f58d2 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Mon, 30 Sep 2019 11:25:39 -0700 Subject: [PATCH 1/6] replace formula sqlite install --- builds/runtimes/python3 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/builds/runtimes/python3 b/builds/runtimes/python3 index 79f4421..0638218 100755 --- a/builds/runtimes/python3 +++ b/builds/runtimes/python3 @@ -16,16 +16,19 @@ 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}" +# Install SQLITE, as headers are not available out of the box on the stack +apt-get install libsqlite3-dev +needed=( libsqlite3-dev ) +if [[ $STACK != "heroku-16" && $STACK != "heroku-16" ]]; then + needed+=( realpath ) +# Check whether our packages are missing on the stack +missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort)) +if [[ "$missing" ]]; then + # install missing and needed packages + apt-get update -qq || { echo "Failed to 'apt-get update'. You must build this formula using Docker."; exit 1; } + apt-get install -q -y $missing +fi curl -L "${dep_url}" | tar xz -C "${OUT_PREFIX}" mv "${OUT_PREFIX}/${python_version}" src From 14c15f4dd8ed272380a8fb6101ec0ce318ff3084 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Mon, 30 Sep 2019 11:57:17 -0700 Subject: [PATCH 2/6] create symlinks for python3 formula to sqlite --- builds/runtimes/python3 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builds/runtimes/python3 b/builds/runtimes/python3 index 0638218..5e5b290 100755 --- a/builds/runtimes/python3 +++ b/builds/runtimes/python3 @@ -45,4 +45,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 From 3f9a80ad2434165edb6ea55133461091acd823d8 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Mon, 30 Sep 2019 15:14:28 -0700 Subject: [PATCH 3/6] don't check stack defensively as its not forwards compatible --- builds/runtimes/python3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/runtimes/python3 b/builds/runtimes/python3 index 5e5b290..5578cec 100755 --- a/builds/runtimes/python3 +++ b/builds/runtimes/python3 @@ -19,7 +19,7 @@ dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz # Install SQLITE, as headers are not available out of the box on the stack apt-get install libsqlite3-dev needed=( libsqlite3-dev ) -if [[ $STACK != "heroku-16" && $STACK != "heroku-16" ]]; then +if [[ $STACK == "cedar-14" ]]; then needed+=( realpath ) # Check whether our packages are missing on the stack From 0be5993e32c24b4ce14eabe3957306f4b6457b3e Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 8 Oct 2019 12:27:41 -0700 Subject: [PATCH 4/6] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a24212..9681260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # Master +- Sqlite fix: + - base Python3 file corrected - Test staged binaries on Travis -------------------------------------------------------------------------------- From 50cdf10a36b00f249c00b9ded9ada8e291a5bfbe Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 8 Oct 2019 13:22:04 -0700 Subject: [PATCH 5/6] move libsqlite-dev install back to dockerfile --- builds/cedar-14.Dockerfile | 2 +- builds/heroku-16.Dockerfile | 2 +- builds/heroku-18.Dockerfile | 2 +- builds/runtimes/python3 | 14 -------------- 4 files changed, 3 insertions(+), 17 deletions(-) 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/python3 b/builds/runtimes/python3 index 5578cec..1b6d152 100755 --- a/builds/runtimes/python3 +++ b/builds/runtimes/python3 @@ -16,20 +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 -# Install SQLITE, as headers are not available out of the box on the stack -apt-get install libsqlite3-dev -needed=( libsqlite3-dev ) -if [[ $STACK == "cedar-14" ]]; then - needed+=( realpath ) - -# Check whether our packages are missing on the stack -missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort)) -if [[ "$missing" ]]; then - # install missing and needed packages - apt-get update -qq || { echo "Failed to 'apt-get update'. You must build this formula using Docker."; exit 1; } - apt-get install -q -y $missing -fi - curl -L "${dep_url}" | tar xz -C "${OUT_PREFIX}" mv "${OUT_PREFIX}/${python_version}" src cd src From 1c87fd3d6e0f2df76a20350cd13ea646dd1316d7 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 29 Oct 2019 14:17:46 -0700 Subject: [PATCH 6/6] correct changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9681260..260eed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ # Master - Sqlite fix: - - base Python3 file corrected + - Update Python3 base formula - Test staged binaries on Travis --------------------------------------------------------------------------------