1226 Commits

Author SHA1 Message Date
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
Rylan Polster
5e9fcafbd8
formula: add preset pour_bottle? symbols 2021-05-15 14:05:50 -04:00
Sean Molenaar
157fed329c
service: install linux service file 2021-05-04 16:22:28 +02:00
Carlo Cabrera
309504a32c
formula: add rpath helper method
About 40 formulae set `CMAKE_INSTALL_RPATH` to `lib` or `opt_lib`, but
this breaks bottle relocatability.

The correct solution is to use `@loader_path/../lib`, but this is macOS
specific, so it requires some OS-specific logic. Rather than replicating
this logic over many formulae, we may as well define a helper method for
it.

See https://github.com/Homebrew/homebrew-core/issues/75458.
2021-04-19 09:23:33 +01:00
Bo Anderson
842a2ea890
Merge pull request #11159 from Bo98/cmake-no-tests
formula: add `-DBUILD_TESTING=OFF` to `std_cmake_args`
2021-04-16 23:32:24 +01:00
Bo Anderson
0db7c0ba8a
formula: add -DBUILD_TESTING=OFF to std_cmake_args 2021-04-15 23:07:18 +01:00
Bo Anderson
635e58e9aa
software_spec: fix bottle domain fallback handling 2021-04-15 19:24:25 +01:00
Chris Ayoub
7c16da70ac Fix regression with bottle URLs in brew info JSON output 2021-04-12 21:41:42 -04:00
Mike McQuaid
bd3f1d28e7
Fix GitHub Packages filenames.
They don't need escaped like the Bintray ones did.

Fixes https://github.com/Homebrew/brew/issues/11090 (but note this may
require the cache entry to be cleared and the package to be
redownloaded).
2021-04-09 16:31:04 +01:00
Mike McQuaid
4633ec7bff
Formula#bottle_hash: various fixes/updates.
- remove `cellar` because it's no longer global
- remove `prefix` because it's no longer customisable
- add `cellar` for each bottle tag
- fix `url` for GitHub Packages
2021-04-09 15:44:37 +01:00
Mike McQuaid
576ec2c9a3
Merge pull request #9517 from SMillerDev/plist_generator
formula: allow plists to be generated
2021-04-09 13:59:55 +01:00
Mike McQuaid
1ab2726e76
Cleanup service plist code. 2021-04-09 13:30:43 +01:00
Mike McQuaid
d73351251c
Deprecate, disable, delete code for next major/minor version.
Do the usual dance for bumping our major/minor version.
2021-04-09 09:30:36 +01:00
Sean Molenaar
b927ecfd85
Fix formulae method loading
Co-authored-by: nandahkrishna <me@nandahkrishna.com>
2021-04-08 10:16:57 +02:00
Sean Molenaar
4427fa283f
formula: allow plists to be generated 2021-04-08 10:16:57 +02:00
Mike McQuaid
d9032ff01a
Download and use tabs from GitHub Packages 2021-04-01 17:37:16 +01:00
Bo Anderson
65f52806f6
formula: make bazel write to .brew_home 2021-03-29 11:53:06 +01:00
Bo Anderson
86beda7f19
formula: add ldflags parameter to std_go_args 2021-03-23 16:39:01 +00:00
Bo Anderson
e49a338896
Implement caching for dependency expansion 2021-03-20 16:56:00 +00:00
nandahkrishna
8e5451df2f
style: use parentheses for assignment in conditions 2021-02-12 18:33:37 +05:30
Mike McQuaid
04804c6db5
formula: add bottle_hash method.
Extract this method from `#to_hash` so it can be used in `brew bundle`.
2021-02-10 10:36:40 +00:00
Rylan Polster
455af85235
Merge pull request #10547 from Rylan12/prepare-bottle-syntax-deprecations
Prepare deprecations for the old bottle syntax
2021-02-08 19:13:37 -05:00