28 Commits

Author SHA1 Message Date
Michael Cho
f5c11fa342
Check host libstdc++ for brew gcc dependency
For most formulae, the bottles need a minimum libstdc++ rather than a
minimum GCC version. This is particularly important when building on
Ubuntu where the default compiler version is older than libstdc++.

So, checking the host libstdc++ version is a more accurate way to
determine whether brew GCC is needed at runtime. This can be improved in
the future to check symbol versions (e.g. GLIBCXX, CXXABI, GLIBC) which
can allow some bottles to be installed even with older glibc/libstdc++.
2025-09-12 14:15:56 -04:00
Mike McQuaid
9ac306e464
Remove alias generic_* definitions in favour of using super
This is the pattern we've been adopting for a while and it's a bit
cleaner. Let's remove all of the existing usage of the existing pattern
to avoid confusion when adopting the new one.
2025-06-16 08:10:08 +00:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Carlo Cabrera
cc65e5419d
linkage_checker: remove gcc from @indirect_deps on Linux
Closes #17303.
2024-05-16 00:47:21 +08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
danielnachun
99f968535f
linkage_checker: add libquadmath 2023-02-15 19:18:11 -08:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
59c03cb2a6
Add deprecations and disables
Do the usual dance:
- commented `odeprecated` to `odeprecated`
- `odeprecated` to `odisabled`
- `odisabled` removed
2023-02-03 10:48:43 +00:00
Adrian Ho
4b560e11e7 Enable Linux AArch64 support
Register system loader and arch tag for proper builds and bottling.
2022-09-29 16:33:44 +08:00
Carlo Cabrera
b2cc1720f8
Add comment explaining gcc exception for undeclared_deps. 2022-09-02 22:04:38 +08:00
Carlo Cabrera
ef7c9cf17c
linux/linkage_checker: remove gcc from undeclared_deps
This is causing warnings all over Homebrew/homebrew-core.

For example, there are dozens of warnings about this in the following CI
run:

    https://github.com/Homebrew/homebrew-core/runs/8116257943?check_suite_focus=true
2022-09-02 14:28:07 +08:00
Michka Popoff
d271614872
install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See 9692318ca6/Formula/gcc%405.rb (L33)

This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from one gcc formula to another..
Also, not having the right glibc version results in a non-functional brew
installation on an older Linux: the glibc installation needs
to be done by brew, and not by a workaround in a specific formula

Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Bo Anderson <mail@boanderson.me>
Co-Authored-By: Shaun Jackman <sjackman@gmail.com>
2022-08-25 11:04:37 +01:00
Bo Anderson
d9dc41bd38
linkage_checker: deprecate libnsl.so.1 linkage 2022-08-23 12:37:27 +01:00
Bo Anderson
4c643aed02
linkage_checker: disable libcrypt.so.1 linkage 2022-08-23 11:55:13 +01:00
Bo Anderson
0593597a11
linkage_checker: don't reinstall formula on some linkage failures 2022-08-23 09:38:52 +01:00
Carlo Cabrera
478e42d536
linux/linkage_checker: remove gcc from undeclared_deps 2022-08-10 19:04:35 +08:00
Bo Anderson
5d28c5166b
linkage_checker: deprecate linkage to libcrypt.so.1 2022-04-18 16:42:08 +01:00
Shaun Jackman
4e68a7b5bc Allow linkage to libnss_files.so.2 on Linux
libnss_nis.so.2 in glibc@2.13 has linkage to libnss_files.so.2.
2021-12-31 16:17:36 -08:00
danielnachun
dc8568f541 linkage_checker: add libatomic 2021-05-31 00:40:19 -07:00
Michka Popoff
0a292c7041
linux: use preferred_gcc instead of gcc 2021-02-09 21:48:48 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Issy Long
0041ea21f5
Change occurrences of "whitelist" to "allowlist" 2020-06-06 22:38:32 +01:00
Michka Popoff
50bb8f3fc1 linkage_checker: whitelist libthread_db.so.1
openjdk links against this library, which is provided by glibc.
2019-12-05 21:44:09 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Shaun Jackman
5cbddd2aca LinkageChecker: Report linkage of unwanted system libraries [Linux]
gcc and glibc are implicit dependencies on Linux.
No other linkage to system libraries is expected or desired.
2018-09-05 15:32:06 -07:00