244 Commits

Author SHA1 Message Date
Issy Long
8684f953f6
Merge pull request #13989 from issyl0/sorbet-rbi-is-in-maintenance 2022-10-12 08:48:45 +01:00
Rylan Polster
174087958b
Simulate all OS/arch combinations in brew readall 2022-10-10 23:56:37 -04:00
Issy Long
b7d997e80d
sorbet: Bump some files from typed: false to typed: true
- This was done with `brew typecheck --update --suggest-typed` which
  (as of the previous commit) uses Spoom, yet another gem. I thought I'd
  see how well it works. There are no Sorbet errors after these changes!
2022-10-11 01:09:03 +01:00
apainintheneck
6301de9dcc Move Args#only_formula_or_cask to extend/os/linux 2022-10-03 18:13:33 -07:00
apainintheneck
020c50e588 Warn linux users about using --cask 2022-10-01 16:11:39 -07: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
a2081b488c
Use unversioned GCC for runtime libraries when required.
See discussion at Homebrew/homebrew-core#110010.
2022-09-27 13:11:04 +08:00
Carlo Cabrera
8a9ed2c48f
linux/keg_relocate: clean up GCC RPATH fix.
There are no more formulae in Homebrew/core that have a runtime
dependency on GCC (see Homebrew/homebrew-core#110883), so there is no
more need to retain linkage with GCC through a versioned path.
2022-09-22 00:53:56 +08:00
Bo Anderson
e526c65566
extend/os/linux/development_tools: handle no /usr/bin/gcc
Fixes #13896.
2022-09-20 13:06:56 +01:00
Bo Anderson
b8b195cc64
Merge pull request #13873 from Bo98/glibc-keg-only
Changes to allow keg-only glibc
2022-09-19 08:10:52 +01:00
Bo Anderson
1201823095
extend/os/linux/system_config: support gcc 12 & keg-only glibc 2022-09-19 07:40:15 +01:00
Bo Anderson
a372ca6100
extend/os/linux/development_tools: consider keg-only glibc & binutils 2022-09-19 07:06:22 +01:00
Bo Anderson
ae3c6a6574
extend/os/linux/install: use arch-agnostic ld.so path 2022-09-19 07:06:22 +01:00
Bo Anderson
88ca45002d
extend/os/linux/install: update old ld.so symlinks 2022-09-19 07:06:22 +01:00
Bo Anderson
07f5951b76
extend/os/linux/install: use ld.so.conf.d where possible 2022-09-19 07:06:20 +01:00
Bo Anderson
66fa1f7e6a
Use GCC 12 for runtime libraries 2022-09-19 00:51:17 +01:00
Bo Anderson
9091ac0dad
Create GCC and glibc symlinks after install is complete
Fixes #13836.
2022-09-09 21:24:45 +01:00
Bo Anderson
cbc895ce2b
Add Pathname shim extension RBI definitions 2022-09-08 03:26:50 +01:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01: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
Daniel Nachun
451bded34d
Merge pull request #13770 from danielnachun/add_symlink_gcc_libs
Automatically add symlinks from gcc cellar to HOMEBREW_PREFIX/lib
2022-08-31 19:28:23 -07:00
danielnachun
3c014a0fc0
Library/Homebrew/extend/os/linux/install.rb: add symlink_gcc_libs 2022-08-31 17:39:55 -07:00
Shaun Jackman
d6368806e8
os/linux/dependency_collector: install gcc if glibc is too old.
gcc is required for libgcc_s.so.1 if glibc or gcc are too old.
2022-08-31 13:16:38 +01:00
Mike McQuaid
1f709d360d
extend/os/linux: improve glibc, gcc dependency handling.
- Add more early return checks
- Move to a recursive approach for more readability and avoiding a
  counter that we need to bump
- Perform more caching
- Keep class variable usage isolated into specific methods
2022-08-30 12:54:34 +00:00
Carlo Cabrera
ab696cbbb7
linux/diagnostic: fix rpath returning nil.
Fixes #13762.

There's still a bug in the GCC linkage check, but I'll need a bit more
time to work on a fix. This at least makes sure `brew doctor` will not
return the error in the issue linked above.
2022-08-26 22:23:02 +08:00
Mike McQuaid
3c5b55be82
linux/dependency_collector: bump maximum_tree_depth.
Fixes #13760.
2022-08-26 08:39:03 +01: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
Mike McQuaid
2415339124
Merge pull request #13745 from MikeMcQuaid/glibc-install-split
glibc related cleanup
2022-08-23 13:09:31 +01:00
Mike McQuaid
c294dcc616
glibc related cleanup
Extracted from https://github.com/Homebrew/brew/pull/13577
2022-08-23 12:42:02 +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
Mike McQuaid
8f405d2c15
Merge pull request #13739 from Bo98/linkage-test
linkage_checker: don't reinstall formula on some linkage failures
2022-08-23 11:50:05 +01:00
Mike McQuaid
d550d57f78
Merge pull request #13639 from carlocab/linux-doctor-dependents
linux/diagnostic: add check for versioned GCC linkage
2022-08-23 11:46:08 +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
c7030eaba0
formula: add optional source and target args to #rpath
There are about 10 formulae which need a bit more flexibility from
`#rpath`. Most of them use `Pathname#relative_path_from`, so we can
replace those instances with a call to `#rpath` instead once `#rpath`
knows how to handle this.
2022-08-19 17:32:43 +08:00
Carlo Cabrera
fb4c6d92bc
Merge pull request #13677 from carlocab/python-libexec
ENV/super: add Python's `libexec/"bin"` directory when applicable
2022-08-15 18:47:02 +08:00
Lukas Oberhuber
3d60d610dd Merge branch 'master' into debug-symbols 2022-08-10 18:44:09 -10:00
Carlo Cabrera
999623b45d
ENV/super: add Python's libexec/"bin" directory when applicable
When Homebrew/homebrew-core#107517 is merged, builds will no longer be
able to find `python@3.9` as `python3`. This is also what is likely to
happen to `python@3.10` when we add a `python@3.11`.

This is likely to break many builds, so let's make sure they can keep
finding a `python3` for formulae that don't have a dependency on the
latest Python3.

This is arguably something we should've done earlier: it also means that
builds that go looking for an unversioned `python` end up finding our
Python3 (whenever present in the build environment) instead of, say,
`/usr/bin/python` which is typically Python2.
2022-08-10 22:51:44 +08:00
Carlo Cabrera
478e42d536
linux/linkage_checker: remove gcc from undeclared_deps 2022-08-10 19:04:35 +08:00
Carlo Cabrera
fa26b5a06d
linux/super: add unversioned GCC lib directory to RPATH
This adds GCC's runtime lib directory to the RPATH of every build on
Linux (unconditionally!).

This is useful for three things:

1. It fixes versioned GCC linkage for formulae that users build from
   source instead of pouring from a bottle. We currently only handle
   bottle installs. See #13633.

2. It helps minimise the GCC dependency explosion. When a formula has a
   Linux-only GCC dependency, then all its dependents that link with
   some GCC runtime library (typically `libstdc++`) must, before this
   change, also adopt a GCC dependency. This is a consequence of our
   injecting GCC's runtime library directory into RPATH only when a
   formula is built with GCC (this is done through the specs file). We
   can avoid the need to do this by always injecting this path instead.

3. This enables us to automatically install Homebrew GCC whenever the
   user's GCC is too old and the formula may need it. Without this
   change, auto-installing GCC is not that useful because formulae that
   need it may not know to look for our GCC, unless the formula already
   happened to be built with our GCC. With this change, these formulae
   will always be able to find our GCC when it is installed. This is
   particularly useful for when we start building with a version of GCC
   that is much closer to the latest than we currently do.

This approach comes with at least two drawbacks:

1. We will see spurious linkage warnings in CI about an undeclared
   dependency with linkage as soon as Homebrew GCC is installed, because
   formulae will link with our GCC instead of the host's. Users will
   also see a similar complaint if they do `brew linkage`.

2. This leans _very_ heavily on GCC delivering backward compatibility of
   their runtime libraries. If they do not, we could see different
   behaviour across different CI runs for the same formula depending on
   whether Homebrew GCC is installed.

It's worth noting that item 3 in the "useful" list above may rely on
features not yet implement in `brew`.
2022-08-06 13:21:18 +08:00
Carlo Cabrera
2d95b9acda
linux/keg_relocate: remove patchelf exemption
I don't think this is needed anymore. We probably needed this when we
used `patchelf` to do `RPATH` rewriting, but this is no longer the case.
2022-08-06 00:26:48 +08:00
Rylan Polster
d4ddfb88df
Merge pull request #13616 from Rylan12/simulate-macos-on-linux
Move `HOMEBREW_SIMULATE_MACOS_ON_LINUX` handling to `SimulateSystem`
2022-08-05 10:23:13 -04:00
Carlo Cabrera
fec5b4080a
linux/diagnostic: add check for versioned GCC linkage
This complements my other two GCC-on-Linux PRs (#13631, #13633), however
they are both reliant on bottles eventually being (re-)poured.

Let's try to speed that up by returning an error message from `brew doctor`
whenever a user has formulae installed that would benefit from a `brew reinstall`.
2022-08-03 20:54:16 +08:00
Carlo Cabrera
1c0eac7874
Exclude GCC formulae from RPATH modification for GCC 2022-08-02 19:09:38 +08:00
Carlo Cabrera
532460c098
keg_relocate: fix new GCC lib directory
Also add comment explaining what this line does, along with a TODO
suggesting a replacement once we've shipped the GCC PR.
2022-08-02 13:29:14 +08:00
Carlo Cabrera
53fdb64113
keg_relocate (linux): prepend gcc/lib/current to RPATH when needed
This should help keep bottles that require GCC working when
Homebrew/homebrew-core#106755 is merged.

This only works on freshly-poured bottles. Previously installed bottles
will still break on systems with a host GCC older than GCC 11.
2022-08-02 11:02:47 +08:00
Lukas Oberhuber
cd9fe97c55 Improve style 2022-07-30 11:10:26 +01:00
Rylan Polster
ea1f2098ac
Move HOMEBREW_SIMULATE_MACOS_ON_LINUX handling to SimulateSystem 2022-07-28 15:04:25 -04:00
Lukas Oberhuber
215e545660 brew style 2022-07-26 19:28:30 +01:00