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

macOS python.org installers only add or modify framework Versions/Current symlink for Python 2.x installs, not Python 3.x #82510

Closed
KevinPackard mannequin opened this issue Sep 30, 2019 · 4 comments
Assignees
Labels
3.9 only security fixes OS-mac topic-installation type-bug An unexpected behavior, bug, or error

Comments

@KevinPackard
Copy link
Mannequin

KevinPackard mannequin commented Sep 30, 2019

BPO 38329
Nosy @ronaldoussoren, @ned-deily
PRs
  • bpo-38329: python.org macOS installers now update Current symlink #19650
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ned-deily'
    closed_at = <Date 2020-04-22.08:33:10.583>
    created_at = <Date 2019-09-30.19:37:04.712>
    labels = ['OS-mac', 'type-bug', 'expert-installation', '3.9']
    title = 'macOS python.org installers only add or modify framework Versions/Current symlink for Python 2.x installs, not Python 3.x'
    updated_at = <Date 2020-04-22.08:33:10.582>
    user = 'https://bugs.python.org/KevinPackard'

    bugs.python.org fields:

    activity = <Date 2020-04-22.08:33:10.582>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2020-04-22.08:33:10.583>
    closer = 'ned.deily'
    components = ['Installation', 'macOS']
    creation = <Date 2019-09-30.19:37:04.712>
    creator = 'KevinPackard'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38329
    keywords = ['patch']
    message_count = 4.0
    messages = ['353612', '353632', '366993', '366994']
    nosy_count = 3.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'KevinPackard']
    pr_nums = ['19650']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38329'
    versions = ['Python 3.9']

    @KevinPackard
    Copy link
    Mannequin Author

    KevinPackard mannequin commented Sep 30, 2019

    The macOS installer for Python 3.7.4 places "Python.framework" into /Library/Frameworks/ However, the top-level symlinks inside the framework are broken for "Headers" and "Resources". Because of this, the framework can not be imported into an Xcode project.

    @KevinPackard KevinPackard mannequin added 3.7 (EOL) end of life OS-mac type-bug An unexpected behavior, bug, or error labels Sep 30, 2019
    @ned-deily
    Copy link
    Member

    Thanks for the reminder. Unfortunately, the macOS installer is working as designed. As discussed at length in bpo-18117 (and elsewhere), building using the -framework Python, either directly in compiler calls or indirectly through Xcode is problematic because python.org Python installers install all versions, 2.x and 3.x, into the same framework location, /Library/Frameworks/Python.framework. Since it was common especially in the early days of Python 3 to install both Python 2 and Python 3, the decision was made to only have Python 2.x installs add or modify the Current symlink. As also noted, it was probably a mistake back then to not install Python 3.x versions to a differently-names framework so you can be sure whether you are attempting to link with Python 2 or Python 3 but that ship has sailed. However now that Python 2 is about to enter end-of-life, we should reconsider that behavior.

    In the meantime, there should be a simple workaround: just create the symlink yourself after installing a new Python 3.x version. So something like:

    sudo sh
    umask 022
    cd /Library/Frameworks/Python.framework/Versions
    rm -f Current
    ln -s 3.7 Current
    exit

    @ned-deily ned-deily added 3.8 only security fixes 3.9 only security fixes labels Oct 1, 2019
    @ned-deily ned-deily changed the title Top level symlinks are broken in the Python 3.7.4 framework for macOS. macOS python.org installers only add or modify framework Versions/Current symlink for Python 2.x installs, not Python 3.x Oct 1, 2019
    @ned-deily ned-deily self-assigned this Oct 1, 2019
    @ned-deily
    Copy link
    Member

    New changeset bcc136b by Ned Deily in branch 'master':
    bpo-38329: python.org macOS installers now update Current symlink (GH-19650)
    bcc136b

    @ned-deily
    Copy link
    Member

    With Python 2 now officially retired, it's time to change the installer behavior. With the merged change, as of Python 3.9.0 (alpha 6) the python.org macOS installers will now update the Current version symmlink in the /Library/Frameworks Python being installed. Since this would be a change in behavior that could affect current users of Python 3.8.x or 3.7.x, I think we should not backport this to those versions. Thanks again for the report!

    @ned-deily ned-deily added topic-installation and removed 3.7 (EOL) end of life 3.8 only security fixes labels Apr 22, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes OS-mac topic-installation type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant