2527 Commits

Author SHA1 Message Date
Eric Knibbe
37315cf8ad
write_env_script: allow setting args without env 2025-09-01 10:51:28 -04:00
Douglas Eichelberger
240fd71e6f
Avoid repeated calls to affix checks 2025-08-31 11:11:41 -07:00
Rylan Polster
7802a80613
Remove redundant T.bind(self, Pathname) 2025-08-25 12:57:48 -04:00
Rylan Polster
763531e821
Extract Pathname refinement from Formulary 2025-08-25 04:08:42 -04:00
Mike McQuaid
82fabab8aa
Merge pull request #20560 from Homebrew/dug/typed-kernel
Enable strict typing in Kernel extensions + utils.rb
2025-08-25 07:31:58 +00:00
Douglas Eichelberger
6a25de5daf
Rename formula_support to keg_only reason, refactor slightly 2025-08-24 14:57:19 -07:00
Douglas Eichelberger
2dc4c7a4d2
Rename Volumes.which to avoid incompatible override 2025-08-24 14:34:31 -07:00
Douglas Eichelberger
ceb2291be1
Enable strict typing in Kernel extensions + utils.rb 2025-08-23 18:44:36 -07:00
Mike McQuaid
3bbff84ff1
Merge pull request #20525 from Homebrew/utils_output
Move `o*` output methods to `Utils::Output`
2025-08-22 09:10:29 +00:00
Mike McQuaid
a1f112f3fe
Move o* output methods to Utils::Output
This reduces the surface area of our `Kernel` monkeypatch and removes
the need to `include Kernel` in a bunch of modules.

While we're here, also move `Kernel#require?` to `Homebrew` and fully
scope the calls to it.
2025-08-20 19:20:19 +01:00
Ruoyu Zhong
214a88e434
os/mac: typed: strict
Co-authored-by: Bo Anderson <mail@boanderson.me>
2025-08-21 01:52:51 +08:00
Mike McQuaid
6db1f6a052
**/diagnostic.rb: add Sorbet strict sigil.
Making more files `typed: strict` slowly but surely.
2025-08-19 09:10:24 +01:00
Mike McQuaid
59f0197450
os/linux/diagnostic: make check_for_symlinked_home doctor-only.
This avoids printing it every time a `brew install` is run.
2025-08-19 08:30:06 +01:00
Mike McQuaid
22fdb11e00
**/keg_relocate.rb: add set Sorbet typed: strict
Other files have been changed where required.
2025-08-18 15:02:15 +01:00
Mike McQuaid
de68a0c3a1
Merge pull request #20482 from Homebrew/dug/no-which_all
Remove unused 'which_all' Kernel ext
2025-08-18 07:49:13 +00:00
Mike McQuaid
4ae4bd491a
Merge pull request #20481 from Homebrew/dug/typed-ologger
Type remaining Kernel logging extensions
2025-08-18 07:48:55 +00:00
Douglas Eichelberger
bdc219a39a
Move 'paths' out of Kernel 2025-08-16 16:38:27 -07:00
Douglas Eichelberger
793da6e0be
Remove unused 'which_all' Kernel ext 2025-08-16 16:18:26 -07:00
Douglas Eichelberger
0e064fdc3a
Type remaining Kernel log extensions 2025-08-16 13:07:19 -07:00
Eric Knibbe
e021953db4
messages/comments: formatting fixes 2025-08-16 00:54:50 -04:00
Mike McQuaid
d135e744b1
Add more Sorbet types
`typed: strict` a few more places and fix other files necessarily to
make that happen.
2025-08-15 19:21:28 +01: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
copilot-swe-agent[bot]
4ad7d59a25
Implement pkg-config macOS SDK mismatch diagnostic check
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-13 09:03:26 +01:00
Carlo Cabrera
e0a69316b7
Merge pull request #20434 from Homebrew/new-protodesc_cold-fix
os/linux/keg_relocate: skip ELF files with `protodesc_cold` only when bottling
2025-08-13 04:07:32 +00:00
Carlo Cabrera
c9060c3242
Improve test for bottling 2025-08-13 09:51:27 +08:00
Carlo Cabrera
6457770a59
os/linux/keg_relocate: skip ELF files with protodesc_cold only when bottling
We removed this exclusion in #20423 because it broke pouring of existing
bottles, which still need relocation.

Let's skip relocation only when bottling, to avoid breaking existing
bottles that need to be relocated when pouring.
2025-08-13 00:25:53 +08:00
copilot-swe-agent[bot]
d785e2024b
Add symlinked home detection to brew doctor on Linux
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-12 11:00:14 +01: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
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
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
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
Ruoyu Zhong
10e2c2b298
extend/pathname: accept String as target in write_env_script
There is too much existing usage outside of Homebrew for us to break
[1].

