839 Commits

Author SHA1 Message Date
Sam Ford
0752d25125
OS::Mac: Move version methods into ::Version 2021-06-23 09:03:46 -04:00
Nanda H Krishna
35e5c8a612
formula_installer: add fallback to use tap formula
The keg formula isn't present in some old bottles. Use the tap
formula as a fallback when this is the case.
2021-06-18 14:25:34 +05:30
Mike McQuaid
01cd65d09b
Merge pull request #11525 from cnnrmnn/install-upgrade-outdated
Automatically upgrade installed but out of date formulae with `brew install`
2021-06-16 11:18:22 +01:00
Connor Mann
79f9a9aac6
Move install-specific code to install.rb 2021-06-15 15:59:00 -04:00
Nanda H Krishna
c70bcd53f7
formula_installer: minor refactoring 2021-06-15 17:30:38 +05:30
Nanda H Krishna
b9d64fed4d
formula_installer: restrict use of Formula from Keg 2021-06-15 03:19:24 +05:30
Connor Mann
4b59636ae8
Merge branch 'master' into install-upgrade-outdated 2021-06-14 11:16:20 -04:00
Nanda H Krishna
a0dfe4aa18
formula_installer: use formula from Keg for local bottle installs
Use the formula file from the Keg if `local_bottle_install` is set,
which means that the formula file from the tap is used for `-s`,
`--HEAD` and normal installs but the formula file present within
formula.prefix/".brew" is used for local bottle installs.
2021-06-11 20:57:51 +05:30
Nanda H Krishna
e6dd13d04e
Revert renaming of tap_git_head 2021-06-11 20:02:31 +05:30
Nanda H Krishna
0735eba995
formula_installer: improve support for local bottle installs 2021-06-11 20:02:30 +05:30
Connor Mann
b6cb3d2b6a
Add HOMEBREW_NO_INSTALL_UPGRADE 2021-06-10 15:06:12 -04:00
Connor Mann
56e6710064
Upgrade outdated formulae with brew install 2021-06-10 12:53:25 -04:00
Issy Long
155feba8e0
cask/installer: Add Cask caveats to the end-of-operation summary
- Both formulae and casks can have caveats, but only formulae caveats
  were shown at the end of a bulk install/upgrade/reinstall operation
  via `Homebrew.messages.record_caveats`. This fixes that to show Cask
  caveats too, for consistency (scrolling up all of the
  multi-formulae-and-casks output to see caveats is time-consuming and
  users might miss them).
- In doing this I had to change how `Messages#record_caveats` works
  since the cask name is just a string, not an object.
2021-06-09 12:11:51 +01:00
Connor Mann
e75a10fafd
Fix style 2021-06-02 11:21:44 -04:00
Connor Mann
cb78499cd4
Install build deps for --HEAD 2021-06-02 11:13:12 -04:00
Mike McQuaid
6764329684
formula_installer: don't output caveats for dependencies.
If a formula is installed as a dependency (or not on request) then don't
output its caveats.

Inspired by conversation in https://github.com/Homebrew/brew/pull/11367.
Closes https://github.com/Homebrew/brew/pull/11367
2021-05-19 12:11:01 +01:00
Bo Anderson
33e1255f65
formula_installer: write tab when pouring local --only-json-tab bottles 2021-05-11 14:28:12 +01:00
Carlo Cabrera
734defb1a9
Merge pull request #11352 from carlocab/custom-arch
extend/ENV/super: allow bottles with custom architectures
2021-05-10 14:30:41 +01:00
Bo Anderson
a5cb621fb8
tab: add declared_directly field for runtime deps 2021-05-10 05:50:08 +01:00
Carlo Cabrera
e893f16727
extend/ENV/super: allow bottles with custom architectures
Currently, Homebrew recognises only the architectures listed in
`hardware.rb`. [1] Attempting to pass an unrecognised architecture to
`--bottle-arch` while building a bottle returns an error.

Let's change that by passing unrecognised bottle arches to the compiler
instead of immediately failing with a `CannotInstallFormulaError`.

Partially resolves #5815.

[1] 64b6846d60/Library/Homebrew/hardware.rb (L28-L42)
2021-05-09 11:01:48 +01:00
Carlo Cabrera
bf4ad449bb
formula_installer: set HOMEBREW_RELOCATE_RPATHS
This enables `RPATH` relocation upon pouring bottles.

