1153 Commits

Author SHA1 Message Date
Bo Anderson
e4623cc8f4
Improve performance of brew readall 2023-09-28 14:05:09 +01:00
Francois-Xavier Coudert
e1ca3b5c35 superenv: help gettext-based configure scripts 2023-09-14 15:19:48 +02:00
Steve Peters
94ef9a4b7a codesign in keg_relocate instead of keg methods
Currently the codesign_patched_binary method may be called many
times for the same file when installing a keg.

This removes the calls to codesign_patched_binary from os/mac/keg
and adds a single call to the relocate_dynamic_linkage and
fix_dynamic_linkage methods in extend/os/mac/keg_relocate
to speed up keg installation.
2023-09-09 18:14:28 -07:00
Mike McQuaid
f30788018c
os/mac/hardware: remove TODO.
As discussed in #15938, this TODO can pretty much never be done so
doesn't make sense to leave as-is.
2023-09-02 21:36:27 -04:00
Michael Cho
bc2bb59726
extend/os/linux/system_config: show glibc/gcc version for API users 2023-08-26 22:19:32 -07:00
Michael Cho
7412487891
extend/os/mac/keg: codesign on Intel if invalid signature 2023-08-23 11:48:13 -07:00
Douglas Eichelberger
d01cda2815 Turn up the types 2023-08-12 22:01:22 -07:00
Carlo Cabrera
dbeac59584
keg_relocate: retain framework info in relocatable install names
`dyld` uses the target library's install name to work out whether this
is a Framework or a dylib, which affects how `dyld` searches for the
desired library.

We should therefore avoid confusing `dyld` by including the
`*.framework` part of the install name in the target dylib, which is
what this change does.

Here's a concrete example of what this changes. Before:

    ❯ otool -L /usr/local/bin/python3
    /usr/local/bin/python3:
            @loader_path/../Python (compatibility version 3.11.0, current version 3.11.0)
            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)

After:

    ❯ otool -L /usr/local/bin/python3
    /usr/local/bin/python3:
            @loader_path/../../../../Python.framework/Versions/3.11/Python (compatibility version 3.11.0, current version 3.11.0)
            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)

By retaining the `Python.framework` part of the install name, we make
sure that `dyld` knows that it should be looking for a framework rather
than a dylib.
2023-08-07 14:43:56 +08:00
Mike McQuaid
71888db8ba
bottle: reproducibility fixes.
I noticed from
https://github.com/Homebrew/homebrew-core/actions/runs/5751070010 that
we're no longer creating reproducible bottles between macOS and Linux.

All macOS checksums have changed but Linux ones have not. The main
difference between the two platforms is the `gtar` version used so let's
always just use the formula on both platforms.

