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

Issue with brew #4020

Closed
2 of 8 tasks
arttet opened this issue Sep 6, 2021 · 14 comments
Closed
2 of 8 tasks

Issue with brew #4020

arttet opened this issue Sep 6, 2021 · 14 comments
Assignees
Labels
awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working OS: macOS

Comments

@arttet
Copy link

arttet commented Sep 6, 2021

Description

When I use brew install cppcheck cpplint include-what-you-use, I get the error:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

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

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

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/2.7/bin/2to3

This issue has emerged recently. That command worked well one week ago.

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

  Environment: macos-11
  Version: 20210831.3
  Included Software: https://github.com/actions/virtual-environments/blob/macOS-11/20210831.3/images/macos/macos-11-Readme.md
  Image Release: https://github.com/actions/virtual-environments/releases/tag/macOS-11%2F20210831.3

Is it regression?

https://github.com/actions/virtual-environments/releases/tag/macOS-10.15%2F20210814.1

Expected behavior

OK

Actual behavior

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

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

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

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/2.7/bin/2to3

Repro steps

  1. brew install cppcheck cpplint include-what-you-use
@al-cheb al-cheb added investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS and removed needs triage labels Sep 6, 2021
@al-cheb
Copy link
Contributor

al-cheb commented Sep 6, 2021

Hello, @arttet
I couldn't reproduce the issue from my side. Or it failed when brew update&brew upgrade commands present(in that case you should run rm -rf /usr/local/bin/2to3 command before brew upgrade)?

macOS-10.15:
image

macOS-11:
image

@lordgamez
Copy link

I get the same issue if I want to manually install python on macos-10.15 with the command brew install python

Previously I did not need to install python as it should be present on the host machine, but today all the macos-10.15 builds started failing with the following (maybe it is connected to this issue):

