80 Commits

Author SHA1 Message Date
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
Mike McQuaid
cd0366da0d Revert "dependency: don't recurse infinitely."
This reverts commit 16ffbe1a2b2d99da42481dc50f70dbfee4472da6.
2016-01-17 20:55:05 +00:00
Mike McQuaid
20106e4268 dependency: don't recurse infinitely.
If we have a dependency cycle ensure that infinite recursion does not
result by storing state in a stack which we push/pop from for each
level of recursion and verify that we haven’t been through this
dependency already.

Closes Homebrew/homebrew#47933.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-17 20:12:03 +00:00
Martin Afanasjew
ea4d137e87 dependency: fix merging tags in 'merge_repeats'
While it may suffice to merge string and non-reserved tags by forming a
union of all tags of dependencies of the same name, this approach fails
to work for the reserved tags. These are now merged such that the most
restrictive tag (meaning sometimes an empty tag) is preserved.

The previous behavior caused essential dependencies to be omitted and
builds to fail in response. E.g., multiple `:fortran` dependencies with
tags `[]`, `[:recommended]`, and `[:optional]` would have been expanded
and merged to `"gcc"` with tags `[:recommended, :optional]`, causing it
to be no longer seen as a required dependency.

Closes Homebrew/homebrew#47040.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-17 13:50:38 +01:00
Mike McQuaid
e5ba31fcdc Allow multiple option_names in dep/reqs.
This means that dependencies can be merged but still maintain all
their option names.

Closes Homebrew/homebrew#46916.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-15 08:37:16 +00:00
Xu Cheng
0bce3b3f36 TapDependency: allow passing arbitrary option_name 2015-08-20 17:31:17 +08:00
Xu Cheng
ae0e270727 favor flat_map over map...flatten 2015-08-06 22:33:46 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Mike McQuaid
b3d44da9e3 TapDependency: add tap accessor. 2014-12-29 12:20:03 +00:00
Jack Nagel
dd820192ee Hashes do not iterate in insertion order on Ruby 1.8 2014-11-21 22:25:36 -06:00
Jack Nagel
a412b49c2c Fix dependency equality 2014-11-21 17:03:58 -06:00
Jack Nagel
6b9a929e40 Rewrite missing_options in a more obvious way 2014-08-27 23:28:00 -05:00
Jack Nagel
566442606a Remove an unnecessary default argument 2014-08-23 22:41:35 -05:00
Jack Nagel
b7b8b88cea Replace the build object rather than mutate it 2014-08-11 17:48:30 -05:00
Jack Nagel
fd86e6d636 Remove confusing implicit options handling
This code is supposed to allow

  depends_on "foo" => "with-bar"

to work when foo has only a "without-bar" option.

The options system was not designed to support this. Unfortunately, it
was bolted on anyway. The implementation is extremely difficult to
understand, and it only works for certain types of options, which is
confusing from a user's point of view. Luckily, no formulae in core or
the official taps rely on the behavior in order to function.

It is hindering progress in improving this code, so I am removing it.
2014-07-30 21:46:22 -05:00
Jack Nagel
fbefa76ce2 Always use class.name to build inspect strings 2014-07-01 18:39:15 -05:00