asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

Python 3.9, 3.10 fail to install in macOS Big Sur #125

Closed tuan-ff closed 2 years ago

tuan-ff commented 2 years ago

I'm on macOS 11.3.1. Installing Python 3.9 and 3.10 with ASDF results in error like the following

Installing Python-3.10.1...
patching file Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
patching file configure
Hunk #1 FAILED at 3426.
1 out of 1 hunk FAILED -- saving rejects to file configure.rej
patching file configure.ac
Hunk #1 FAILED at 510.
1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rejInstalling python 3.10.1
python-build --patch 3.10.1 /Users/tuannguyen/.asdf/installs/python/3.10.1
with patch file from: https://github.com/python/cpython/commit/8ea6353.patch?full_index=1
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.10.1.tar.xz...
-> https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tar.xz
Installing Python-3.10.1...
patching file Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
patching file configure
Hunk #1 FAILED at 3426.
1 out of 1 hunk FAILED -- saving rejects to file configure.rej
patching file configure.ac
Hunk #1 FAILED at 510.
1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rej

BUILD FAILED (OS X 11.3.1 using python-build 2.2.3-1-g423de9ae)

This error is caused by the patch originally intended to fix issues installing Python 3.8 and earlier in macOS, but the issue seems to have been resolved in Python >=3.9 and so the targeted files for the patch no longer exist. See https://github.com/python/cpython/tree/3.8/Misc/NEWS.d/next/macOS and compare with 3.9 tag.

I believe the fix is simply to delete the patch.

Currently I'm able to get around this by ASDF_PYTHON_PATCH_URL="" asdf install python 3.10.1.

tuan-ff commented 2 years ago

This patch actually is implemented within our code base so I'm closing the issue.

Faheetah commented 2 years ago

I'm on head of master and still failing with this issue, what is the fix for this?

tuan-ff commented 2 years ago

If you're on python 3.7.8+, 3.8.4+, or 3.9.0+, then the patch ASDF_PYTHON_PATCH_URL="https://github.com/python/cpython/commit/8ea6353.patch?full_index=1" causes the Python install to fail. You can check to see if anything is setting ASDF_PYTHON_PATCH_URL in your env and remove it or set it to empty string.

Faheetah commented 2 years ago

I had ASDF_PYTHON_PATCH_URL in bashrc, that was it, thanks.