asdf-python icon indicating copy to clipboard operation
asdf-python copied to clipboard

M1 Rosetta build fails Python 3.9.10

Open han-so1omon opened this issue 2 years ago • 3 comments

I am using MacOS Monterey with M1 chip. I've opened a rosetta terminal by switching architectures using the following command:

$ arch -x86_64 /bin/zsh

Then, I try to install python:


$ asdf install python 3.9.10

python-build --patch 3.9.10 /Users/errc/.asdf/installs/python/3.9.10
with patch file from: https://github.com/python/cpython/commit/8ea6353.patch?full_index=1
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.10.tar.xz...
-> https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tar.xz
Installing Python-3.9.10...
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 12.1 using python-build 2.2.4-1-1-g7ea04089)

Inspect or clean up the working tree at /var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097
Results logged to /var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097.log

Last 10 log lines:
/var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097 /Users/Shared/v/asdf/arch
warning: xz not found; consider installing `xz` package
/var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097/Python-3.9.10 /var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097 /Users/Shared/v/asdf/arch

I even try with the patch:

$ export ASDF_PYTHON_PATCH_URL="https://github.com/python/cpython/commit/8ea6353.patch?full_index=1"
$ asdf install python 3.9.10

# Same error

Any idea why this is failing? Install/build works under the default arm64 architecture

han-so1omon avatar Feb 02 '22 21:02 han-so1omon

Maybe missing a package dependency.

warning: xz not found; consider installing `xz` package

BrutalSimplicity avatar Mar 31 '22 06:03 BrutalSimplicity

I am using MacOS Monterey with M1 chip. I've opened a rosetta terminal by switching architectures using the following command:

$ arch -x86_64 /bin/zsh

Then, I try to install python:


$ asdf install python 3.9.10

python-build --patch 3.9.10 /Users/errc/.asdf/installs/python/3.9.10
with patch file from: https://github.com/python/cpython/commit/8ea6353.patch?full_index=1
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.10.tar.xz...
-> https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tar.xz
Installing Python-3.9.10...
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 12.1 using python-build 2.2.4-1-1-g7ea04089)

Inspect or clean up the working tree at /var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097
Results logged to /var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097.log

Last 10 log lines:
/var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097 /Users/Shared/v/asdf/arch
warning: xz not found; consider installing `xz` package
/var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097/Python-3.9.10 /var/folders/sz/pgt1clhs4sl3zw_qtl_3jjbh0000gn/T/python-build.20220202150238.51097 /Users/Shared/v/asdf/arch

I even try with the patch:

$ export ASDF_PYTHON_PATCH_URL="https://github.com/python/cpython/commit/8ea6353.patch?full_index=1"
$ asdf install python 3.9.10

# Same error

Any idea why this is failing? Install/build works under the default arm64 architecture

Make sure you have all dependencies installed

https://github.com/pyenv/pyenv/wiki#suggested-build-environment

luanmateuz avatar Jul 25 '22 02:07 luanmateuz

I used arch -arm64 pyenv install 2.7.18 to install the failing version.

it may help you with version 3.x as well

to make it asdf native like, I copied the shims from pyenv to asdf

 cp -r /Users/me/.pyenv/shims/* /Users/me/.asdf/shims/

ionutale avatar Oct 08 '22 18:10 ionutale