893 Commits

Author SHA1 Message Date
Patrick Linnane
6c44d1a8f1
Merge pull request #20681 from Homebrew/support-tahoe-drop-mojave
Support Tahoe, drop Mojave and older
2025-09-14 19:55:06 +00:00
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
Patrick Linnane
e63c885033
Support Tahoe, drop Mojave and older
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-09-12 10:40:19 -07:00
Michael Cho
eda9e78529
Merge pull request #20633 from Homebrew/ld-system
os/linux/ld: add support for using system ld.so
2025-09-12 13:19:40 +00:00
Mike McQuaid
3023e6dcad
Merge pull request #20660 from botantony/os/mac-typed
os/mac/*: `typed: strict`
2025-09-10 15:36:23 +00:00
botantony
843fc7c97a
os/mac/*: more style corrections
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Bo Anderson <mail@boanderson.me>
2025-09-10 16:59:51 +02:00
Bo Anderson
055c87e47e
os/mac: updates for Xcode/macOS 26 RC 2025-09-10 03:39:46 +01:00
botantony
bc2c12c742
os/mac/*: style corrections
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-09-09 18:13:19 +02:00
botantony
0adf85970d
os/mac/xcode: typed: strict
Signed-off-by: botantony <antonsm21@gmail.com>
2025-09-09 15:28:53 +02:00
botantony
28761d8756
os/mac/sdk: typed: strict
Signed-off-by: botantony <antonsm21@gmail.com>
2025-09-09 15:28:53 +02:00
botantony
289fed93b4
os/mac/mach: typed: strict
Signed-off-by: botantony <antonsm21@gmail.com>
2025-09-09 15:28:53 +02:00
botantony
744e2452d8
os/mac/keg: typed: strict
Signed-off-by: botantony <antonsm21@gmail.com>
2025-09-09 15:07:35 +02:00
Michael Cho
896edb4451
os/linux/ld: add support for using system ld.so 2025-09-05 09:04:21 -04:00
Mike McQuaid
6c98d2bf1b
Merge pull request #20625 from osalbahr/config-prioritize-pretty-name
config: Remove use of `/etc/redhat-release`
2025-09-03 11:07:03 +00:00
Osama Albahrani
de8ff312e6 config: Remove use of /etc/redhat-release 2025-09-02 23:24:07 +03:00
Osama Albahrani
ce8ae46054 config: prioritize ::OS_VERSION
On the [beta Bluefin LTS](https://docs.projectbluefin.io/lts), `brew config` reports:

```console
OS: CentOS Stream release 10 (Coughlan)
```

This is due to the `/etc/redhat-release` file being prioritized over `::OS_VERSION` (`PRETTY_NAME` from `/etc/os-release`).

On Bluefin LTS, `PRETTY_NAME` is `Bluefin LTS`.

This commit reverses the order so `brew config` has better detection:

```
OS: Bluefin LTS
```

I tested on RHEL 10 and the OS line only changed in that the word
"release" was omitted:

```
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 10.0 (Coughlan)
$ grep PRETTY_NAME /etc/os-release
PRETTY_NAME="Red Hat Enterprise Linux 10.0 (Coughlan)"
```

- This is an improvement on my previous PR https://github.com/Homebrew/brew/pull/15788
2025-09-02 22:50:36 +03:00
Ruoyu Zhong
214a88e434
os/mac: typed: strict
Co-authored-by: Bo Anderson <mail@boanderson.me>
2025-08-21 01:52:51 +08:00
Ruoyu Zhong
c98505baf7
os/linux/glibc: typed: strict 2025-08-21 01:28:16 +08:00
copilot-swe-agent[bot]
4ee43fbde1
Improve quarantine support error messages with specific CLT guidance
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-13 14:30:05 +01:00
Ruoyu Zhong
26021c9e36
os/linux/elf: bump to typed: strict
Also, clean up an unused method (`elf_parser`) from a previous conflict
resolution.

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-08-12 10:25:40 +08:00
Mike McQuaid
97c0bc7d0b
Merge pull request #20408 from Homebrew/fd-leak-fix
os/linux/elf: fix file descriptor leak
2025-08-11 12:10:16 +00:00
Xuehai Pan
b2d621ce6f os/linux/ld: do not crash the program if the ld.so.conf entry is not readable 2025-08-11 19:40:41 +08:00
Ruoyu Zhong
42b332055a
os/linux/elf: fix rpath precedence 2025-08-11 18:28:58 +08:00
Ruoyu Zhong
66737b5e82
os/linux/elf: fix file descriptor leak
On Linux, we occasionally see `EMFILE` ("too many open files") errors
especially when installing a large formula like `llvm`. Currently, this
can be reliably reproduced in a Homebrew/brew GitHub codespace (where
`ulimit -n` seems to be 1024 by default) with `brew install geeqie`,
with the following error message:

    Error: Too many open files @ rb_sysopen - /home/linuxbrew/.linuxbrew/Cellar/llvm/20.1.8/bin/tblgen-lsp-server

The reason is that each instance of `PatchELF::Patcher` keeps the ELF
file open. We prepend the `ELFShim` module to the `Pathname` class and
cache the patcher as an instance variable, which means that the ELF file
remains open so long as the `Pathname` instance is still alive even if
we don't need to access the ELF metadata anymore. When performing
certain checks (e.g., linkage), we also store these `Pathname`
instances, so the number of open file descriptors simply keeps
increasing.

We can fix that by not caching the patcher and only use it when
necessary. We create a patcher instance whenever we need to read or
write ELF metadata, and reading of metadata is consolidated into the
existing `ELFShim::Metadata` class so that we don't repeatedly create
patcher instances.

A fix for a file descriptor leak issue in patchelf.rb has been submitted
at https://github.com/david942j/patchelf.rb/pull/48. Together with that,
this fixes #19177, #19866, #20223, #20302.
2025-08-11 18:01:32 +08:00
Carlo Cabrera
a41de81890
Skip rpath relocation of ELF files with protodesc_cold sections
We have multiple formulae (e.g. `ola`, `openvino`, `opencv`, `or-tools`,
`pytorch`) that seem to be broken by `patchelf.rb` on x86_64 Linux.[^1] The
common thread seems to be the presence of a `protodesc_cold` section in
the ELF header.

Let's avoid breaking these bottles by skipping relocation when a binary
file has a `protodesc_cold` section. It will probably hurt
relocatability of these bottles, but that's better shipping broken
binaries.

[^1]: https://github.com/Homebrew/homebrew-core/pull/210860#issue-2918569212
2025-08-11 03:10:07 +08:00
Eric Knibbe
626b6aca2d
RubyDoc output fixes 2025-08-05 17:13:42 -04:00
Mike McQuaid
23971854b0
Fix file descriptor leak in Linux LD library path parsing
The library_paths method was using readlines which could leave file
descriptors open due to Ruby's garbage collection behavior. When
processing many packages during 'brew upgrade' or 'brew linkage',
this caused "Too many open files" errors on Linux systems.

Changes:
- Replace readlines with explicit file.open block to ensure proper closure
- Add caching to avoid repeatedly reading /etc/ld.so.conf during a session
- Cache included files as well to optimize recursive include processing

Fixes: #19866, #20302, #19177, #20223

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 15:19:07 +01:00
Mike McQuaid
d57efd9ea2
Improve some Pathname instance variable handling
Will fix or at least partly address:
```
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/elf.rb:225: warning: The class Pathname reached 8 shape variations, instance variables accesses will be slower and memory usage increased.
35
It is recommended to define instance variables in a consistent order, for instance by eagerly defining them all in the #initialize method.
```
2025-07-11 08:02:27 +00:00
Bo Anderson
b8e2cddbbd
Preliminary macOS 26 (Tahoe) support 2025-06-09 21:41:49 +01:00
Rylan Polster
da624601bb
os/mac/pkgconfig/15: update expat version 2025-06-04 15:46:41 -04:00
Sean Molenaar
32b9afd7cd feat: add linux tests 2025-01-19 12:32:55 +01:00
Sean Molenaar
c34b71655c feat: allow font install on linux
Apply suggestions from code review

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>

feat: add linux appdir

Apply suggestions from code review

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2025-01-19 11:14:24 +01:00
Michael Cho
5722d3dc8f
os/mac/pkgconfig/15: update expat version for 15.2 2024-12-19 12:08:02 -05:00
Carlo Cabrera
09fc83667c
os/mac: prefer newest Xcode when searching using mdfind
We're currently returning the first match for `com.apple.dt.Xcode`,
which could be any version if a user has multiple installed.

Instead, let's try to find the newest if all our results have an
`Info.plist` that we can interrogate for the version.

Maybe resolves #18736?
2024-11-08 23:04:49 +08:00
Michael Cho
252678692f
os/mac/pkgconfig: add bzip2.pc for rust formulae 2024-10-11 14:55:37 -04:00
Douglas Eichelberger
d3d25beb35 Use requires_ancestor consistently 2024-10-06 09:25:57 -07:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07:00
Bo Anderson
c76c902dbc
os/linux/elf: fix arch compat check on ppc 2024-10-01 05:32:58 +01:00
Carlo Cabrera
f0513c0d64
Merge pull request #18456 from Homebrew/skip-incompatible-arch 2024-09-30 22:54:50 +08:00
Carlo Cabrera
65731faf1d
os/linux/ld: handle nonexistent ld.so.conf more gracefully
Fixes #18458
2024-09-30 22:33:09 +08:00
Carlo Cabrera
6329db9065
Remove macOS implementation of #arch_compatible?
We don't really need this.
2024-09-30 22:29:03 +08:00
Carlo Cabrera
861d7b9087
linkage_checker: skip files with incompatible architectures
Some formulae include these files, and they can't always be removed.
However, they can cause spurious linkage failures, so let's skip them
when checking for linkage. See, for example, faust at
Homebrew/homebrew-core#191308.
2024-09-29 05:15:36 +08:00
Bo Anderson
9e00ebe320
os/mac: bump latest SDK version 2024-09-26 13:02:47 +01:00
Patrick Linnane
a7b316ea76
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-09-25 19:38:57 -07:00
BrewTestBot
6208436910
sorbet: Autobump sigils via Spoom
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2024-09-26 00:24:19 +00:00
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Mike McQuaid
d8fd19dde5
Merge pull request #18298 from Homebrew/curl-14.5
os/mac/pkgconfig/14: update libcurl for 14.5 SDK
2024-09-20 12:55:02 +01:00
Carlo Cabrera
1656d08629
os/linux/ld: drop retry logic
This is a hack, so let's see if we can get away with skipping it for
now.
2024-09-17 11:51:27 +08:00
Carlo Cabrera
70ab4932d3
Add link to issue with context 2024-09-17 01:03:34 +08:00
Carlo Cabrera
bb20b3c720
os/linux/ld: harden brewed_ld_so_diagnostics against TypeError
I think this is a bug in Ruby, but I've no idea how to track it down. I
can reproduce it intermittently in a codespace when `brew install`ing a
large number of formulae.

To work around this:
- cache the return value of `brewed_ld_so_diagnostics` so that we can
  limit the number of calls to `IO.popen`
- retry once when we see a `TypeError`

Closes #17828.
2024-09-16 20:26:35 +08:00