brew icon indicating copy to clipboard operation
brew copied to clipboard

Improve handling of `gcc` and `glibc` dependencies on Linux

Open carlocab opened this issue 3 years ago • 3 comments

Provide a detailed description of the proposed feature

On Linux, depending on the version of GCC/Glibc on the user's system, we may require the installation of Homebrew glibc or a Homebrew GCC (typically gcc@5).

These requirements are not currently handled as formula dependencies, but they should be. This has resulted in a variety of workarounds in a number of places, such as

https://github.com/Homebrew/brew/blob/4a623e0a2532a00a42474c755b8c03e927594676/Library/Homebrew/extend/os/linux/linkage_checker.rb#L75-L78

or

    depends_on "glibc" if Formula["glibc"].any_version_installed?

at https://github.com/Homebrew/homebrew-core/blob/1b2432ecd11bf7161fd6f5c62a7971ec34cd8ec1/Formula/llvm.rb#L48.

See also https://github.com/Homebrew/brew/pull/13577.

What is the motivation for the feature?

This will allow these dependencies to be installed automatically when needed, which is better for users, and allow us to remove the hacks in brew linkage referenced above.

How will the feature be relevant to at least 90% of Homebrew users?

It won't be.

What alternatives to the feature have been considered?

Keep existing hacks and rely on users manually installing dependencies that they need.

carlocab avatar Aug 11 '22 04:08 carlocab

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[bot] avatar Sep 02 '22 00:09 github-actions[bot]

Is this fixed by https://github.com/Homebrew/homebrew-core/pull/106837 & https://github.com/Homebrew/glibc-bootstrap/? Or at least now more fixable?

jacktose avatar Sep 02 '22 03:09 jacktose

Yes, mostly. But the removal of this hack

https://github.com/Homebrew/brew/blob/4a623e0a2532a00a42474c755b8c03e927594676/Library/Homebrew/extend/os/linux/linkage_checker.rb#L75-L78

is now causing warnings about an undeclared dependency on GCC all over homebrew-core.

carlocab avatar Sep 02 '22 06:09 carlocab

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[bot] avatar Sep 24 '22 00:09 github-actions[bot]

Any doc on this?

sisrfeng avatar Oct 04 '22 05:10 sisrfeng