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: update upstream patch #66063

Closed
wants to merge 1 commit into from
Closed

Conversation

fxcoudert
Copy link
Member

Turns out there is another bug with MACOSX_DEPLOYMENT_TARGET being an integer in Python. Updating to the latest version of the upstream patch. This is bad, because it will hit all formulas based on Python, on Big Sur 11.0.1 (but not the 11.1 beta).

@fxcoudert
Copy link
Member Author

Testing now that Homebrew/brew#9373 is merged

@BracketMaster
Copy link

While this patch works for building Python itself, pip packages depending on
distutils will complain as follows:

I strongly suspect Python was simply unprepared from going from 10 to 11...

brew install python@3.9
pip3 install markupsafe
# trimmed
    File "/usr/local/lib/python3.9/site-packages/wheel/macosx_libfile.py", line 356, in calculate_macosx_platform_tag
      assert len(base_version) == 2
  AssertionError

@BracketMaster
Copy link

Currently looking at what is going on in: /usr/local/lib/python3.9/site-packages/wheel/macosx_libfile.py

@BracketMaster
Copy link

NVM, that is a wheel issue.

@BracketMaster
Copy link

Actually - it is a distutils problem as wheel imports distutils, and I believe I found the culprit:

/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_sysconfigdata__darwin_darwin.py

That file is automatically generated at build time and changing the buildconfig such that MACOSX_DEPLOYMENT_TARGET=10.0.1 seems to fix things.

@BracketMaster
Copy link

BracketMaster commented Dec 3, 2020

@fxcoudert
I figured it out!
The fix is actually very simple and you can remove your past two patches, and it still works.
simple change this line
to ``args << "MACOSX_DEPLOYMENT_TARGET=11.0.1"```

So that this works across different versions of MacOS, the complete solution would be:

if MacOS.version >= :big_sur
   args << "MACOSX_DEPLOYMENT_TARGET=11.0.1"
else
   args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}"
end

And that's it! Everything including pip just works that way.

For some reason, MacOs.verion simply evaluates to 11 in ruby for BigSur.
The fact that the base number is missing really confuses python and breaks
distutils with all sorts of badness.

@fxcoudert
Copy link
Member Author

Reminder to myself: when I merge this, I need to open yet another python update PR, this time to update wheel which was released in the meantime. 😢

@BrewTestBot
Copy link
Member

:shipit: @fxcoudert has triggered a merge.

@fxcoudert fxcoudert deleted the pyagain branch December 3, 2020 12:09
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 3, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 3, 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.

3 participants