1247 Commits

Author SHA1 Message Date
Mike McQuaid
b622c36be6
Add, use uses_from_macos_names.
This strips e.g. `:build` tags.
2021-09-14 09:48:19 +01:00
Bo Anderson
8dd11e4e4c
Set uses_from_macos_elements in all cases 2021-09-14 04:06:40 +01:00
Mike McQuaid
a6e4e195c1
rubocops/lines: recommend on_os/OS.os? based on context.
Recommend the use of `on_macos` and `on_linux` unless we're in
`def install`, `def post_install` or `test do` in which case recommend
`OS.mac?` and `OS.linux?` instead.
2021-09-08 13:18:07 +01:00
Mike McQuaid
7c37a34cca
Merge pull request #11927 from FnControlOption/fetch
fetch: fix `--bottle-tag` when unbottled on host system
2021-09-01 16:08:05 +01:00
Rylan Polster
5d536d66fc
Rename HOMEBREW_JSON_CORE to HOMEBREW_INSTALL_FROM_API 2021-08-27 00:24:15 -04:00
FnControlOption
b9fc4e36f0 fetch: fix --bottle-tag when unbottled on host system 2021-08-26 14:44:53 -07:00
Carlo Cabrera
6f7489e52c
formula: make extract_macho_slice_from private
Based on feedback from #11756.
2021-08-18 11:51:08 +08:00
Carlo Cabrera
0ae032ad2f
Merge pull request #11756 from carlocab/deuniversalize-machos
formula: add `deuniversalize_machos` method
2021-08-18 02:28:34 +08:00
Carlo Cabrera
f20d61df9a
Fix typecheck error 2021-08-17 22:47:08 +08:00
Carlo Cabrera
fa635db8a1
Simplify re-definition of targets 2021-08-17 22:32:52 +08:00
Bo Anderson
e8b82bbe1e
Fix brew style 2021-08-13 13:49:52 +01:00
Carlo Cabrera
12435565f3
formula: allow std_cmake_args to take parameters
We have a handful of of formulae that do `std_cmake_args.reject` to
override some of flags (e.g. emscripten, icemon, ortp, qt, klee,
watchman).

Let's try to simplify some of this code by allowing these formulae to
override these flags by passing arguments to `std_cmake_args`.

While we're here, let's update the type signature of `std_cargo_args`.
2021-08-10 11:55:00 +08:00
Rylan Polster
737dd1654b
Refactor API methods 2021-08-06 04:31:27 -04:00
Sean Molenaar
869b0ea519
Formula: use opt_prefix for service helpers 2021-07-26 11:11:34 +02:00
Carlo Cabrera
542694728c
codesign binaries on ARM 2021-07-25 23:21:26 +08:00
Carlo Cabrera
5128b92d3e
Use slightly more suggestive method name for extracting slices
`extract_slice_from` is still a little ambiguous, so let's try to give
it a more suggestive name.
2021-07-25 11:29:33 +08:00
Carlo Cabrera
a8527f4c16
Ensure writability, handle errors 2021-07-24 19:39:47 +08:00
Carlo Cabrera
5e0b786da2
formula: add deuniversalize_machos method
This method takes an optional array of `Pathnames`s or `Strings`s and
extracts the native slice from the specified universal binary. If no
parameter is supplied, this is done on all compatible universal binaries
in a formula's keg.

`deuniversalize_machos` is a no-op on Linux.

I still need to look into a) error handling, and b) whether using this
method requires codesigning on ARM.

I've also added signatures to the methods in `extend/os/linux/formula`.
2021-07-22 01:24:56 +08:00
Sam Ford
2fe77f5271
Formula: Allow configuration of std_cargo_args 2021-07-20 18:04:35 -04:00
Carlo Cabrera
4d77e01273
Remove on_macos block 2021-07-20 09:07:09 +08:00
Carlo Cabrera
1ceaa2ebd3
formula: add :default_prefix as a standard pour_bottle? requirement
See discussion at Homebrew/homebrew-core#81408.
2021-07-19 20:26:02 +08:00
Rylan Polster
672f6dc3d7
formula: fix latest_version_installed? for HOMEBREW_JSON_CORE 2021-07-16 12:14:15 -04:00
Rylan Polster
98713e9cd1
BottleAPI: only fetch dependencies if they are outdated locally 2021-07-14 02:39:32 -04:00
Dawid Dziurla
2a9f962747
Merge pull request #11691 from dawidd6/fetch-bottle-tag
fetch: add --bottle-tag flag
2021-07-13 18:51:42 +02:00
Dawid Dziurla
793371a348
fetch: add --bottle-tag flag 2021-07-13 18:03:04 +02:00
Rylan Polster
e344cb6aff
Merge pull request #11648 from Rylan12/homebrew-json
Install formulae from JSON files
2021-07-13 02:54:49 -04:00
Rylan Polster
1e34b69cd4
Prioritize installing from JSON if env var is set 2021-07-12 03:23:42 -04:00
Rylan Polster
b68e17552c
Only use BottleAPI::latest_pkg_version with env var 2021-07-06 09:33:16 -04:00
Carlo Cabrera
3776ba9756
formula: add a time method for use as the build time
A number of formulae use a variant of `Time.now` to generate the build
time of the formula. Let's define a method to make sure that:

