You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
brew update followed by brew upgrade fails for Python's 2to3 conflict (December 2022) #11545
==> Upgrading python@3.10
3.10.8 -> 3.10.9
==> Pouring python@3.10--3.10.9.big_sur.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'
To force the link and overwrite all conflicting files:
brew link --overwrite python@3.10
To list all files that would be deleted:
brew link --overwrite --dry-run python@3.10
Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/2to3
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/idle3
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/pydoc3
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3-config
Reacted by Francesco Borzì, Ivan Gagis, Patrick Szczepański, complexlogic, Chris Thrasher, Dan Yeaw, Bart Louwers, Lukáš Zaoral, Agriya Khetarpal, charles and 2 more
Got the same issue, and find out that something similar we had previously. Now it looks like:
# homebrew fails to update python 3.9.1 to 3.9.1.1 due to unlinking failure
rm /usr/local/bin/2to3 ||true# homebrew fails to update python from 3.9 to 3.10 due to another unlinking failure
rm /usr/local/bin/idle3 ||true
rm /usr/local/bin/pydoc3 ||true
rm /usr/local/bin/python3 ||true
rm /usr/local/bin/python3-config ||true
@Flamefire the workflow does not use action/setup-python. It seems the links are created by the macos python package - i see them on the "almost" clean machine with the XCode installed.
@traversaro actully it is a normal behaviour. As you see from the log the installation continues normally with just a warning the links were not overwritten. The problem is brew upgrade exits with non-zero exit code and bash shell runs with set -e option. Thus the step signals the error condition despite brew upgrade is the very last command or not.
The easiest way to make the step to success is to add true after brew upgrade:
Hello Everyone, This behavior is expected. The installation proceeds normally with just a warning that the links were not overwritten, which is typical. The issue arises because the brew upgrade command exits with a non-zero exit code, and since the bash shell runs with the set -e option, it causes the step to fail even though brew upgrade is the final command.
Regarding the versions, Python 2.7, 3.10.8, and 3.11.0 symlinks are created during image generation. Specifically:
Python 2.7 is linked to macOS Library/Frameworks
Python 3.10 is linked to the Homebrew cellar
Python 3.11 is linked to macOS Library/Frameworks
The possible resolution of this issue would be updating the image with latest patches of Python 3.10 and Python 3.11. instead of 3.10.8 and 3.11.0. All macOS-12, 13, and 14 images have been updated with the latest patches for these versions, which resolved the issue.
Please let us know if any further assistance or clarification!
You seem to have fundamentally failed to understand the entire reason anyone is unhappy with GitHub Actions.
The behavior is detrimental and bad. We know that GitHub expects this to happen and we don't wish for further clarification.
We wish for GitHub to repent, to acknowledge that the expected behavior is detrimental and bad, and for GitHub to redesign the Actions image such that the Actions image works robustly, which it currently does not.
It is an antipattern to respond to an issue saying that some behavior is bad and causes troubles, by responding "we know it's bad and causes troubles, but that was intentional".
- name: Force update all brew python
run: |
brew update
# GHA messes with links https://github.com/actions/runner-images/issues/11545 so we just force replace their installs' with brew'sforpkgin$(brew list --formula | grep -E '^python(@[0-9]+\.[0-9]+)?$');do
brew upgrade --force --overwrite "$pkg"done
brew cleanup
Yes, this is a long-known configuration conflict. 😞 We have had several different incidents related to this topic. The work is currently underway within the framework of this task:
Activity
traversaro commentedon Dec 20, 2022
Possibly related to #6459 .
igorboskovic3 commentedon Dec 20, 2022
Hi @traversaro , thank you, we will take a look.
david-engelmann commentedon Dec 21, 2022
I'm observing this as well
ryancurrah commentedon Dec 21, 2022
Also observed this here https://github.com/ryancurrah/lima-and-qemu/actions/runs/3745432855/jobs/6359863993 and here https://github.com/mook-as/lima-and-qemu/actions/runs/3743467832/jobs/6356414606.
EDIT:
I was able to get it working by removing the existing symlinks.
mikhailkoliada commentedon Dec 21, 2022
It looks like it the universal python's package used in
actions/setup-pythonis installing its symlinks to /usr/local, while I think it should not.@marko-zivic-93 @dsame @dmitry-shibanov could you please take a look?
ni4 commentedon Dec 22, 2022
Got the same issue, and find out that something similar we had previously. Now it looks like:
Ignore errors of `brew update` in setup_ccache
Flamefire commentedon Dec 22, 2022
That is not the case for us and the OP:
There is seemingly a non-brew installed Python from somewhere else
dsame commentedon Dec 22, 2022
@Flamefire the workflow does not use
action/setup-python. It seems the links are created by the macos python package - i see them on the "almost" clean machine with the XCode installed.dsame commentedon Dec 22, 2022
@traversaro actully it is a normal behaviour. As you see from the log the installation continues normally with just a warning the links were not overwritten. The problem is
brew upgradeexits with non-zero exit code andbashshell runs withset -eoption. Thus the step signals the error condition despitebrew upgradeis the very last command or not.The easiest way to make the step to success is to add
trueafterbrew upgrade:Resolve dependencies intall break on macOS
Resolve dependencies intall break on macOS
121 remaining items
Fix continuous integration failure on macos
chore: add comment for the workaround
v-aparnajyothi-y commentedon Dec 4, 2024
Hello Everyone, This behavior is expected. The installation proceeds normally with just a warning that the links were not overwritten, which is typical. The issue arises because the brew upgrade command exits with a non-zero exit code, and since the bash shell runs with the set -e option, it causes the step to fail even though brew upgrade is the final command.
Regarding the versions, Python 2.7, 3.10.8, and 3.11.0 symlinks are created during image generation. Specifically:
Python 2.7 is linked to macOS Library/Frameworks
Python 3.10 is linked to the Homebrew cellar
Python 3.11 is linked to macOS Library/Frameworks
The possible resolution of this issue would be updating the image with latest patches of Python 3.10 and Python 3.11. instead of 3.10.8 and 3.11.0. All macOS-12, 13, and 14 images have been updated with the latest patches for these versions, which resolved the issue.
Please let us know if any further assistance or clarification!
eli-schwartz commentedon Dec 4, 2024
@aparnajyothi-y,
You seem to have fundamentally failed to understand the entire reason anyone is unhappy with GitHub Actions.
The behavior is detrimental and bad. We know that GitHub expects this to happen and we don't wish for further clarification.
We wish for GitHub to repent, to acknowledge that the expected behavior is detrimental and bad, and for GitHub to redesign the Actions image such that the Actions image works robustly, which it currently does not.
It is an antipattern to respond to an issue saying that some behavior is bad and causes troubles, by responding "we know it's bad and causes troubles, but that was intentional".
poshul commentedon Dec 12, 2024
The following works for us:
- name: Force update all brew python run: | brew update # GHA messes with links https://github.com/actions/runner-images/issues/11545 so we just force replace their installs' with brew's for pkg in $(brew list --formula | grep -E '^python(@[0-9]+\.[0-9]+)?$'); do brew upgrade --force --overwrite "$pkg" done brew cleanuperik-bershel commentedon Feb 7, 2025
Heads up! 👋
Yes, this is a long-known configuration conflict. 😞 We have had several different incidents related to this topic. The work is currently underway within the framework of this task:
Once we come to a solution, it will be announced in the specified issue. I am closing this one as a duplicate.