memo.xight.org

日々のメモ

python3.9.4 + pyenv + homebrew

Summary

% pyenv install 3.9.4
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.4.tar.xz...
-> https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
Installing Python-3.9.4...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 11.3 using python-build 1.2.26-9-g2924886a)

Inspect or clean up the working tree at /var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn
Results logged to /var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn.log

Last 10 log lines:
/var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn ~/Desktop
/var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn /Python-3.9.4 /var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn ~/Desktop
checking build system type... Invalid configuration `arm64-apple-darwin20.4.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.4.0 failed


config.subにpatch をあててインストール

timestamp='2018-04-24' のconfig.sub を timestamp='2021-01-08' に変更するパッチをあてる

% pyenv install --patch 3.9.4 <<(curl -sSL https://gist.githubusercontent.com/xight/a064b1fd82a4529eb6ebbde13d95ea8c/raw/8e75b31ea3e9d4b9376e976fa9626401ae217f6c/config.patch)
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.4.tar.xz...
-> https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
Installing Python-3.9.4...
patching file config.sub
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.4 to /Users/username/.anyenv/envs/pyenv/versions/3.9.4


Reference

GitHub Gist - xight/config-sub.patch (2018-04-24 -> 2021-01-08)
https://gist.github.com/xight/74f84b8bde9ac6f539c3db20c2897d46

GitHub Gist - xight/config.patch config.sub (2018-04-24 -> 2021-01-08), config.guess (2018-03-08 -> 2021-01-25)
https://gist.github.com/xight/a064b1fd82a4529eb6ebbde13d95ea8c