Merge pull request #907 from heroku/refactor-sqlite

Bug fix: fragile sqlite install
This commit is contained in:
Casey
2019-12-06 09:43:23 -05:00
committed by GitHub
4 changed files with 16 additions and 42 deletions
-3
View File
@@ -28,11 +28,8 @@ jobs:
env:
matrix:
- TESTFOLDER=test/run-deps
- TESTFOLDER=test/run-deps USE_STAGING_BINARIES=https://lang-python.s3.amazonaws.com/staging
- TESTFOLDER=test/run-versions
- TESTFOLDER=test/run-versions USE_STAGING_BINARIES=https://lang-python.s3.amazonaws.com/staging
- TESTFOLDER=test/run-features
- TESTFOLDER=test/run-features USE_STAGING_BINARIES=https://lang-python.s3.amazonaws.com/staging
global:
- HATCHET_RETRIES=3
- IS_RUNNING_ON_CI=true
+5 -5
View File
@@ -2,14 +2,14 @@
# Master
- Sqlite fix:
- Update Python3 and Python2 base formula
- Update Python formulas 3.6.x, 3.7.x, 3.5.x, and 2.7.17-2.7.9
- Test staged binaries on Travis
- Bug fix: Sqlite3 version bump
- 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
+11 -33
View File
@@ -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.3"
else
SQLITE3_VERSION="3.22.0-1ubuntu0.2"
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,23 +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"
puts-step "Installing SQLite3"
if sqlite3_install "$BUILD_DIR/.heroku/python" "$SQLITE3_VERSION" ; then
echo "Sqlite3 successfully installed."
mcount "success.python.sqlite3"
else
echo "Sqlite3 failed to install."
mcount "failure.python.sqlite3"
fi
# 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/"
}
-1
View File
@@ -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
}