Skip to content

build(feat): Support pyenv/Python installation on Big Sur#22257

Merged
armenzg merged 1 commit intomasterfrom
big_sur_pyenv
Dec 11, 2020
Merged

build(feat): Support pyenv/Python installation on Big Sur#22257
armenzg merged 1 commit intomasterfrom
big_sur_pyenv

Conversation

@armenzg
Copy link
Copy Markdown
Member

@armenzg armenzg commented Nov 24, 2020

Installing Python via pyenv on Big Sur for older Python versions requires:

Once a new release of pyenv is released and we use a newer Python 3 version
we will not need all these hacks and all Mac versions will be able to use
the same code paths.

Fixes #22497

@armenzg armenzg self-assigned this Dec 9, 2020
@armenzg armenzg marked this pull request as ready for review December 9, 2020 20:30
@armenzg armenzg requested a review from a team as a code owner December 9, 2020 20:30
@armenzg armenzg added the Component: Developer Environment This covers issues related to setting up a developer's environment label Dec 9, 2020
@armenzg armenzg requested a review from joshuarli December 9, 2020 20:43
@joshuarli
Copy link
Copy Markdown
Member

I'll try this out tonight.

Installing Python via pyenv on Big Sur for older Python versions requires:
* Setting LDFLAGS for zlib (pyenv/pyenv#1711)
* Patching the source code

Once a new release of pyenv is released and we use a newer Python 3 version
we will not need all these hacks and all Mac versions will be able to use
the same code paths.

Fixes #22497
@armenzg
Copy link
Copy Markdown
Member Author

armenzg commented Dec 11, 2020

@joshuarli Hi Josh, please let me know if you will be able to give it a try or if I should ask for another person that has Big Sur already installed. Thanks!

@joshuarli
Copy link
Copy Markdown
Member

joshuarli commented Dec 11, 2020

Okay, removing my 3.6.10 and starting out with a slightly outdated pyenv (pyenv@943015ebb2ee2ec3b249e1177d8b8531d0ee3960) on Big Sur. However, it does include the proper zlib ldflags patch.

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

BUILD FAILED (OS X 11.0.1 using python-build 1.2.21-1-g943015eb)

Inspect or clean up the working tree at /var/folders/09/m6yjxzfj5s1gyt1_vkwhy6ch0000gn/T/python-build.20201211115124.4300
Results logged to /var/folders/09/m6yjxzfj5s1gyt1_vkwhy6ch0000gn/T/python-build.20201211115124.4300.log

Last 10 log lines:
                   ^
./Modules/posixmodule.c:8130:12: note: forward declaration of 'struct sf_hdtr'
    struct sf_hdtr sf;
           ^
./Modules/posixmodule.c:8210:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = sendfile(in, out, offset, &sbytes, &sf, flags);
              ^
2 errors generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....

Tried make setup-pyenv, same failure.

Edit: never mind, I forgot to checkout the branch, haha. I see python's configure stuff being patched and it works!

Copy link
Copy Markdown
Member

@joshuarli joshuarli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks for taking care of this. You have my blessing.

I expect we can only totally remove all this once Sentry's on 3.8, I have no problems compiling 3.8.6 OOTB.

@armenzg armenzg merged commit 34afba4 into master Dec 11, 2020
@armenzg armenzg deleted the big_sur_pyenv branch December 11, 2020 20:51
@armenzg
Copy link
Copy Markdown
Member Author

armenzg commented Dec 11, 2020

Thank you Josh for testing this out!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Component: Developer Environment This covers issues related to setting up a developer's environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document and fix Python installation problems on Big Sur

2 participants