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

brew upgrade fails for Python's 2to3 conflict #2322

Closed
2 of 7 tasks
traversaro opened this issue Dec 21, 2020 · 8 comments
Closed
2 of 7 tasks

brew upgrade fails for Python's 2to3 conflict #2322

traversaro opened this issue Dec 21, 2020 · 8 comments
Assignees
Labels
Area: Python awaiting-deployment Code complete; awaiting deployment and/or deployment in progress investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS

Comments

@traversaro
Copy link

traversaro commented Dec 21, 2020

Description
If I run the commands brew update and brew upgrade, the job fails. This is similar to #2248 and #1811, but the specific error is different and is probably due to some other Python being installed.

Area for Triage:

Question, Bug, or Feature?:
Bug

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11.0
  • Windows Server 2016 R2
  • Windows Server 2019

Expected behavior
I would expect that brew upgrade works fine.

Actual behavior
brew upgrade is failing with error:

2020-12-21T12:59:17.7407310Z The formula built, but is not symlinked into /usr/local
2020-12-21T12:59:17.7430550Z Could not symlink bin/2to3
2020-12-21T12:59:17.7443870Z Target /usr/local/bin/2to3
2020-12-21T12:59:17.7446720Z already exists. You may want to remove it:
2020-12-21T12:59:17.7452220Z   rm '/usr/local/bin/2to3'
2020-12-21T12:59:17.7482600Z 
2020-12-21T12:59:17.7485390Z To force the link and overwrite all conflicting files:
2020-12-21T12:59:17.7547210Z   brew link --overwrite [email protected]
2020-12-21T12:59:17.7599790Z 
2020-12-21T12:59:17.7652130Z To list all files that would be deleted:
2020-12-21T12:59:17.7663330Z   brew link --overwrite --dry-run [email protected]
2020-12-21T12:59:17.7667290Z 
2020-12-21T12:59:17.7678030Z Possible conflicting files are:

Repro steps

Run the following commands in a macos image:

  • brew update
  • brew upgrade

See https://github.com/traversaro/github-actions-brew-update-upgrade-check/actions/runs/435789601 for a minimal job that is failing.

@sunjayBhatia
Copy link

Running into the same issue in Envoy CI

@sunjayBhatia
Copy link

sunjayBhatia commented Dec 21, 2020

Looks like it is coming from the system python?

$ which 2to3
/usr/local/bin/2to3
$ ls -la $(which 2to3)
lrwxr-xr-x  1 root  wheel  66 Dec 12 21:22 /usr/local/bin/2to3 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/2to3

@maxim-lobanov
Copy link
Contributor

Most likely caused by #2217 where we switched Python 2 installation from to official pkg. This pkg brings this symlink and brew can't override it later

@maxim-lobanov
Copy link
Contributor

@miketimofeev I guess we should leave default MacOS Python 2 without any updates (just install pip) to avoid issues with brew

@Darleev Darleev added Area: Python OS: macOS investigate Collect additional information, like space on disk, other tool incompatibilities etc. and removed needs triage labels Dec 21, 2020
@miketimofeev
Copy link
Contributor

@maxim-lobanov there are some issues with pip installation in this case. I suggest removing the 2to3 symlink created by python2 before the python3 installation.
@traversaro as a workaround you can add rm -rf /usr/local/bin/2to3 as a first step until we've fixed it. Sorry for the inconvenience.

@traversaro
Copy link
Author

Thanks a lot @miketimofeev @maxim-lobanov !

@miketimofeev miketimofeev added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Dec 23, 2020
soonho-tri added a commit to soonho-tri/dreal4 that referenced this issue Dec 23, 2020
ivg added a commit to ivg/bap that referenced this issue Jan 4, 2021
adds the `rm -rf /usr/local/bin/2to3` workaround as suggested in
actions/runner-images#2322
ivg added a commit to ivg/bap that referenced this issue Jan 4, 2021
adds the `rm -rf /usr/local/bin/2to3` workaround as suggested in
actions/runner-images#2322
ivg added a commit to BinaryAnalysisPlatform/bap that referenced this issue Jan 4, 2021
* starts 2.3.0 release cycle

updates versions in the configuration tools, bumps up copyright
dates (also normalizes the MIT license to make it recognizable for
github), and updates the release.sh script for the release automation.

* fixes build on macOS

adds the `rm -rf /usr/local/bin/2to3` workaround as suggested in
actions/runner-images#2322
@ivg ivg mentioned this issue Jan 5, 2021
7 tasks
rdzman added a commit to MATPOWER/matpower that referenced this issue Jan 6, 2021
- brew install octave failing due to trouble overwriting things installed by existing versions of python and gcc.

Ref: actions/runner-images#2322
Ref: actions/runner-images#2391
ulupo added a commit to giotto-ai/giotto-tda that referenced this issue Jan 8, 2021
* Add rm '/usr/local/bin/2to3' in macOS jobs to fix symlink issue when brew upgrades Python (cf actions/runner-images#2322)

* Add brew upgrade step preceded by unlinking gcc@8 and gcc@9 due to other symlink failures (cf actions/runner-images#2391)
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#2322
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
jeeb added a commit to mpv-player/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
banach-space added a commit to banach-space/llvm-tutor that referenced this issue Nov 18, 2022
CI has started failing again recently and I found this solution while
going over: actions/runner-images#2322
banach-space added a commit to banach-space/clang-tutor that referenced this issue Nov 18, 2022
CI has started failing again recently and I found this solution while
going over: actions/runner-images#2322
q3aiml added a commit to q3aiml/ledger that referenced this issue Jan 8, 2023
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by ovewriting all links for python packages.

Homebrew/homebrew-core@8c79089
https://github.com/orgs/Homebrew/discussions/3895
actions/setup-python#577
actions/runner-images#6459
actions/runner-images#6507
actions/runner-images#2322
q3aiml added a commit to q3aiml/ledger that referenced this issue Jan 8, 2023
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by overwriting all links for python packages.

Homebrew/homebrew-core@8c79089
https://github.com/orgs/Homebrew/discussions/3895
actions/setup-python#577
actions/runner-images#6459
actions/runner-images#6507
actions/runner-images#2322
eakraly pushed a commit to coturn/coturn that referenced this issue Jan 9, 2023
MacOS CI build started to fail in the PRs because when upgrading python
it was not possible to override one existing file (related to 2to3
package). Apparently this happens because MacOS runners some times have
python versions not installed/compatible with brew.

Example of the failure:
https://github.com/coturn/coturn/actions/runs/3850951324

The proposed workaround is taken from here:
actions/runner-images#2322
tbm pushed a commit to ledger/ledger that referenced this issue Jan 9, 2023
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by overwriting all links for python packages.

Homebrew/homebrew-core@8c79089
https://github.com/orgs/Homebrew/discussions/3895
actions/setup-python#577
actions/runner-images#6459
actions/runner-images#6507
actions/runner-images#2322
dyphire pushed a commit to dyphire/mpv that referenced this issue Feb 22, 2023
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
dyphire pushed a commit to dyphire/mpv that referenced this issue Feb 22, 2023
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
@louwers
Copy link

louwers commented Dec 13, 2023

This is still an issue. Can it be reopened or should I create a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Python awaiting-deployment Code complete; awaiting deployment and/or deployment in progress investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS
Projects
None yet
Development

No branches or pull requests

7 participants
@louwers @traversaro @sunjayBhatia @maxim-lobanov @miketimofeev @Darleev and others