95 Commits

Author SHA1 Message Date
Bo Anderson
e466417cdf dependency: cleanup unused code 2024-01-02 17:48:29 +00:00
Eric Knibbe
77c23df526
dependency: disable renamed formula warning 2023-12-11 14:14:52 -05:00
Bo Anderson
7c20e1ef7c
Don't reinstall dependency when latest already installed 2023-11-14 17:13:34 +00:00
Bo Anderson
19f27f9a20
Store and use revision, where possible, in tab runtime dependencies.
Let's start storing `revision` and `pkg_version` for tab runtime
dependencies and use them when available.

When the `revision` is not available, use a conservative approach to
deciding whether dependencies need to be upgrade.

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-11-10 18:24:43 +00:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
Mike McQuaid
9fcdaa2b85
Make formula upgrades more liberal based on bottle
When we're installing a formula from a bottle, we currently always
upgrade all dependencies in the dependency tree to be safe.

However, if we're installing a bottle and the `runtime_dependencies`
within that bottle's tab all have older or equal versions to those
already installed: we do not need to upgrade these dependencies.

This should help a lot of upgrading a lot of the time, at least for
users using bottles (which is the huge majority).

The only downside or other noticeable change is that this requires us
to download or attempt to download the bottle tab before we compute
the dependencies at installation time.

Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-09-03 15:07:48 -04:00
Eric Knibbe
df38dcc3d1
dependency: consider bounds when comparing macOS deps 2023-08-28 17:34:04 -04:00
Eric Knibbe
49d531a6ce
dependency_collector: distinguish macOS deps by OS 2023-08-28 12:20:15 -04:00
Patrick Linnane
c56669e9cd
various: fix miscellaneous typos 2023-07-18 08:52:49 -07:00
Bo Anderson
71d51faa55
Introduce tag for implicit dependencies 2023-07-04 13:40:58 +01:00
Bo Anderson
d1b923f314
Introduce UsesFromMacOSDependency
Add Formula#declared_deps and SoftwareSpec#declared_deps
2023-07-04 13:40:55 +01:00
Bo Anderson
53d513695a
Remove TapDependency 2023-07-04 13:31:58 +01:00
Mike McQuaid
b3015701f6
dependency: use formula name.
This allows renamed or aliased formulae dependencies to be resolved to
specific formulae correctly and deduplicated.

Fixes #15488
2023-06-29 14:30:43 +01:00
Robin Ury
6aa9a0e57b
Add brew deps --skip-installed arg 2023-05-17 13:53:19 -05:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Issy Long
6a704f2f40
sorbet: Bump more files to typed: true
- This was done through the `brew typecheck --suggest-typed --update`
  command.
2023-03-05 18:18:59 +00:00
Douglas Eichelberger
89c7117b30 Resolve dependable_spec violation 2023-01-22 17:26:44 -08:00
Bo Anderson
2ea7454efa
Fix Security/CompoundHash offences 2022-06-17 19:47:55 +01:00
Rylan Polster
cff0122fc4
Remove unnecessary HOMEBREW_INSTALL_FROM_API checks 2022-06-15 16:35:50 -04:00
Rylan Polster
e53ccbc3cd
Remove unnecessary code 2022-06-14 16:06:05 -04:00
xxyzz
193d6d3ff2
Skip build dependencies to avoid downloading bottles
Dependency.to_formula() in the following line will cause a
CoreTapFormulaUnavailableError then download all dependency bottles in FormulaInstaller.verfi_deps_exist()
2022-03-30 20:25:26 +08:00
Rylan Polster
b096bf1fed
dependency::expand: only prune missing deps with flag 2021-06-18 12:03:22 -04:00
Rylan Polster
2760d981d3
Allow for homebrew/core to be untapped 2021-06-17 14:18:43 -04:00
Rylan Polster
cbb788bd17
dependency: don't merge formula and cask cache in ::expand 2021-05-29 18:08:42 -04:00
Bo Anderson
e49a338896
Implement caching for dependency expansion 2021-03-20 16:56:00 +00:00
Markus Reiter
0184e271d8 Fix RuboCop offenses. 2020-11-17 11:09:55 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
1ea50d08fa Document Dependency and TapDependency. 2020-08-26 03:13:58 +02:00
Bo Anderson
5b5833c33b dependency: return test deps on all levels
Filtering for this is now handled properly in places where this function is used.

In some scenarios, we _want_ test deps on more than the first level (Homebrew.args.include_formula_test_deps?).
2020-05-19 19:17:17 +01:00
Mike McQuaid
5dd8ead51a
Rename Formula#installed? to Formula#latest_version_installed?
This naming has always been a bit weird and confusing so let's change
it and provide a `compat` fallback for later deprecation.
2019-12-03 11:42:42 +00:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
d1ea6f38d3
Fix mutable constants violations. 2019-04-19 21:46:20 +09:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
6b817f775f Formula: handle bad tap runtime dependencies.
Also add some better exceptions for the cases that `nil`s end up
getting passed around incorrectly.
2018-06-01 19:22:33 +01:00
Mike McQuaid
d2c23bde6d Audit use of :run dependencies.
These are a no-op so let's remove them.
2018-03-19 10:11:08 +00:00
Mike McQuaid
1dfeff7274 deps: don't display recursive test dependencies.
You only care about the test dependencies for the specific formula you
are testing right now.
2018-03-14 15:41:20 +00:00
Mike McQuaid
924c4af3de dep*: fix more :test dependency resolution. 2018-03-08 09:46:53 +00:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Markus Reiter
3b4ee58c49 Refactor using Forwardable and DelegateClass. 2017-06-28 09:25:31 +02:00
Alyssa Ross
0b216798bb Revert "Revert "uses: properly handle untapped fo…
…rmulae in recursive dependency expansion""

This reverts commit dc9819b86c60b5c6fd10373ff318d8ef60f97d52.
2017-01-16 23:28:26 +00:00
Mike McQuaid
dc9819b86c Revert "uses: properly handle untapped formulae in recursive dependency expansion" 2017-01-07 13:15:18 +00:00
Alyssa Ross
4c061fc183 dependency: TapDependency#tap returns a Tap
Previously, this returned a String, but a Tap instance seems much more
sensible.

I couldn't find anywhere this method was actually used, so the change
shouldn't break anything.
2017-01-05 00:22:56 +00:00
Mike McQuaid
f7f15673a8 Fix dependency option handling.
- formula_installer: only recompute dependencies when necessary i.e.
when a bottle pour fails.
- formula_installer: re-add accidentally remove dependency options
- dependency: missing options are only those that actually exist on a
formula
2016-12-10 17:58:41 +00:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Xu Cheng
8749ecc383 Dependency.expand: ensure pop stack
During the dependencies expansion, there may be errors (e.g. FormulaUnavaiableError).
As result, some deps will be left behind in the stack and interfere afterwards
dependencies expansion.

So let's ensure stack clean for each expansions.

Fixes Homebrew/homebrew#48834.
2016-02-07 14:58:05 +08:00
Mike McQuaid
5b7dd99e99 Revert "Revert "dependency: don't recurse infinitely.""
This reverts commit fa43883dd1cd82f234b79c4a322339f03b9c098d.

Closes Homebrew/homebrew#48187.
2016-01-18 08:59:52 +00:00