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++.
This improves the load time of most brew commands. For an example of
one of the simplest commands this speeds up:
Without Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
Time (mean ± σ): 525.0 ms ± 35.8 ms [User: 229.9 ms, System: 113.1 ms]
Range (min … max): 465.3 ms … 576.6 ms 10 runs
Benchmark 2: git checkout optimise_requires; brew help
Time (mean ± σ): 383.3 ms ± 25.1 ms [User: 133.0 ms, System: 72.1 ms]
Range (min … max): 353.0 ms … 443.6 ms 10 runs
Summary
git checkout optimise_requires; brew help ran
1.37 ± 0.13 times faster than git checkout master; brew help
```
With Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
Time (mean ± σ): 386.0 ms ± 30.9 ms [User: 130.2 ms, System: 93.8 ms]
Range (min … max): 359.5 ms … 469.3 ms 10 runs
Benchmark 2: git checkout optimise_requires; brew help
Time (mean ± σ): 330.2 ms ± 32.4 ms [User: 93.4 ms, System: 73.0 ms]
Range (min … max): 302.9 ms … 413.9 ms 10 runs
Summary
git checkout optimise_requires; brew help ran
1.17 ± 0.15 times faster than git checkout master; brew help
```
When either being in a non-default prefix or being on an unsupported
macOS version we expect most things to be built from source. In that
environment, do not allow HOMEBREW_INSTALL_FROM_API to be set.
Fixes#14475
- Change `LINUX_CI_OS_VERSION` from `Ubuntu 16.04` to `Ubuntu 22.04`
- Change `LINUX_GLIBC_CI_VERSION` from `2.23` to `2.35`
- Change `LINUX_GCC_CI_VERSION` from `5.0` to `11.0`
- Change `LINUX_PREFERRED_GCC_FORMULA` from `gcc@5` to `gcc@11`
- Build the Docker image `ghcr.io/homebrew/ubuntu22.04:master`
This will allow us to replace code like
os = if OS.mac?
"Darwin"
else
"Linux"
end
with a call to `OS.uname`. Doing
rg '= (if )?OS\.(mac|linux)\?'
returns about 70 matches, so there are probably at least a handful of
formulae that could be simplified by this.
- `download_strategy`: only request image index JSON for downloading
the manifest for the tab
- use a shared `OS` constant for the version of `glibc` we use in CI
- fix `skoepeo` typo
- ensure that blank hash values are deleted (again) rather than just
`nil` ones
- use a shared `Hardware::CPU` constant for oldest CPU we're
supporting/using on Intel 64-bit
- re-add comment to `software_spec`
Define MacOS.version, MacOS.full_version, and MacOS::Xcode.version to
Version::NULL on Linux so that brew readall succeeds and Homebrew/brew
can tap Homebrew/core on Linux.
The existing one has two issues:
* It doesn't reflect Linuxbrew's move to a separate GitHub org
* It redirects to the legacy-linuxbrew (pre-core/brew split) wiki
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that
neither Mac nor Linux-specific code is loaded. This allows easier
testing of cross-platform code on OS X and will make it easier to port
Homebrew to platforms other than OS X and Linux.
Generally it seems user agents are all `software/version` but ours is
not. Also, set the user agent in a way that it's shared between Bash
and Ruby code.
Closes https://github.com/Homebrew/legacy-homebrew/pull/50480.