While we're here, clear up the ordering and comments a little on the
reproducible `tar` arguments so that it's easier to compare with the
reproducible builds archives documentation.
2023-08-04 10:02:44 +01:00
Ruoyu Zhong
99607e8ec4
development_tools: allow Symbols to be located
Fixes error seen in Homebrew/homebrew-core#138452.
`DevelopmentTools.default_compiler` can return a `Symbol` like `:clang`.
Make sure its result can be fed to `DevelopmentTools.locate`.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-08-04 11:26:30 +08:00
Carlo Cabrera
6b728bf3bd
Implement ruby-macho TODOs
We now have the new release of ruby-macho (#15758), so we can now
finish off the remaining work from #15731.
2023-07-26 11:15:19 +08:00
Douglas Eichelberger
08e46c18cd Add type to Formula attrs 2023-07-24 14:12:36 -07:00
Carlo Cabrera
4c73942fae
extend/os/mac/keg_relocate: improve rpath handling
This implements the TODO that I left as a comment from #15722.

In order to simplify the handling of deleting an absolute rpath that has
a relative duplicate (or vice-versa, i.e., a relative rpath with an
absolute duplicate), we relocate all rpaths first in one pass and then
delete the duplicates in a separate pass.

We currently rely on some lower-level (but still public) methods from
ruby-macho since the standard `#delete_rpath` method changes the order
in which rpaths are resolved. We can switch back to using
`#delete_rpath` when Homebrew/ruby-macho#555 is merged and released.
2023-07-23 00:22:05 +08:00
Carlo Cabrera
aa05c227a0
os/mac/keg_relocate: avoid rpath re-ordering
This should fix the failures seen for `julia` in Homebrew/core.[^1]

I've detailed a better/more comprehensive fix as a `TODO` in a comments.
However, the problems that the better fix would avoid are comparatively
unlikely, so I think we can try this one out for now while I work on
implementing the said fix.

[^1]: https://github.com/Homebrew/homebrew-core/pull/135398#issuecomment-1643041541
2023-07-20 21:49:18 +08:00
Patrick Linnane
c56669e9cd
various: fix miscellaneous typos 2023-07-18 08:52:49 -07:00
Carlo Cabrera
27032e002f
os/mac/keg_relocate: avoid changing to an already existing rpath
Doing `change_rpath(old, new, file)` will error if `new` is already an
rpath for `file`. When this happens, `old` is no longer needed, so we
can delete it.

Fixes a build failure at shivammathur/homebrew-php#1848.
2023-07-18 20:47:10 +08:00
Mike McQuaid
fb35578c54
Merge pull request #15676 from Bo98/tap-fixes
Introduce CoreCaskTap class and fix cases of core taps were being unnecessarily installed
2023-07-17 19:22:22 +01:00
Carlo Cabrera
a7c8aab68c
os/mac/keg_relocate: replace Cellar references in rpaths
Some formulae (e.g. `php`) use rpaths that reference Cellar paths
belonging to other formulae. Let's make sure these rpaths don't break by
making them use opt paths instead.
2023-07-17 14:09:35 +08:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
Carlo Cabrera
cff8d8c155
Merge pull request #15571 from gerlero/relocate-relative-names
mac/keg_relocate: use relative install names
2023-07-11 04:38:26 +08:00
Gabriel Gerlero
15a0c7fd7d linkage_checker: resolve some variable install names on macOS 2023-07-06 14:15:14 -03:00
Gabriel Gerlero
4cfe70ce50 mac/keg_relocate: use relative install names 2023-07-06 13:34:14 -03:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Bo Anderson
71d51faa55
Introduce tag for implicit dependencies 2023-07-04 13:40:58 +01:00
Mike McQuaid
75dd070395
Remove Google Analytics
We are now entirely migrated to InfluxDB so can remove all GA code.
2023-06-16 10:33:15 +01:00
Carlo Cabrera
e8dd8c2a87
keg_relocate: match /tmp more strictly
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-05-22 20:53:55 +08:00
Carlo Cabrera
59d92ab73f
keg_relocate: fix check for paths rooted in build directory
Stuff built by CMake evades this check because CMake normalises
`/private/tmp` (which is the default `HOMEBREW_TEMP`) to `/tmp`. See
https://gitlab.kitware.com/cmake/cmake/-/issues/23251.

Let's fix that my taking this into account when `HOMEBREW_TEMP` is
`/private/tmp`.
2023-05-22 17:18:43 +08:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Carlo Cabrera
9b369871e6
Revert "utils/bottles: fix typechecking error"
This reverts commit 071f6069d2cff272eaa9404f836cb1254c4fb588.
2023-05-08 21:43:12 +08:00
Carlo Cabrera
071f6069d2
utils/bottles: fix typechecking error
https://github.com/Homebrew/homebrew-core/actions/runs/4915420737/jobs/8777887066?pr=130438#step:5:27
2023-05-08 21:07:58 +08:00
Samuel Lo
41aab1490a bottle: some tar flags is not supported on Mojave 2023-05-04 04:01:51 +08:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
hyuraku
a41a7c94d8 remove cask/cmd 2023-04-19 21:30:42 +09:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
Markus Reiter
38695f96c7
Don't use deprecated Kernel#shell_profile. 2023-04-14 21:14:44 +02:00
Bo Anderson
8c69c95417
Merge pull request #15204 from Bo98/portable-ruby-2.6.10_1
Portable Ruby 2.6.10_1
2023-04-12 16:13:36 +01:00
Bo Anderson
e2aae0fa63
Require Ruby 2.6.10 2023-04-12 13:15:34 +01:00
Ruiyang Wu
73a1380055 dev-cmd/bottle: Refactor setup_tar_and_args! to extend/os 2023-04-11 11:00:47 -04:00
Douglas Eichelberger
a237a1ff9f Update call sites 2023-04-04 18:14:54 -07:00
Douglas Eichelberger
bc588cc04f Fix tests 2023-04-02 16:38:30 -07:00
Douglas Eichelberger
4df5a80c73 brew style --fix 2023-04-02 12:25:55 -07:00
Douglas Eichelberger
0079cefc95 Enable types in remaining untyped extensions 2023-04-02 12:24:11 -07:00
Douglas Eichelberger
6397229f68 Enable types in extensions, etc. 2023-04-01 18:56:42 -07:00
apainintheneck
9835d1a681 formula: add missing extend/os require
This allows Formula#valid_platform? to work correctly on MacOS.
2023-03-28 11:38:58 -07:00
Mike McQuaid
6024f4aa3f
Merge pull request #15068 from MikeMcQuaid/more_update_tweaks
More update tweaks
2023-03-28 09:25:20 +01:00
Mike McQuaid
eef6e9bf05
Merge pull request #15072 from apainintheneck/search-by-platform
search: show results by platform
2023-03-28 09:07:46 +01:00
Mike McQuaid
b97db86a26
Merge pull request #15057 from dduugg/enable-types
Enable types in Formula files
2023-03-28 08:57:17 +01:00
Carlo Cabrera
f75c56a90d
Merge pull request #14873 from carlocab/no_fixup_chains
Pass `-no_fixup_chains` to linker when required
2023-03-28 12:25:48 +08:00