diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a20a17f6..22d62395c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Improved the robustness of buildpack error handling by enabling `inherit_errexit`. ([#1655](https://github.com/heroku/heroku-buildpack-python/pull/1655)) ## [v258] - 2024-10-01 diff --git a/bin/compile b/bin/compile index e9b0eb3eb..706a61a43 100755 --- a/bin/compile +++ b/bin/compile @@ -4,6 +4,7 @@ # shellcheck disable=SC2250 # TODO: Use braces around variable references even when not strictly required. set -euo pipefail +shopt -s inherit_errexit # Note: This can't be enabled via app config vars, since at this point they haven't been loaded from ENV_DIR. if [[ "${BUILDPACK_XTRACE:-0}" == "1" ]]; then diff --git a/bin/detect b/bin/detect index 949c24dca..37d7ccdb1 100755 --- a/bin/detect +++ b/bin/detect @@ -3,6 +3,7 @@ # See: https://devcenter.heroku.com/articles/buildpack-api set -euo pipefail +shopt -s inherit_errexit BUILD_DIR="${1}" diff --git a/bin/release b/bin/release index 0e8058d1f..af46b035d 100755 --- a/bin/release +++ b/bin/release @@ -3,6 +3,7 @@ # See: https://devcenter.heroku.com/articles/buildpack-api set -euo pipefail +shopt -s inherit_errexit BUILD_DIR="${1}" diff --git a/bin/report b/bin/report index b45378672..44079d6d0 100755 --- a/bin/report +++ b/bin/report @@ -18,6 +18,7 @@ # when developing run `make compile` in this repo locally, which runs `bin/report` too. set -euo pipefail +shopt -s inherit_errexit CACHE_DIR="${2}" diff --git a/bin/test-compile b/bin/test-compile index 03fd6fadb..1fef46275 100755 --- a/bin/test-compile +++ b/bin/test-compile @@ -3,6 +3,7 @@ # See: https://devcenter.heroku.com/articles/testpack-api set -euo pipefail +shopt -s inherit_errexit # The absolute path to the root of the buildpack. BUILDPACK_DIR=$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd) diff --git a/builds/build_python_runtime.sh b/builds/build_python_runtime.sh index 194670ea8..5aad9222b 100755 --- a/builds/build_python_runtime.sh +++ b/builds/build_python_runtime.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -euo pipefail +shopt -s inherit_errexit PYTHON_VERSION="${1:?"Error: The Python version to build must be specified as the first argument."}" PYTHON_MAJOR_VERSION="${PYTHON_VERSION%.*}" diff --git a/builds/test_python_runtime.sh b/builds/test_python_runtime.sh index 4a21750d4..9eb41a590 100755 --- a/builds/test_python_runtime.sh +++ b/builds/test_python_runtime.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -euo pipefail +shopt -s inherit_errexit ARCHIVE_FILEPATH="${1:?"Error: The filepath of the Python runtime archive must be specified as the first argument."}" diff --git a/etc/publish.sh b/etc/publish.sh index 77499f50b..1a445e6d7 100755 --- a/etc/publish.sh +++ b/etc/publish.sh @@ -2,6 +2,7 @@ # shellcheck disable=SC2250 # TODO: Use braces around variable references even when not strictly required. set -euo pipefail +shopt -s inherit_errexit BP_NAME=${1:-"heroku/python"}