55 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
d899f00c4b
Link to Support Tiers in diagnostic/error messages
Now that we have this nice URL let's reference it to allow our other
messages to be a bit shorter/kinder.
2025-04-01 11:35:27 +01:00
Michka Popoff
bba5ae1f23
glibc: set next version 2025-02-04 21:18:02 +01:00
Carlo Cabrera
bc21cf366e
os: use native ruby calls for uname
This avoids the overhead of shelling out.
2024-10-31 15:35:58 +08:00
Issy Long
7282b4d7a2
os: Bump to Sorbet typed: strict 2024-07-17 16:01:59 -04:00
Mike McQuaid
c5dbd3ca24
Rearrange requires
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
```
2024-07-14 08:49:39 -04:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Markus Reiter
4b432c7ea4
Explicitly mark non-private APIs. 2024-04-22 21:16:49 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Maxim Belkin
3e6fc271c4 os.rb: fix for WSL systems without wslview
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-03-02 15:54:37 +00:00
Maxim Belkin
c9b289fc3d Use 'wslview' instead of 'xdg-open' on Windows 2023-02-27 14:39:56 +00:00
apainintheneck
8060360333 Fix supported version check
HOMEBREW_PREFIX is a Pathname; HOMEBREW_DEFAULT_PREFIX
and HOMEBREW_MACOS_ARM_DEFAULT_PREFIX are strings.
2023-02-02 19:58:03 -08:00
Mike McQuaid
46fc4f9f1b
Don't allow HOMEBREW_INSTALL_FROM_API when building from source
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
2023-02-02 14:49:34 +00: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
Bo Anderson
66fa1f7e6a
Use GCC 12 for runtime libraries 2022-09-19 00:51:17 +01:00
Shaun Jackman
b01e0abcf8
Update LINUX_CI_OS_VERSION and related constants
- 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`
2022-09-06 14:16:16 +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
cd73e6bac5
Introduce more Ruby constants for values set by brew.sh 2022-06-17 19:47:57 +01:00
EricFromCanada
3515059941
Also show issues URL on macOS arm64 2021-11-13 15:00:10 -05:00
Carlo Cabrera
85580e7459
Use kernel_name instead of uname as the method name 2021-09-10 21:25:38 +08:00
Carlo Cabrera
b0668f4e31
Use -s flag in uname call
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-09-10 21:24:05 +08:00
Carlo Cabrera
c90e63b299
os: add uname method
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.
2021-09-09 22:47:05 +08:00
Sam Ford
0752d25125
OS::Mac: Move version methods into ::Version 2021-06-23 09:03:46 -04:00
Shaun Jackman
d6c0bbc7f4 GHCR: Add constant OS::CI_OS_VERSION
Rename constant OS::GLIBC_CI_VERSION to OS::CI_GLIBC_VERSION.
2021-04-05 22:39:41 -07:00
Mike McQuaid
cdaeee03c4
GitHub Packages cleanup
- `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`
2021-04-05 14:58:17 +01:00
Markus Reiter
cf169e5270 Fix type errors in Sandbox. 2020-11-29 21:23:54 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
dbfc6dc7a5 Document OS. 2020-08-26 03:13:59 +02:00
Seeker
3379e3b5cf os: add kernel_version 2020-08-19 11:41:30 -07:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
710859e300
Update Linuxbrew references to Homebrew on Linux
This is a clearer branding for us to use.

Also, as part of testing this, make some fixes to Jekyll in the docs folder.

Fixes #5835
2019-03-12 20:13:38 +00:00
Mike McQuaid
eed1444d61
Update deprecations and cleanup
- Move `odeprecated` to `odisabled`
- Remove `odisabled`
- Enable automatic cleanup on install/reinstall/upgrade.
2019-01-23 21:57:40 +00:00
Mike McQuaid
8258ecc3ca
os: no “READ THIS” in unsupported configurations. 2019-01-21 13:58:03 +00:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
f2ce6489b2 Use more docs.brew.sh short links
These are nicer on the eyes.
2018-02-22 19:46:58 +00:00
Shaun Jackman
73ba9b3d88 Define OS::Mac on Linux
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.
2018-02-20 11:22:40 -08:00
Mike McQuaid
195f77abb0 MACOS_*VERSION: move to compat. 2017-11-05 15:40:46 +00:00
Mike McQuaid
baa61f5a6e Use https for all docs.brew.sh links.
May as well use the more secure link when possible.
2017-07-27 15:59:37 +01:00
Baptiste Fontaine
d6dd63d1a0 OS: use RbConfig instead of RUBY_PLATFORM
`RUBY_PLATFORM` is always `"java"` when running JRuby, no matter what is
the underlying platform.

See also https://github.com/pry/pry/issues/386.
2017-07-26 22:26:30 +02:00
Mike McQuaid
a3bffe70bc Use docs.brew.sh links. 2017-01-04 11:13:41 +00:00
Mike McQuaid
c7de142800 os: don't tell people to report unsupported version issues. 2016-11-05 10:58:39 -04:00
Bob W. Hogg
467b5765cf os: update Linux troubleshooting url
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
2016-09-18 10:28:23 -04:00
Mike McQuaid
0fd0ecd599 os: don't assume Linux if testing generic OS. 2016-07-29 21:21:02 -06:00
Mike McQuaid
3318967609 os: fix Rubocop warnings. 2016-07-27 15:05:42 -06:00
Mike McQuaid
ddb576b582 Add support for testing generic OS.
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.
2016-05-08 16:51:22 +01:00
Mike McQuaid
77611bafb1 Make Homebrew user agent consistent, use a slash.
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.
2016-04-04 12:18:21 +01:00
Baptiste Fontaine
abfaa59e06 MacOS: full_version added
Closes Homebrew/homebrew#44988.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-18 22:57:42 +08:00
Mike McQuaid
83080be4c1 Use https for issue URL. 2015-03-12 15:19:02 +00:00