1. it uses `SOURCE_DATE_EPOCH` whenever available; and,
2. it uses `utc`.

Both should help with build reproducibility.

See Homebrew/homebrew-core#80608.
2021-07-06 12:26:03 +01:00
Rylan Polster
e316c4f013
Rename Utils::BottleAPI to BottleAPI 2021-07-05 11:45:15 -04:00
Rylan Polster
ca5f6026ed
Fix tests 2021-07-05 11:29:27 -04:00
Rylan Polster
22f986b89a
Install formulae from JSON files 2021-07-04 12:38:59 -04:00
Carlo Cabrera
294afc20f8
formula: capture logs more comprehensively
Currently, we copy `config.log` and `CMakeCache.txt` from the root of
the source tree into the the logs generated by the build. This has three
shortcomings:

1. These files are not necessarily found where we look. This is often
   the case with a CMake build, but can occur with an Autotools build
   as well (e.g. GCC, or any other out-of-tree build).
2. There may be several of these files scattered throughout the build
   tree. This occurs, for example, when the build itself invokes
   `configure` or `cmake` as part of the build process.
3. We don't copy `CMakeOutput.log` or `CMakeError.log`, which are
   usually more informative about what happened during the CMake
   invocation. It is not sufficient to add them to the array of log
   files that we copy because these are never found at the source root,
   even when building in-tree.

Let's rectify this by copying all instances of these files that can be
found in the source tree. Since there will inevitably be duplicate file
names, we also store them in the log directory using the same relative
paths from the source root. [1] This has the added benefit of providing
context for these log files.

[1] For example, if `CMakeOutput.log` can be found in `build/CMakeFiles`
relative to the source root, then that will also be where it will be
stored in the log directory.
2021-06-24 19:12:40 +01:00
Alexander Bayandin
7aacda1754
formula: add fuzzy_search method 2021-06-22 18:06:52 +01:00
Mike McQuaid
30a65342e8
Deprecate, disable, delete code for Homebrew 3.2.0
Do the usual deprecation, disable, delete dance for Homebrew 3.2.0.
2021-06-17 11:34:32 +01:00
Rylan Polster
4de44c771d
formula: improve to_recursive_bottle_hash 2021-06-09 13:57:14 -04:00
Rylan Polster
a2a92ba375
Update Library/Homebrew/formula.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-06-07 10:19:14 -04:00
Rylan Polster
aebaa7f8df
formula: only include sha256 for core formulae in bottle JSON 2021-06-05 12:31:55 -04:00
Rylan Polster
d60f549a48
info: add --bottle option for JSON bottle info 2021-06-05 12:27:24 -04:00
Rylan Polster
f8a58c27a0
formula: use declared_runtime_dependencies in to_bottle_hash 2021-06-03 13:33:26 -04:00
Rylan Polster
8b0f7e7ada
formula: add to_bottle_hash method 2021-06-03 12:59:42 -04:00
Rylan Polster
56f723339d
formula: reject only the latest head keg when cleaning up 2021-06-01 03:25:26 -04:00
Chandler Carruth
578fe41657
Stop overriding CMake's release compile flags.
These flags include basic compiler optimization flags without which software can get built completely unoptimized.

While the shims appear to add their own optimization flag on macOS (at least, based on my ARM testing), they do not in the default Linux build which results in CMake packages like LLVM being built without optimizations. This both results in a very large bottle and exceedingly bad performance.

This seems like the best fix to me, as the shims already seem to have the necessary logic to *re-map* optimization flag levels to what Homebrew prefers for platforms like macOS, and so leaving CMake alone to just do its thing seems like the cleanest solution. But I'm open to other suggested fixes if needed.

I will note that without this, LLVM and any other CMake-built software on Linux is ... mostly unusable for me.
2021-05-29 22:12:50 -07:00
Connor Mann
ab822ced36
Update comment 2021-05-29 13:16:27 -04:00
Connor Mann
e4ffad629c
Don't uninstall latest non-head with --HEAD 2021-05-29 13:16:27 -04:00
Rylan Polster
2120d285be
formuala: update pour_bottle? docs 2021-05-20 11:34:12 -04:00
Rylan Polster
745d7ff813
formula: use only_if: in pour_bottle? 2021-05-20 11:24:08 -04:00
Carlo Cabrera
3c34c13056
formula: tweak preset pour_bottle? symbols
Let's rename `reason` to `requirement` so the preset symbol can just be
`:clt`. See Homebrew/homebrew-core#77509.
2021-05-19 02:21:59 +01:00
Rylan Polster
69e29a358b
Raise errors on invalid symbol/block combinations 2021-05-17 15:33:09 -04:00
Rylan Polster
fb3bfbb65c
Remove prefix option and add reason argument name 2021-05-17 10:55:46 -04:00