Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the BUILD_WITH_GEO_LIBRARIES warning fatal #1115

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Error if the unsupported `BUILD_WITH_GEO_LIBRARIES` env var is set (#1115).
- Remove deprecated GDAL/GEOS/PROJ support (#1113).
- Remove vendored `jq` binary (#1112).
- Remove redundant Mercurial install step (#1111).
Expand Down
34 changes: 25 additions & 9 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ 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
Expand Down Expand Up @@ -105,6 +96,31 @@ source "$BIN_DIR/utils"
# shellcheck source=bin/warnings
source "$BIN_DIR/warnings"

if [[ "${STACK}" == "cedar-14" ]]; then
mcount "failure.unsupported.cedar-14"
puts-warn "The Cedar-14 stack is no longer supported by the latest release of this buildpack."
puts-warn
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
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

if [[ -f "${ENV_DIR}/BUILD_WITH_GEO_LIBRARIES" ]]; then
mcount "failure.unsupported.BUILD_WITH_GEO_LIBRARIES"
puts-warn "The Python buildpack's BUILD_WITH_GEO_LIBRARIES functonality is no longer supported:"
puts-warn "https://help.heroku.com/D5INLB1A/python-s-build_with_geo_libraries-legacy-feature-is-now-deprecated"
puts-warn
puts-warn "For GDAL, GEOS and PROJ support, use the Geo buildpack alongside the Python buildpack:"
puts-warn "https://github.com/heroku/heroku-geo-buildpack"
puts-warn
puts-warn "To remove this error message, unset the BUILD_WITH_GEO_LIBRARIES variable using:"
puts-warn "heroku config:unset BUILD_WITH_GEO_LIBRARIES"
exit 1
fi

# Make the directory in which we will create symlinks from the temporary build directory
# to `/app`.
# Symlinks are required, since Python is not a portable installation.
Expand Down
18 changes: 2 additions & 16 deletions bin/warnings
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,7 @@ six-included() {
fi
}

geo-gdal-support() {
if [[ -f "${ENV_DIR}/BUILD_WITH_GEO_LIBRARIES" ]]; then
mcount "warnings.BUILD_WITH_GEO_LIBRARIES"
echo
puts-warn "The Python buildpack's BUILD_WITH_GEO_LIBRARIES functonality is no longer supported:"
puts-warn "https://help.heroku.com/D5INLB1A/python-s-build_with_geo_libraries-legacy-feature-is-now-deprecated"
puts-warn
puts-warn "For GDAL, GEOS and PROJ support, use the Geo buildpack alongside the Python buildpack:"
puts-warn "https://github.com/heroku/heroku-geo-buildpack"
puts-warn
puts-warn "To hide this message, unset the BUILD_WITH_GEO_LIBRARIES variable using:"
puts-warn "heroku config:unset BUILD_WITH_GEO_LIBRARIES"
echo
return
fi
gdal-missing() {
if grep -qi 'Could not find gdal-config' "$WARNINGS_LOG"; then
mcount 'warnings.gdal'
echo
Expand All @@ -76,6 +62,6 @@ show-warnings() {
scipy-included
distribute-included
six-included
geo-gdal-support
gdal-missing
}