Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.9.1 bigsur #65793

Closed
wants to merge 3 commits into from
Closed

Conversation

jackbm633
Copy link

  • [*] Have you followed the guidelines for contributing?

  • [*] Have you checked that there aren't other open pull requests for the same formula update/change?

  • [*] Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?

  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting? - Having some issues with this - says I need to have latest python 3.9 version.

  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)? - Yes, once the Python 3.9.1 upstream version is released


Hi everyone - this is my first contribution to Homebrew so please forgive me if I make any mistakes along the way. I've been in the process of testing Brew packages on my M1 MacBook Pro, and Python 3.9 currently doesn't work. 3.9.1 is going to be the first version of Python that will support M1 out of the box, but changing the existing formula to the 3.9.1 RC doesn't work
because Python expects a MacOS version number 10.x whereas Big Sur reports 11.x. Therefore, I have set the environment variable SYSTEM_VERSION_COMPAT to 1 and then got the version of macOS using sw_vers, which will report 10.16: Python is happy with that. This avoids the following error, which I get with both 3.9.0 and 3.9.1:

Last 15 lines from /Users/jbeckitt/Library/Logs/Homebrew/python@3.9/02.make:
    self.run_command(cmd_name)
  File "/private/tmp/python@3.9-20201127-62347-16hz8ht/Python-3.9.1rc1/Lib/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/private/tmp/python@3.9-20201127-62347-16hz8ht/Python-3.9.1rc1/Lib/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/private/tmp/python@3.9-20201127-62347-16hz8ht/Python-3.9.1rc1/Lib/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/private/tmp/python@3.9-20201127-62347-16hz8ht/Python-3.9.1rc1/./setup.py", line 447, in build_extensions
    self.detect_modules()
  File "/private/tmp/python@3.9-20201127-62347-16hz8ht/Python-3.9.1rc1/./setup.py", line 1784, in detect_modules
    self.detect_readline_curses()
  File "/private/tmp/python@3.9-20201127-62347-16hz8ht/Python-3.9.1rc1/./setup.py", line 1015, in detect_readline_curses
    (tuple(int(n) for n in dep_target.split('.')[0:2])
AttributeError: 'int' object has no attribute 'split'

@fxcoudert
Copy link
Member

sw_vers, which will report 10.16

No, that's not what happens for me on macOS 11.1, and that would be a bug if it did.

Python expects a MacOS version number 10.x whereas Big Sur reports 11.x

That needs to be reported and fixed, not hacked by pretending we're on another version. Also: so far we haven't seen a problem with that, so far.

sha256 "9ad938e5803a6c8ce6fb183f479968cadc1d6b6cb75dd7a11d4761c5e3635131" => :big_sur
sha256 "a39639719e49bf3631ef41705267eae5ae06b78aebc0e8c3ffd9fdb91e75d56c" => :catalina
sha256 "4462c76fea0dc7abb9ea959d82594aa0b10191f5bc3e43d8d44131a05bee3950" => :mojave
sha256 "bd4ebe03f4c8371c87b2e2db46d5a8ebe0d3f2940f64d8228b901048f1dd9290" => :big_sur
Copy link
Member

Choose a reason for hiding this comment

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

Do not alter bottle blocks

@@ -305,9 +305,9 @@ def sitecustomize
# site_packages; prefer the shorter paths
long_prefix = re.compile(r'#{rack}/[0-9\._abrc]+/Frameworks/Python\.framework/Versions/#{xy}/lib/python#{xy}/site-packages')
sys.path = [long_prefix.sub('#{HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"}', p) for p in sys.path]
# Set the sys.executable to use the opt_prefix. Only do this if PYTHONEXECUTABLE is not
Copy link
Member

Choose a reason for hiding this comment

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

Do not alter this

@@ -321,20 +321,16 @@ def caveats
<<~EOS
Python has been installed as
#{HOMEBREW_PREFIX}/bin/python3

Copy link
Member

Choose a reason for hiding this comment

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

Do not alter whitespace

@jackbm633
Copy link
Author

Okay @fxcoudert , I see what you mean. So is it an issue on my end do you reckon - something wrong with my system configuration?

@fxcoudert
Copy link
Member

So is it an issue on my end do you reckon - something wrong with my system configuration?

I don't know, that's why it would be good to test so it can get fixed before an actual release

@jackbm633
Copy link
Author

So is it an issue on my end do you reckon - something wrong with my system configuration?

I don't know, that's why it would be good to test so it can get fixed before an actual release

Just completely removed Homebrew from my system and trying with a clean installation 👍 - I will report back with results!

@jackbm633
Copy link
Author

I'm closing this - it definitely is an issue on my end 😨. My brother who owns an M1 Mac mini compiled 3.9.0 fine with the default formula.

/sparkle Thanks @fxcoudert for your help - I'll continue with the testing effort on M1!

@jackbm633 jackbm633 closed this Nov 27, 2020
@jackbm633 jackbm633 deleted the python-3.9.1-bigsur branch November 27, 2020 16:46
@abarisain
Copy link

abarisain commented Nov 27, 2020

FYI I ran into this issue today after wiping my Mac, and I didn't before.

I ran 11.1 beta when it was successful, and 11.0.1 when it failed.
By editing the formula and setting "MACOSX_DEPLOYMENT_TARGET=11.1", 11.0, 11.0.1 or 11.1.0, the formula works.
As soon as I set it back to #{MacOS.version}, boom, it breaks since it's "11"

I haven't looked into it more, not sure what the root cause is. Probably an upstream issue that homebrew might not want to fix.
Or we could special case 11.0 as the problem goes away with 11.1?

@nisanthchunduru
Copy link

nisanthchunduru commented Dec 1, 2020

Just sharing in case it helps anyone. After googling a bit, I was able to resolve the problem mentioned in the issue description by installing the XCode command line tools, updating Homebrew and then upgrading to the latest python@3.9 package

xcode-select --install
brew update
brew upgrade python@3.9

I'm not entirely sure why installed XCode command line tools resolved the problem. I'm just sharing in case it helps anyone.

@fxcoudert
Copy link
Member

@nisanth074 @abarisain the issue is a python problem, reported in python/cpython#23556
I proposed a fix to the Python project, and we'll be including it in the next update, under testing now: https://github.com/Homebrew/homebrew-core/pull/65953/files

@Fingel
Copy link

Fingel commented Dec 1, 2020

Oddly, Ive been getting the following error since the patch was merged when trying to build any wheel:

File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/spawn.py", line 66, in spawn
        if _cfg_target_split > [int(x) for x in cur_target.split('.')]:
    AttributeError: 'int' object has no attribute 'split'

Is this unrelated? Maybe the same bug manifesting in distutils or something?

EDIT for anyone that finds this:

I was able to work around the wheel failing to build by setting the MACOSX_DEPLOYMENT_TARGET env var to '11.0', for example

MACOSX_DEPLOYMENT_TARGET='11.0' pip install MarkupSafe

Hopefully this is fixed upstream or wherever so this isn't something to worry about.

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 1, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants