]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
github: Workaround for Python conflict in macOS image
authorTobias Brunner <tobias@strongswan.org>
Fri, 6 Jan 2023 13:17:29 +0000 (14:17 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 6 Jan 2023 14:31:03 +0000 (15:31 +0100)
The Python versions installed in the system image in
`/Library/Frameworks/Python.framework/` have symlinks in `/usr/local/bin/`
that conflict with symlinks that `brew` tries to create, which causes
errors like these:

    ==> Pouring python@3.11--3.11.1.monterey.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/2to3-3.11
    Target /usr/local/bin/2to3-3.11
    already exists. You may want to remove it:
      rm '/usr/local/bin/2to3-3.11'

    To force the link and overwrite all conflicting files:
      brew link --overwrite python@3.11

    To list all files that would be deleted:
      brew link --overwrite --dry-run python@3.11

    Possible conflicting files are:
    /usr/local/bin/2to3-3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/2to3-3.11
    /usr/local/bin/idle3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/idle3.11
    /usr/local/bin/pydoc3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/pydoc3.11
    /usr/local/bin/python3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
    /usr/local/bin/python3.11-config -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11-config

.github/workflows/macos.yml

index a97c8004069f6fce6d8f735aad815cd0dc5f6fed..dc344a36cec8240b1ffc5d68f7b5c0e262bd3b20 100644 (file)
@@ -35,6 +35,8 @@ jobs:
           key: ccache-${{ runner.os }}-${{ github.sha }}
           restore-keys: |
             ccache-${{ runner.os }}-
+      # workaround for conflict between Python installed in the image and via brew
+      - run: find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete -print
       - run: |
           brew install ccache
           echo "PATH=$(brew --prefix)/opt/ccache/libexec:$PATH" >> $GITHUB_ENV