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

Potentially unnecessary symlink error when installing awscli #100320

Closed
2 tasks done
dmg46664 opened this issue Apr 28, 2022 · 9 comments
Closed
2 tasks done

Potentially unnecessary symlink error when installing awscli #100320

dmg46664 opened this issue Apr 28, 2022 · 9 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity

Comments

@dmg46664
Copy link

dmg46664 commented Apr 28, 2022

brew gist-logs <formula> link OR brew config AND brew doctor output

==> Pouring six--1.16.0_2.all.bottle.1.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /opt/homebrew
Could not symlink lib/python3.9/site-packages/six.py
Target /opt/homebrew/lib/python3.9/site-packages/six.py
already exists. You may want to remove it:
  rm '/opt/homebrew/lib/python3.9/site-packages/six.py'

To force the link and overwrite all conflicting files:
  brew link --overwrite six

To list all files that would be deleted:
  brew link --overwrite --dry-run six

Possible conflicting files are:
/opt/homebrew/lib/python3.9/site-packages/six.py

Verification

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

Trying to run brew install awscli
It ran but with the above error.

  • Noting that brew update --preinstall ran first.
  • Noting that brew doctor displays the same unlinked error and my report is for it not to happen in the first place.

What happened (include all command output)?

brew install awscli             127 ✘  10:55:03
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and aws/tap).
==> New Formulae
spirv-headers
==> Updated Formulae
Updated 78 formulae.
==> Updated Casks
Updated 34 casks.
==> Deleted Casks
sitebulb              srware-iron           thought-train         vin047-abgx360        zoom-outlook-plugin

==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.38.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:8691541c36bbb0d7fed59d98d4eff7908762c079e2a
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:8691541c36bbb0d7fed59d98d4e
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/six/manifests/1.16.0_2-1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/six/blobs/sha256:560f73cafaea617d44f93beffdac91ac3b93095b1b64ff
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:560f73cafaea617d44f93beffda
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/awscli/manifests/2.6.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/awscli/blobs/sha256:a708d9184e9c22a72683c4a8507348fe45c8447fd07
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a708d9184e9c22a72683c4a8507
######################################################################## 100.0%
==> Installing dependencies for awscli: sqlite and six
==> Installing awscli dependency: sqlite
==> Pouring sqlite--3.38.3.arm64_monterey.bottle.tar.gz
🍺  /opt/homebrew/Cellar/sqlite/3.38.3: 11 files, 4.4MB
==> Installing awscli dependency: six
==> Pouring six--1.16.0_2.all.bottle.1.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /opt/homebrew
Could not symlink lib/python3.9/site-packages/six.py
Target /opt/homebrew/lib/python3.9/site-packages/six.py
already exists. You may want to remove it:
  rm '/opt/homebrew/lib/python3.9/site-packages/six.py'

To force the link and overwrite all conflicting files:
  brew link --overwrite six

To list all files that would be deleted:
  brew link --overwrite --dry-run six

Possible conflicting files are:
/opt/homebrew/lib/python3.9/site-packages/six.py
==> Summary
🍺  /opt/homebrew/Cellar/six/1.16.0_2: 20 files, 122.3KB
==> Installing awscli
==> Pouring awscli--2.6.0.arm64_monterey.bottle.tar.gz
==> Caveats
The "examples" directory has been installed to:
  /opt/homebrew/share/awscli/examples

zsh completions and functions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/awscli/2.6.0: 12,626 files, 101.1MB
==> Running `brew cleanup awscli`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Warning: The following dependents of upgraded formulae are outdated but will not
be upgraded because they are not bottled:
  aws-sam-cli
==> Caveats
==> awscli
The "examples" directory has been installed to:
  /opt/homebrew/share/awscli/examples

zsh completions and functions have been installed to:
  /opt/homebrew/share/zsh/site-function

What did you expect to happen?

No error, or perhaps some better explanation of what if anything I have done wrong and the context about why it occurs.
Suggesting the use of:

brew link --overwrite six

feels scary and unnecessary without context.

Step-by-step reproduction instructions (by running brew commands)

brew install awscli
@dmg46664 dmg46664 added the bug Reproducible Homebrew/homebrew-core bug label Apr 28, 2022
@SMillerDev
Copy link
Member

Can you include the brew config output?

@dmg46664
Copy link
Author

@SMillerDev Thanks for the quick response!

