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-12: Remnant symlinks in /usr/local pointing to macOS frameworks #9497

Closed
2 of 13 tasks
bscottm opened this issue Mar 12, 2024 · 2 comments
Closed
2 of 13 tasks

macos-12: Remnant symlinks in /usr/local pointing to macOS frameworks #9497

bscottm opened this issue Mar 12, 2024 · 2 comments

Comments

@bscottm
Copy link

bscottm commented Mar 12, 2024

Description

brew update on macOS should succeed and should not find remnant symlinks in /usr/local pointing back to macOS frameworks.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Image: macos-12
Version: 20240218.1
Included Software: https://github.com/actions/runner-images/blob/macOS-12/20240218.1/images/macos/macos-12-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20240218.1

Link to build: https://github.com/bscottm/open-simh/actions/runs/8251807984

Is it regression?

Yes. Image: macos-12 Version: 20240218.1 (weirdly, same version, different build date), link: https://github.com/bscottm/open-simh/actions/runs/8183410587

Expected behavior

brew update should succeed and special steps to clear remnant /usr/local symlinks should not be necessary in workflow steps.

Actual behavior

Workflow executes a brew update and installs additional packages (pcre, SDL2 and others.) During the brew update, Python upgrades to 3.12, but fails because there are remnant symlinks in /usr/local. There should be no remnant symlinks in /usr/local pointing to macOS frameworks. Extract from the log:

2024-03-12T15:50:53.4987360Z ==> Pouring python@3.12--3.12.2_1.monterey.bottle.tar.gz
2024-03-12T15:51:00.4937910Z Error: The `brew link` step did not complete successfully
2024-03-12T15:51:00.4938780Z The formula built, but is not symlinked into /usr/local
2024-03-12T15:51:00.4942560Z Could not symlink bin/2to3
2024-03-12T15:51:00.4943450Z Target /usr/local/bin/2to3
2024-03-12T15:51:00.4944180Z already exists. You may want to remove it:
2024-03-12T15:51:00.4945480Z   rm '/usr/local/bin/2to3'
2024-03-12T15:51:00.4946600Z 
2024-03-12T15:51:00.4947680Z To force the link and overwrite all conflicting files:
2024-03-12T15:51:00.4950150Z   brew link --overwrite python@3.12
2024-03-12T15:51:00.4950790Z 
2024-03-12T15:51:00.4951980Z To list all files that would be deleted:
2024-03-12T15:51:00.4952770Z   brew link --overwrite python@3.12 --dry-run
2024-03-12T15:51:00.4953180Z 
2024-03-12T15:51:00.4953340Z Possible conflicting files are:
2024-03-12T15:51:00.4954720Z /usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/2to3
2024-03-12T15:51:00.4958660Z /usr/local/bin/2to3-3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/2to3-3.12
2024-03-12T15:51:00.4961130Z /usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/idle3
2024-03-12T15:51:00.4963900Z /usr/local/bin/idle3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/idle3.12
2024-03-12T15:51:00.4965790Z /usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/pydoc3
2024-03-12T15:51:00.4967150Z /usr/local/bin/pydoc3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/pydoc3.12
2024-03-12T15:51:00.4969700Z /usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
2024-03-12T15:51:00.4972590Z /usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3-config
2024-03-12T15:51:00.4975440Z /usr/local/bin/python3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
2024-03-12T15:51:00.4977070Z /usr/local/bin/python3.12-config -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12-config
2024-03-12T15:51:00.4980730Z /usr/local/share/man/man1/python3.1 -> /usr/local/Cellar/python@3.11/3.11.7_1/share/man/man1/python3.1
2024-03-12T15:51:00.4991910Z /usr/local/lib/pkgconfig/python3-embed.pc -> /usr/local/Cellar/python@3.11/3.11.7_1/lib/pkgconfig/python3-embed.pc
2024-03-12T15:51:00.4995100Z /usr/local/lib/pkgconfig/python3.pc -> /usr/local/Cellar/python@3.11/3.11.7_1/lib/pkgconfig/python3.pc
2024-03-12T15:51:00.5001170Z /usr/local/Frameworks/Python.framework/Headers -> /usr/local/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Headers
2024-03-12T15:51:00.5004350Z /usr/local/Frameworks/Python.framework/Python -> /usr/local/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Python
2024-03-12T15:51:00.5008290Z /usr/local/Frameworks/Python.framework/Resources -> /usr/local/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Resources
2024-03-12T15:51:00.5013180Z /usr/local/Frameworks/Python.framework/Versions/Current -> /usr/local/Cellar/python@3.11/3.11.7_1/Frameworks/Python.framework/Versions/Current
2024-03-12T15:51:02.6557430Z ==>/usr/local/Cellar/python@3.12/3.12.2_1/bin/python3.12 -Im ensurepip
2024-03-12T15:51:07.7350290Z ==>/usr/local/Cellar/python@3.12/3.12.2_1/bin/python3.12 -Im pip install -v --n

Repro steps

Here is a simplified workflow file that can reproduce the issue:

name: Build

on:
  pull_request:

defaults:
  run:
    shell: bash

jobs:
  makefile:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-12]
        simulators:
    steps:
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: |
            brew update
            brew install pkg-config
            brew install pcre libpng libedit
            brew install sdl2 freetype2 sdl2_ttf
            brew install vde
            brew install cmake gnu-getopt coreutils
@mikhailkoliada
Copy link
Contributor

Marking as duplicate of #9471

@bscottm
Copy link
Author

bscottm commented Mar 12, 2024

Executing brew unlink followed by brew link --overwrite is a losing proposition. One actually has to remove the offending symlinks manually:

run: |
          for f in $(find /usr/local/bin -type l -print); do \
            (readlink $f | grep -q -s "/Library") && echo Removing "$f" && rm -f "$f"; \
          done || exit 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants