977 Commits

Author SHA1 Message Date
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
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
carlocab
beeb7faaba
formula_installer: tweak no-bottle error message
Follow up to #10183.

This improves the error message displayed when `formula.pour_bottle?` is
false.

Before:

    ❯ brew install python@3.8
    Error: python@3.8: no bottle available!
    The bottle needs the Apple Command Line Tools to be installed.
      You can install them, if desired, with:
        xcode-select --install
    You can try to install from source with e.g.
      brew install --build-from-source python@3.8
    Please note building from source is unsupported. You will encounter build
    failures with some formulae. If you experience any issues please create pull
    requests instead of asking for help on Homebrew's GitHub, Twitter or any other
    official channels.

After:

    ❯ brew install python@3.8
    Error: python@3.8: the bottle needs the Apple Command Line Tools to be installed.
      You can install them, if desired, with:
        xcode-select --install
    You can try to install from source with e.g.
      brew install --build-from-source python@3.8
    Please note building from source is unsupported. You will encounter build
    failures with some formulae. If you experience any issues please create pull
    requests instead of asking for help on Homebrew's GitHub, Twitter or any other
    official channels.
2021-01-04 15:53:50 +00:00
Mike McQuaid
cc50307aca
formula_installer: use existing no bottle text. 2020-12-31 13:09:35 +00:00
carlocab
2dedca337e
formula_installer: improve no-bottle error message
Closes #10180.
2020-12-31 01:11:44 +00:00
Mike McQuaid
07f9f6c42c
formula_installer: only require --build-from-source on macOS. 2020-12-28 08:47:05 +00:00
Mike McQuaid
2777369da7
formula_installer: exclude more from build-from-source warning.
We should only complain when installing requested formulae that aren't
currently installed.
2020-12-18 14:56:01 +00:00
Mike McQuaid
0bbf965807
More bottling HOMEBREW_LIBRARY changes
- Refuse to create bottles which have non-relocatable references to
  `HOMEBREW_LIBRARY`. This allows us to make all bottles ignore where
  `HOMEBREW_REPOSITORY` is (even those that aren't `cellar :any`).
  I cannot see any circumstances in which any bottle should link to
  anything within `HOMEBREW_REPOSITORY`.
- Remove audit that becomes unnecessary given the above change.
- Relocate references to `@HOMEBREW_LIBRARY@` but don't actually write
  any references yet. This will allow us to move to using
  `@HOMEBREW_LIBRARY` and remove all relocation of `HOMEBREW_REPOSITORY`
  in a future release (2.7.1, most likely).
2020-12-18 13:50:10 +00:00
Mike McQuaid
79eeb00d0c
Merge pull request #10030 from MikeMcQuaid/formula_installer_pour_bottle
formula_installer: refactor pour_bottle?
2020-12-16 15:19:34 +00:00
Mike McQuaid
7fd716ff66
formula_installer: refactor source build messages. 2020-12-16 12:38:52 +00:00
Francois-Xavier Coudert
4db1c1a00f
Do not build from source on ARM unless explicitly requested 2020-12-16 11:45:51 +00:00
Mike McQuaid
fc9ad05ad5
formula_installer: refactor pour_bottle?
Use a better keyword argument rather than passing a hash.
2020-12-16 09:01:06 +00:00
Shaun Jackman
33483e9478 Fix install --force-bottle for non-standard prefix
Fix the error:
Error: undefined method `stage' for nil:NilClass
formula_installer.rb:1132:in `block in pour'
2020-12-15 00:04:36 -08:00