brew config                       1 ✘  11:06:37
HOMEBREW_VERSION: 3.4.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: d0a0bbef8db45cca303c607037338d02d8eaa8ca
Last commit: 34 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 297be05c529835e0e211de450aa55836b6b1fca7
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 13.0.0 build 1300
Git: 2.32.0 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.77.0 => /usr/bin/curl
macOS: 12.2.1-arm64
CLT: 13.2.0.0.1.1638488800
Xcode: 13.3
Rosetta 2: false

@dmg46664
Copy link
Author

@SMillerDev

I hadn't paid close enough attention to brew doctor

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

So I updated the software above, then uninstalled and reinstalled.
✅ I can tell the error is gone on reinstall
⚠️ But the link command itself still fails (perhaps the dependency isn't removed and then ignored on reinstall)

What do you think? Logs included below.

brew uninstall awscli                                                                                                    ✔  12:45:04
Uninstalling /opt/homebrew/Cellar/awscli/2.6.0... (13,247 files, 105.7MB)
 ~  brew install awscli                                                                                                 ✔  4s  12:45:26
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 5 formulae.

==> Downloading https://ghcr.io/v2/homebrew/core/awscli/manifests/2.6.0
Already downloaded: /Users/dmg46664/Library/Caches/Homebrew/downloads/369656a3eb42be893121cb12b6a196e18fec514b89c5d64a3675d4b63e7ce046--awscli-2.6.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/awscli/blobs/sha256:a708d9184e9c22a72683c4a8507348fe45c8447fd07f262da84ff4dd2dc106c2
Already downloaded: /Users/dmg46664/Library/Caches/Homebrew/downloads/95e4ef8dfcc730d6ef628df1c40343995f29120671ed1faf8875fd523b53f512--awscli--2.6.0.arm64_monterey.bottle.tar.gz
==> Pouring awscli--2.6.0.arm64_monterey.bottle.tar.gz
==> Caveats
The "examples" directory has been installed to:
  /opt/homebrew/share/awscli/examples

zsh completions and functions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/awscli/2.6.0: 12,626 files, 101.1MB
==> Running `brew cleanup awscli`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).



 ~  brew link six                                                                                                      ✔  11s  12:45:46
Linking /opt/homebrew/Cellar/six/1.16.0_2...
Error: Could not symlink lib/python3.9/site-packages/six.py
Target /opt/homebrew/lib/python3.9/site-packages/six.py
already exists. You may want to remove it:
  rm '/opt/homebrew/lib/python3.9/site-packages/six.py'

To force the link and overwrite all conflicting files:
  brew link --overwrite six

To list all files that would be deleted:
  brew link --overwrite --dry-run six

@Bo98
Copy link
Member

Bo98 commented Apr 28, 2022

This can happen if you install six via pip before Homebrew's. We could just add a link_overwrite or something to override the error. Not entirely sure the best way to handle it.

@dmg46664
Copy link
Author

@Bo98 Thanks. Yeah I installed localstack via pip (as per instructions). It probably installed a bunch of stuff, perhaps six if it wasn't something else via pip that isn't in my human memory.

I understand it's a difficult situation. A user such as myself can't really be expected to understand all the dependencies of all ubiquitous tools.

Some thoughts.

  • Is it really an error? Or should it be considered a warning from my perspective?
  • It would be nice for me to understand the downside of it not happening vs me forcing it.
  • It would be nice if the message showed a link to an article fully describing the problem.
  • Perhaps said article could keep track of common combinations that cause problems to build up a db that could guide to a solution?

@carlocab
Copy link
Member

It’s not too hard to answer these questions for six specifically, but brew needs to be able handle these generically (i.e. these errors can happen with anything; not just six), and there isn’t really a generic answer to your questions beyond what brew already shows.

The warning is admittedly a little terse (most brew messages are, intentionally) but IMHO it tells any sufficiently motivated user enough information to work it out for themselves (some willingness to stumble in the dark briefly might be necessary).

@dmg46664
Copy link
Author

@carlocab Thanks but it states Error in the message. That suggests failure to me. Should it not state Warning, i.e. some things may not function as expected.

Could a white list not be created so that perhaps it overwrites for six and others in the white list but fails (if failure is deserved) in the way above for others?

@MikeMcQuaid
Copy link
Member

@dmg46664 It is an error. We tried to link something, we were not able to and it requires manual intervention to end up in the state we intended.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label May 21, 2022
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

No branches or pull requests

5 participants