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

coreutils: conflicts with system commands /sbin/sha{1,224,256,384,512}sum #201163

Open
4 tasks done
AkihiroSuda opened this issue Dec 14, 2024 · 4 comments
Open
4 tasks done
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@AkihiroSuda
Copy link
Contributor

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

$ brew config
HOMEBREW_VERSION: 4.4.11-58-ga86c7c1
ORIGIN: https://github.com/Homebrew/brew
HEAD: a86c7c1d7a25732f0e2affaa8e9d85b304d6ef9f
Last commit: 3 hours ago
Branch: master
Core tap HEAD: 7745d32e11d429929396fbdef6d7308b0b003cda
Core tap last commit: 36 minutes ago
Core tap JSON: 14 Dec 16:29 UTC
Core cask tap HEAD: a716724179e408ddd8b7c3653ec88e0fb3c22374
Core cask tap last commit: 16 minutes ago
Core cask tap JSON: 14 Dec 16:29 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.6 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby
CPU: octa-core 64-bit icelake
Clang: 16.0.0 build 1600
Git: 2.47.1 => /usr/local/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.2-x86_64
CLT: 16.2.0.0.1.1733547573
Xcode: 16.1

$ brew doctor
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • 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.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

brew install coreutils

What happened (include all command output)?

The /usr/local/bin/sha{1,224,256,384,512}sum symlinks installed by Homebrew conflicts with the system commands /sbin/sha{1,224,256,384,512}sum.

$ which sha256sum
/usr/local/bin/sha256sum

$ ls -l /usr/local/bin/sha256sum 
lrwxr-xr-x  1 suda  staff  37 Dec 15 01:29 /usr/local/bin/sha256sum@ -> ../Cellar/coreutils/9.5/bin/sha256sum

$ /usr/local/bin/sha256sum --version
sha256sum (GNU coreutils) 9.5
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Ulrich Drepper, Scott Miller, and David Madore.

$ /sbin/sha256sum --version
sha256sum (Darwin) 1.0

$ sw_vers --productVersion
15.2

IIUC, the system commands /sbin/sha{1,224,256,384,512}sum were not present in macOS 14.
Not sure about 15.0 and 15.1.

What did you expect to happen?

The /usr/local/bin/sha*sum links should be probably prefixed with the g prefix.

Or, the break_macos_users notice should be updated to include sha*sum:

def breaks_macos_users
%w[dir dircolors vdir]
end

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

`brew install coreutils`
@AkihiroSuda AkihiroSuda added the bug Reproducible Homebrew/homebrew-core bug label Dec 14, 2024
@AkihiroSuda
Copy link
Contributor Author

The issue doesn't seem to happen with brew install --build-from-source.

I guess this issue can be resolved when the build infrastructure is updated to use a more recent version (15.2?) of macOS.

@carlocab
Copy link
Member

carlocab commented Dec 14, 2024

Do brew reinstall coreutils (no need for --build-from-source).

Bottles built on macOS 15 will not install sha{1,224,256,384,512}sum without the g prefix.

Beyond that I'm not sure there's much we can do; we probably can't/shouldn't replace the contents of HOMEBREW_CELLAR solely due to OS upgrades.

@AkihiroSuda
Copy link
Contributor Author

Do brew reinstall coreutils (no need for --build-from-source).

brew reinstall coreutils doesn't solve the issue:

$ brew reinstall coreutils
==> Downloading https://ghcr.io/v2/homebrew/core/coreutils/manifests/9.5-1
Already downloaded: /Users/suda/Library/Caches/Homebrew/downloads/2e0eb76f257e69ed842ff2ed10c0d7edf1d6e7387460a11babef9b62771bed24--coreutils-9.5-1.bottle_manifest.json
==> Fetching coreutils
==> Downloading https://ghcr.io/v2/homebrew/core/coreutils/blobs/sha256:a5fee7f3a08317464bd61051a5186ffa6cc7e81fb8de6b6ecee65cbc612a6b6b
Already downloaded: /Users/suda/Library/Caches/Homebrew/downloads/ad38f14baac7db73f79196fec03210d37fc5215e560d3406a281910a27de36d9--coreutils--9.5.sonoma.bottle.1.tar.gz
==> Reinstalling coreutils 
==> Pouring coreutils--9.5.sonoma.bottle.1.tar.gz
==> Caveats
Commands also provided by macOS and the commands dir, dircolors, vdir have been installed with the prefix "g".
If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH with:
  PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
==> Summary
🍺  /usr/local/Cellar/coreutils/9.5: 477 files, 10.9MB
==> Running `brew cleanup coreutils`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

$ ls -l /usr/local/bin/sha*sum
lrwxr-xr-x  1 suda  staff  35 Dec 15 01:59 /usr/local/bin/sha1sum@ -> ../Cellar/coreutils/9.5/bin/sha1sum
lrwxr-xr-x  1 suda  staff  37 Dec 15 01:59 /usr/local/bin/sha224sum@ -> ../Cellar/coreutils/9.5/bin/sha224sum
lrwxr-xr-x  1 suda  staff  37 Dec 15 01:59 /usr/local/bin/sha256sum@ -> ../Cellar/coreutils/9.5/bin/sha256sum
lrwxr-xr-x  1 suda  staff  37 Dec 15 01:59 /usr/local/bin/sha384sum@ -> ../Cellar/coreutils/9.5/bin/sha384sum
lrwxr-xr-x  1 suda  staff  37 Dec 15 01:59 /usr/local/bin/sha512sum@ -> ../Cellar/coreutils/9.5/bin/sha512sum

@carlocab
Copy link
Member

carlocab commented Dec 14, 2024

Ah, yes, I see -- coreutils doesn't have an Intel Sequoia bottle. We could probably build one, but it'll probably get dropped next time coreutils is updated (which is admittedly not that often).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

No branches or pull requests

2 participants