36418 Commits

Author SHA1 Message Date
Mike McQuaid
b8c82b44b8
Merge pull request #20425 from Homebrew/internal-api-helper
Create `Homebrew::API::Internal` for working with internal API
2025-08-12 07:32:18 +00:00
Mike McQuaid
e9bc015f9a
Merge pull request #20429 from Homebrew/simplify-to-hash-with-variations-from-api
Store API data in formulae/casks for use in `to_hash_with_variations`
2025-08-12 07:25:34 +00:00
Rylan Polster
cf450d9948
Create Homebrew::API::Internal
Add type aliase and fix cask content issue
2025-08-12 02:40:48 -04:00
Carlo Cabrera
b89d4ef633
shims/super/rustc_wrapper: fix comment
In #20424, we moved `HOMEBREW_RUSTFLAGS` to the end of the compiler
invocation, but didn't update the comment. Let's fix that.

While we're here, let's fix these `shellcheck disable`s.
2025-08-12 14:15:14 +08: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
Rylan Polster
8aabee74a6
Store cask API data for use in to_hash_with_variations 2025-08-11 22:06:07 -04:00
Rylan Polster
8dccdd8e60
Store formula API data for use in to_hash_with_variations 2025-08-11 22:06:07 -04:00
Rylan Polster
ff5edb73c2
Don't query analytics for third-party formulae/casks in brew info 2025-08-11 18:54:09 -04:00
Rylan Polster
5e2b54881c
Use hash for internal cask API 2025-08-11 15:03:05 -04:00
Mike McQuaid
bcc3a0dbef
Merge pull request #20424 from Homebrew/rustc_wrapper
rustc_wrapper: pass `HOMEBREW_RUSTFLAGS` last
2025-08-11 17:01:40 +00:00
Carlo Cabrera
63a8fd7a4a
rustc_wrapper: pass HOMEBREW_RUSTFLAGS last
If we pass it first, it can be overridden by other arguments passed on
the command line. We don't want that.

See discussion at Homebrew/homebrew-core#232566.
2025-08-12 00:46:05 +08:00
Carlo Cabrera
ef89522446
os/linux/keg_relocate: remove protodesc_cold exclusion
This needs to be handled more carefully. It probably works fine for
bottles built *after* this change was added, but it breaks bottles built
before this exclusion was added.

Let's remove it for now to limit the extent of the breakage.
2025-08-12 00:27:39 +08:00
Mike McQuaid
04b47bc1aa
Merge pull request #20406 from Homebrew/alias-rename-migrations-internal-api
Cleanup internal API handling
2025-08-11 13:58:38 +00:00
Mike McQuaid
278271c969
Merge pull request #20391 from Homebrew/dug/service-refactor
Simplify Service attr helper methods
2025-08-11 13:36:01 +00:00
Issy Long
d0e9a2d7d6
Always suggest a HEAD branch name if we can find one
- If a HEAD branch name isn't specified at all, then the user probably
  wants to shortcut adding one by being told what the default branch for
  the repo is. Otherwise they have to click the URL, look at the GitHub
  UI, then type the branch name into `branch: "foo"` syntax.
2025-08-11 13:46:49 +01:00
Mike McQuaid
38415d8600
Merge pull request #20413 from Homebrew/cask-audit-signing-skiplist
cask/audit: add skiplist for signing audit
2025-08-11 12:28:33 +00: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
Bevan Kay
c83f77b091
cask/audit: add skiplist for signing audit 2025-08-11 22:08:05 +10: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
Mike McQuaid
2992b7f519
Merge pull request #20404 from Homebrew/rubocops_patches_corrector_tests
patches audit: add tests for patches corrector
2025-08-11 07:48:00 +00:00
Mike McQuaid
cf21efc318
Merge pull request #20405 from Homebrew/cask-audit-separate-artifacts
cask/audit: iterate over artifacts in rosetta/signing audit
2025-08-11 07:30:52 +00:00
Mike McQuaid
352cc39523
Merge pull request #20407 from Homebrew/build-log-ext
formula: append `.log` to formula build log filenames
2025-08-11 07:30:10 +00:00
Bevan Kay
12f6e871c7
cask/audit: apply suggestion from code review
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-08-11 15:26:44 +10:00
Bevan Kay
5c06d6f184
cask/audit: apply suggestion from code review
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-08-11 15:26:36 +10:00
Carlo Cabrera
718b82560a
formula: append .log to formula build log filenames
Having log files with extensions like `.cc` and `.cmake` is really
unfriendly to editor syntax highlighters and language servers. Let's try
to make sure these are opened as log files by adding a `.log` extension
to them.
2025-08-11 13:10:14 +08:00
Rylan Polster
480eeb4246
Enable download queue for single formula/cask API fetches 2025-08-11 00:43:34 -04:00
Rylan Polster
d3aac3fa5f
Include aliases, renames, and tap migrations in minimal APIs 2025-08-11 00:37:50 -04:00
Rylan Polster
97d299728d
Cleanup internal API handling 2025-08-11 00:37:50 -04:00
Bevan Kay
34f659cb64
cask/audit: iterate over artifacts in rosetta/signing audit 2025-08-11 14:12:34 +10:00
Issy Long
05b27aa847
Disallow head do blocks with only url and branch
- Since `head` must now specify a url and branch, the `head do` block
  with only these stanzas can be condensed to the single-line
  `head "url", branch: "branch"` format.