Part of #11329.
2021-05-07 19:40:40 +01:00
Sean Molenaar
157fed329c
service: install linux service file 2021-05-04 16:22:28 +02:00
Mike McQuaid
670bea02c1
formula_installer: don't require unpinning build deps when pouring.
Fixes #11294
2021-04-30 12:17:05 +01:00
Bo Anderson
627381e949
formula_installer: fix version scheme not being set in the tab 2021-04-12 15:48:13 +01:00
Sean Molenaar
4427fa283f
formula: allow plists to be generated 2021-04-08 10:16:57 +02:00
Bo Anderson
a78051d2e0
debrew: make Debrew::Raise only catch uncaught exceptions 2021-04-07 13:41:41 +01:00
Mike McQuaid
04abc51d1f
Cleanup use of CxxStdlib
- remove usage on macOS as we don't care about it there
- don't error out on incompatibility but still store stdlib on Linux
- remove (now) unused methods
2021-04-02 13:55:29 +01:00
Mike McQuaid
d9032ff01a
Download and use tabs from GitHub Packages 2021-04-01 17:37:16 +01:00
Mike McQuaid
d8a2cf9efc
Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
  and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
  local bottle file.
2021-03-31 09:43:37 +01:00
Bo Anderson
22053ca2c3
formula_installer: pass cache key to Dependency.expand 2021-03-29 13:20:18 +01:00
Bo Anderson
929d2d8caf
formula_installer: move deprecation/disabled checking earlier 2021-03-24 15:46:29 +00:00
Bo Anderson
d14a0bb131
Remove FormulaInstaller.prevent_build_flags 2021-03-22 16:11:27 +00:00
Bo Anderson
e49a338896
Implement caching for dependency expansion 2021-03-20 16:56:00 +00:00
Bo Anderson
248ca231a2
formula_installer: don't warn about bottles when active spec is HEAD 2021-03-16 18:22:05 +00:00
Bo Anderson
acfe9d24d9
Merge pull request #10815 from Bo98/fi-more-perf
formula_installer: further reduce dependency calculations
2021-03-15 18:20:03 +00:00
Carlo Cabrera
de676841f6
formula_installer: skip bottle check on old Macs
Fixes #10832.
2021-03-12 15:38:45 +00:00
Bo Anderson
73d372e951
formula_installer: further reduce dependency calculations 2021-03-10 17:09:14 +00:00
Bo Anderson
31a4989358
Merge pull request #10792 from Bo98/fi-less-dep-comp
formula_installer: reduce dependency expansion computations
2021-03-08 14:03:55 +00:00
Bo Anderson
96670cedb2
formula_installer: reduce dependency expansion computations 2021-03-08 13:12:12 +00:00
Mike McQuaid
761404a2dc
formula_installer: tweak "no bottle available" logic.
- ensure that `HOMEBREW_DEVELOPER` still fails when there's a bottle
  available but the `pour_bottle?` block fails. This is usually due to
  the CLT being missing (and it's removed on even patch macOS upgrades)
  so building from source without prompt is undesirable.
- require `--build-from-source` for dependencies that aren't already
  installed
- do these bottle checks before fetching dependencies (they were already
  done before fetching requested formulae)

Fixes #10729
2021-03-05 12:06:34 +00:00
Steve Peters
e3505247cb
formula_installer: fix typo in install_dependency
The linked_keg variable is referenced outside the block where
it is defined; I think it should be the installed_keg variable.
2021-03-02 01:16:55 -08:00
Bo Anderson
6cd1e5e384
Avoid passing around a massive $LOAD_PATH.
Portable Ruby crashes if the $LOAD_PATH gets too big.
2021-02-26 18:23:48 +00:00
Mike McQuaid
2b1f460289
Fix installed_on_request for dependencies.
Dependencies were using `Tab.for_formula(df)` to get a `Tab` which meant
that they were always ending up with the (default) value of `true` for
`installed_on_request`. Fix this by:
- setting `installed_on_request` to `false` by default in empty `Tab`s;
  we always override it on installation so we'd rather have it default
  to `false`
- only read and use a `Tab` for the existing dependency formula if
  there's an existing `Keg`
2021-02-23 10:19:45 +00:00
Mike McQuaid
22e591e531
Make HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK default
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
  the default. We mostly already do this since we added the need for
  the `--build-from-source` override on macOS. This allows us to
  delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
  upgrading if failing on a formula-specific reason e.g. the CLT is
  not/no longer installed, you're using a non-default prefix.

Fixes #10623
2021-02-17 13:51:53 +00:00
nandahkrishna
8e5451df2f
style: use parentheses for assignment in conditions 2021-02-12 18:33:37 +05:30
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
EricFromCanada
99ad3350ee use single quotes around stanza and parameter names 2021-01-26 16:19:47 -05:00
EricFromCanada
cd3cb6928b indent suggested commands on subsequent line
and combine sequential puts calls
2021-01-26 15:36:44 -05:00
EricFromCanada
f5e1557154 use ofail to set Homebrew.failed 2021-01-26 15:36:43 -05:00
hyuraku
e6eeb2cbed delete HOMEBREW_REPOSITORY & some variables 2021-01-27 00:29:43 +09:00