[1]: https://github.com/search?q=%22write_env_script%20%5C%22%22%20NOT%20org%3AHomebrew%20NOT%20is%3Afork&type=code

Closes https://github.com/Homebrew/homebrew-core/pull/232573.
2025-08-07 08:13:15 +08:00
Mike McQuaid
e6ba71c5b1
Add rustc wrapper shim to fix RUSTFLAGS conflicts
Fixes #18556 by using RUSTC_WRAPPER instead of setting RUSTFLAGS directly.
This allows Homebrew's optimization flags to coexist with .cargo/config.toml
settings, preventing build failures when projects have their own Rust
configuration.

- Add rustc_wrapper shim that clears RUSTFLAGS and prepends HOMEBREW_RUSTFLAGS
- Update both std and super environments to use RUSTC_WRAPPER
- Store Homebrew's rustflags in HOMEBREW_RUSTFLAGS instead of RUSTFLAGS

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

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-08-06 17:06:25 +01:00
Eric Knibbe
626b6aca2d
RubyDoc output fixes 2025-08-05 17:13:42 -04:00
Mike McQuaid
31150c1951
extend/kernel: remove ensure_formula_installed!
This was a private API so there's no need to deprecate it.
2025-08-04 17:07:31 +01:00
Eric Knibbe
6255263b51
output: express environment variables consistently 2025-08-04 09:50:06 -04:00
Alexander Bayandin
358291e841 extend/kernel: allow exec_editor to open multiple files at once 2025-08-03 16:44:19 +01:00
Daeho Ro
af7966cb2a
pathname: add type to 2025-08-03 18:23:47 +09:00
Carlo Cabrera
a29a643c66
Merge pull request #20359 from Homebrew/replace-ensure_formula_installed!
Replace `ensure_formula_installed!` with `Formula#ensure_installed!`
2025-08-01 21:13:59 +00:00
Carlo Cabrera
0fd3b8e4af
Uncomment odeprecated
This is close enough to #20331 to do now.
2025-08-02 04:00:52 +08:00
Carlo Cabrera
fb35add3b6
Replace ensure_formula_installed! with Formula#ensure_installed!
`ensure_formula_installed!` requires the `Formula` class to be loaded
before being called to work properly.

Let's guarantee that instead by implementing it as an instance method of
the `Formula` class.

See discussion at #20358.
2025-08-02 03:43:37 +08:00
Carlo Cabrera
9dc111247f
Merge pull request #20358 from Homebrew/require-formula-ensure-formula-installed
Ensure we `require "formula"` before doing `ensure_formula_installed!`
2025-08-01 19:21:35 +00:00
Carlo Cabrera
cc5df09845
Ensure we require "formula" before doing ensure_formula_installed!
This is needed to avoid Sorbet runtime errors. See #20352.
2025-08-02 02:46:38 +08:00
Carlo Cabrera
1fc4225850
Merge pull request #20357 from Homebrew/more-extend-kernel-sigs
extend/kernel: tighten type sig for `ensure_formula_installed!`
2025-08-01 18:44:44 +00:00
Carlo Cabrera
f2c32156e8
Merge pull request #20356 from Homebrew/kernel-sigs
extend/kernel: tighten up some type signatures
2025-08-01 18:32:48 +00:00
Carlo Cabrera
cf6c5acce0
extend/kernel: tighten type sig for ensure_formula_installed!
This does the same as #20356 for `ensure_formula_installed!`. See
discussion at #20352.

Unfortunately, one must still `require "formula"` before using this
method because of the `returns(Formula)`, but tightening the type
signature is generally a good idea anyway.

Closes #20352.
2025-08-02 02:23:47 +08:00
Carlo Cabrera
a0a78e6c6c
Remove support for passing Formulae to pretty_*ed methods
It doesn't look like these are even needed.
2025-08-02 02:11:12 +08:00
Carlo Cabrera
a76c33f7bb
extend/kernel: tighten up some type signatures
Allowing either `Formula`e or `String`s in these methods leads to errors
at runtime when one hasn't done `require "formula"` yet.

Let's tighten these up so that they only accept `Formula` arguments to
guarantee that `require "formula"` has been done before they are called.
For callers that need to pass a `String`, we update them to call a
version of these methods that accepts only `String`s.

See discussion at #20352.
2025-08-02 01:59:46 +08:00
Mike McQuaid
d1a33283c6
observer_pathname_extension: add strict Sorbet types. 2025-08-01 17:11:50 +01:00