2025-08-10 20:52:58 +01:00
Thierry Moisan
9de0395c3b
patches audit: add tests for patches corrector 2025-08-10 15:33:35 -04:00
Issy Long
37eaed5bb7
Ensure that head Git URLs always specify a branch
- There's a TODO on the "someday" list [1] to ensure that `head` Git
  URLs always specify a branch.
- So I thought I'd automate this worry by adding an audit.
- Since `resource` block URLs tend to be pinned to SHAs, if indeed
  they are Git URLs, this audit only applies to `head` URLs.

[1]: https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=98789749
2025-08-10 20:28:50 +01: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
Douglas Eichelberger
899a6c5977
Try non-nil params 2025-08-10 09:37:57 -07:00
Carlo Cabrera
a7c124c2d0
brew.sh: enforce HOMEBREW_FORCE_BREW_WRAPPER more strictly
`HOMEBREW_FORCE_BREW_WRAPPER` can be used as a security/compliance
feature, but allowing it to be disabled by setting
`HOMEBREW_NO_FORCE_BREW_WRAPPER` leaves a pretty large hole in it that
allows it to be sidestepped.

Let's fix that by actually checking the path of the process that called
`brew`, and the verify that that path matches the configured value of
`HOMEBREW_NO_FORCE_BREW_WRAPPER`.
2025-08-09 03:15:53 +08:00
Ruoyu Zhong
dbe68ef80c
Merge pull request #20399 from Homebrew/spdx-revert
Revert "spdx: update license data."
2025-08-08 14:28:40 +00:00
Ruoyu Zhong
e8a892e2b0
utils/spdx: use refs/tags/ URL to fetch SPDX data 2025-08-08 16:01:51 +08:00
Ruoyu Zhong
d7a365c3f1
Revert "spdx: update license data."
This reverts commit de66adff6f632a6bb300fb08dab55733338322e7.
2025-08-08 16:01:13 +08:00
Mike McQuaid
7df24d03f2
download_queue: add missing require.
We use `Resource` in a few places here so need to require it.
2025-08-08 08:33:26 +01:00
BrewTestBot
de66adff6f
spdx: update license data.
Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/spdx.yml).
2025-08-08 00:19:22 +00:00
Mike McQuaid
a10e4230b4
Merge pull request #20393 from AlternateRT/docs-improve-autobump
docs: improve Autobump documentation
2025-08-07 12:50:11 +00:00
AltCode
54cfbe15ae
autobump_constants: improve reason descriptions 2025-08-07 14:32:56 +02:00
Mike McQuaid
0a9fec107e
Merge pull request #20396 from Homebrew/more_pathname_types
extend/pathname: fix another type error.
2025-08-07 08:47:07 +00:00
Mike McQuaid
0a881b9a0d
extend/pathname: fix another type error.
Let's make this consistent with the rest of this file.
2025-08-07 09:32:22 +01:00
Mike McQuaid
54c4cfaaaa
Merge pull request #20395 from Homebrew/pathname_types
extend/pathname: fix type error.
2025-08-07 08:21:08 +00:00
Mike McQuaid
ad48b5a5f5
Merge pull request #20392 from jrouly/jrouly/content-type-patch
handle false content_type
2025-08-07 08:12:12 +00:00
Mike McQuaid
9f52a57e58
Merge pull request #20390 from Homebrew/show-rejected-hash
download_queue: display hash of rejected download
2025-08-07 08:09:38 +00:00
Mike McQuaid
31e12d68e3
extend/pathname: fix type error.
`install_p` is sometimes called with a `Pathname` for `new_basename`.
2025-08-07 09:05:40 +01:00