Skip to content

Commit

Permalink
fix(dev): Install Python 3.6.x with --patch on Big Sur
Browse files Browse the repository at this point in the history
Fixes regression introduced in #29058.

On Big Sur, we cannot install Python 3.6.x without patching the source code first.
  • Loading branch information
armenzg committed Oct 7, 2021
1 parent 394cc10 commit 4f82a7c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/pyenv_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ install_pyenv() {
exit 1
fi

if query-apple-m1; then
pyenv install --skip-existing "${PYENV_VERSION}"
elif query-big-sur && [ "${PYENV_VERSION}" = 3.6.10 ]; then
# TODO(joshuarli): Can be removed when 3.6 is removed.
curl -sSL https://github.com/python/cpython/commit/8ea6353.patch | \
cat | \
pyenv install --skip-existing --patch "${PYENV_VERSION}"
# I'm assuming that SENTRY_PYTHON_VERSION won't be used to specify a 3.6 version to simplify the condition
# When a user sets a SENTRY_PYTHON_VERSION they intend to use a non-default version that I assume
# is newer, thus, can install with the non-source-patched default pyenv install command
if query-big-sur && [[ -z "${SENTRY_PYTHON_VERSION:-}" ]]; then
# For Python 3.6.x, we need to patch the source code on Big Sur before building Python
# We can remove this once we upgrade to newer versions of Python
# cat is used since pyenv would finish to soon when the Python version is already installed
curl -sSL https://github.com/python/cpython/commit/8ea6353.patch | cat |
pyenv install --skip-existing --patch "${PYENV_VERSION}"
else
pyenv install --skip-existing "${PYENV_VERSION}"
fi
Expand Down

0 comments on commit 4f82a7c

Please sign in to comment.