-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "3.5")
CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
  (Required is at least version "3.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  extensions/script/CMakeLists.txt:37 (find_package)


-- Configuring incomplete, errors occurred!

@traversaro
Copy link

Example of a minimum action that reproduces the problem: https://github.com/traversaro/github-actions-brew-update-upgrade-check/actions/runs/1204436581 .

@arttet
Copy link
Author

arttet commented Sep 6, 2021

It is my simple example to reproduce the bug.

@mikhailkoliada
Copy link
Contributor

It happens due to python3.9.6 -> python3.9.7 upgrade

@mikhailkoliada
Copy link
Contributor

We have found the root cause of this problem. Newly-generated images will make the problem gone (as updated images include an updated python version and no conflicts will happen). We are going to fix the problem until the next python release.

@fredemmott
Copy link

Also saw this, appears resolved by 20210905.2 image

@miketimofeev miketimofeev added bug Something isn't working and removed investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels Sep 8, 2021
@miketimofeev miketimofeev added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Sep 15, 2021
@mikhailkoliada
Copy link
Contributor

All the images have been updated by now.

@joshua-auchincloss
Copy link

Looks like this issue regressed - the dependency chain that errs is as follows:

  • 2to3
  • idle3
  • pydoc3
  • python3
    ... stopped adding rm ... past here.

E.g. outputs:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/python3
Target /usr/local/bin/python3
already exists. You may want to remove it:
  rm '/usr/local/bin/python3'

@larseggert
Copy link

This has recently (yesterday?) started happening on the macos-13 runner. The new macos-14 works (for now?), FWIW.

@FirePing32
Copy link

FirePing32 commented Feb 26, 2024

Still persists on macos-12 and macos-13. Resolved on macos-14.
@mikhailkoliada any plans of fixing these images ?

@Mukul1127
Copy link

Mukul1127 commented Feb 29, 2024

It seems this is fixed on macos-14 because it just overwrote it

==> Installing python@3.12
==> Pouring python@3.12--3.12.2_1.arm64_sonoma.bottle.tar.gz
Warning: These files were overwritten during the `brew link` step:
/opt/homebrew/bin/2to3
/opt/homebrew/bin/idle3
/opt/homebrew/bin/pydoc3
/opt/homebrew/bin/python3
/opt/homebrew/bin/python3-config
/opt/homebrew/share/man/man1/python3.1
/opt/homebrew/lib/pkgconfig/python3-embed.pc
/opt/homebrew/lib/pkgconfig/python3.pc
/opt/homebrew/Frameworks/Python.framework/Headers
/opt/homebrew/Frameworks/Python.framework/Python
/opt/homebrew/Frameworks/Python.framework/Resources
/opt/homebrew/Frameworks/Python.framework/Versions/Current
They have been backed up to: /Users/runner/Library/Caches/Homebrew/Backup
==> /opt/homebrew/Cellar/python@3.12/3.12.2_1/bin/python3.12 -Im ensurepip
==> /opt/homebrew/Cellar/python@3.12/3.12.2_1/bin/python3.12 -Im pip install -v 
==> Summary
🍺  /opt/homebrew/Cellar/python@3.12/3.12.2_1: 3,239 files, 65.5MB

@kchawla-linus
Copy link

Looks like this issue regressed - the dependency chain that errs is as follows:

  • 2to3
  • idle3
  • pydoc3
  • python3
    ... stopped adding rm ... past here.

E.g. outputs:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/python3
Target /usr/local/bin/python3
already exists. You may want to remove it:
  rm '/usr/local/bin/python3'

I encountered this issue as well, when running brew install imagemagick via fastlane using macos-13 runner.
It tries to install `imagemagick 7.1.1-29_1 but fails when trying to pour the python bottle -

Pouring python@3.12--3.12.2_1.ventura.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
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

Switching to the macos-14 runner somehow is installing an older version of imagemagick which skips installing python altogether.

Run brew install imagemagick
==> Downloading https://ghcr.io/v2/homebrew/core/imagemagick/manifests/7.1.1-26
==> Fetching dependencies for imagemagick: jbig2dec, libidn, openjpeg, ghostscript, highway, imath, openexr, webp, jpeg-xl, libvmaf, aom, libde265, shared-mime-info, x265, libheif, liblqr, jasper, libomp, libraw, m4 and libtool
==> Downloading https://ghcr.io/v2/homebrew/core/jbig2dec/manifests/0.20
...
🍺  /opt/homebrew/Cellar/libtool/2.4.7: 75 files, 3.8MB
==> Installing imagemagick
==> Pouring imagemagick--7.1.1-26.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/imagemagick/7.1.1-26: 809 files, 31.3MB

kduske added a commit to TrenchBroom/TrenchBroom that referenced this issue Mar 19, 2024
Due to a problem in the macos-13 runner image, installing python 3 via
brew fails with a symlink error. This is a workaround to delete the
symlinks before installing python 3.

See actions/runner-images#4020
kduske added a commit to TrenchBroom/TrenchBroom that referenced this issue Mar 19, 2024
Due to a problem in the macos-13 runner image, installing python 3 via
brew fails with a symlink error. This is a workaround to delete the
symlinks before installing python 3.

See actions/runner-images#4020
humblepenguinn added a commit to envio-cli/envio that referenced this issue Mar 23, 2024
Currently there seems to be a issue with the macos-12 runner image when using brew. See [issue 4020](actions/runner-images#4020) for more information.

So for now, support for the x86 architecture is on hold until
the problem is resolved or a alternative is found

macOS user's can now only use envio on the apple silicon chips.
@alteredtech
Copy link

alteredtech commented Jun 14, 2024

Started having this issue just two hours apart from each other. Currently only happens on macos-13 runner. No changes were made to the actions. Only change was a typo in documentation.

Successful

Current runner version: '2.317.0'
Operating System
Runner Image
  Image: macos-13
  Version: 20240609.1
  Included Software: https://github.com/actions/runner-images/blob/macos-13/20240609.1/images/macos/macos-13-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20240609.1
Installing dependencies for repo/internal-tap/toolstools: libgit2, z3, llvm, rust, mozjpeg, libxml2, libxslt and openjpeg
==> Installing repo/internal-tap/tools dependency: libgit2
==> Downloading https://ghcr.io/v2/homebrew/core/libgit2/manifests/1.7.2
Already downloaded: /Users/runner/Library/Caches/Homebrew/downloads/9671856ced457ee95383408b4c243c7f196b6f204228b11a53735a8a561e2abb--libgit2-1.7.2.bottle_manifest.json
==> Pouring libgit2--1.7.2.ventura.bottle.tar.gz
🍺  /usr/local/Cellar/libgit2/1.7.2: 105 files, 4.5MB

Failed

Current runner version: '2.317.0'
Operating System
Runner Image
  Image: macos-13
  Version: 20240609.1
  Included Software: https://github.com/actions/runner-images/blob/macos-13/20240609.1/images/macos/macos-13-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20240609.1
Installing dependencies for repo/internal-tap/tools: python@3.12, libgit2, z3, llvm, rust, mozjpeg, libxml2, libxslt and openjpeg
==> Installing repo/internal-tap/tools dependency: python@3.12
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.12/manifests/3.12.4
Already downloaded: /Users/runner/Library/Caches/Homebrew/downloads/2970a992f26f411cf71250ce54eb24411d8b065824b51819da7085559f09ce66--python@3.12-3.12.4.bottle_manifest.json
==> Pouring python@3.12--3.12.4.ventura.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Error: The `brew link` step did not complete successfully
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'
To force the link and overwrite all conflicting files:
  brew link --overwrite python@3.12
To list all files that would be deleted:
  brew link --overwrite python@3.12 --dry-run
Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/2to3
/usr/local/bin/2to3-3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/2to3-3.12
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/idle3
/usr/local/bin/idle3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/idle3.12
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/pydoc3
/usr/local/bin/pydoc3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/pydoc3.12
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3-config
/usr/local/bin/python3.12 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
/usr/local/bin/python3.12-config -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12-config
==> /usr/local/Cellar/python@3.12/3.12.4/bin/python3.12 -Im ensurepip
==> /usr/local/Cellar/python@3.12/3.12.4/bin/python3.12 -Im pip install -v --no-
==> Summary
🍺  /usr/local/Cellar/python@3.12/3.12.4: 3,277 files, 63.9MB

The only difference I have found between the 3 images is macos-12 uses homebrew 4.3.2, macos-13 uses homebrew 4.3.3, and macos-14 uses homebrew 4.3.5.

Not how that would cause it to succeed once and then fail but something I noticed.

tautschnig added a commit to tautschnig/cbmc that referenced this issue Jun 17, 2024
GitHub images already have maven installed, and upgrading to the latest
version of maven via brew results in symlink conflicts of the python
3.12 dependency (earlier reported in
  actions/runner-images#4020).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working OS: macOS
Projects
None yet
Development

No branches or pull requests