603 Commits

Author SHA1 Message Date
William Woodruff
dabf5c40a1
formula_installer: require "install" 2018-06-11 22:19:11 -04:00
William Woodruff
ab568800a7
formula_installer: Check for bottle_unneeded 2018-06-11 10:38:32 -04:00
William Woodruff
96ff4102c8
formula_installer: Don't check devtools if pouring 2018-06-11 00:45:25 -04:00
ilovezfs
fda353e827 formula_installer: don't pass spec arguments from ARGV to postinstall
Postinstall should be executed with the spec of the target formula not
the spec argument from ARGV, otherwise the prefix can be incorrect. In
other words, if the stable version of a dependency gets installed,
postinstall for the dependency should use the prefix of the dependency's
stable version, not the prefix of its devel or head version.

Fixes #2941.
2018-06-10 04:29:34 -07:00
Mike McQuaid
05568420c0 linkage_checker: fix cache invalidation.
Rather than using the name of the keg for the key use the full path.
This provides several advantages:

- there's no need to invalidate the cache on a `brew upgrade` or
  `brew switch`
- it's easier to figure out what cache entries can be removed and this
  can be done whenever a keg is removed by `brew uninstall` or
  `brew cleanup`.

Also, ensure that an `install` (or `reinstall`, `upgrade`) always
results in the cache being rebuilt for that keg (in case different
options were used).
2018-06-06 13:30:45 +01:00
Mike McQuaid
1cbc78c5dd Further tweak formula installer runtime dep handling
Instead of adding a custom method to `Tab` use `Tab.runtime_deps_hash`
within `FormulaInstaller` to ensure the `runtime_dependencies` are in
the right format.
2018-06-01 20:39:39 +01:00
Mike McQuaid
42e5ef9f89 tab: set runtime_dependencies consistently. 2018-06-01 19:53:26 +01:00
Mike McQuaid
e9a66bff14 Regenerate runtime_dependencies after installation
This ensures the we’re calculating we’ve run `fix_dynamic_linkage` so
that their results are consistent with what we’re actually pouring.

Combined with the linkage cache (which will be enabled by default in
future) this has very little performance overhead for consistently
Correct tab results.

As a result, don’t bother looking at opportunistically linked
dependencies when creating a tab by default but only do so after
installation has completed.

Finally, only output the caveats and summary after all these
operations have completed.
2018-06-01 14:05:16 +01:00
Mike McQuaid
97645d061d
Merge pull request #3720 from AndrewMcBurney/cache-optimization
Cache optimization for `brew linkage` command.
2018-05-24 09:14:02 +01:00
Mike McQuaid
44f5d3ec79 Refactor cache store code. 2018-05-22 14:46:14 +01:00
Andrew R. McBurney
010207b982 Changed cache usage behavior.
1. Running `brew linkage some_package` does not set the cache.
2. Running `brew linkage --cached some_package` when `DatabaseCache.empty?` returns `true` should build the cache.
3. Running `brew linkage --cached some_package` when `DatabaseCache.empty?` returns `false` should use the cache.
2018-05-21 17:36:30 -04:00
Andrew R. McBurney
e93e8f3266 Lazily load db of type DBM instance variable for DatabaseCache so the corresponding database file isn't created in the .use block for a DatabaseCache. 2018-05-18 16:37:01 -04:00
Andrew R. McBurney
cd6f89ca76 Made DatabaseCache.new private, and changes instances in code that call it to use DatabaseCache.use instead. 2018-05-18 10:06:30 -04:00
Andrew R. McBurney
4fb14d5c86 break if database_cache.empty? 2018-05-17 16:35:35 -04:00
Andrew R. McBurney
ba5692f7e5 Only update the cache for a formula if the cache is not empty?. 2018-05-17 13:09:25 -04:00
Andrew R. McBurney
b0dd3f4c99 Update the invalidated cache after doing a formula install. 2018-05-15 12:56:38 -04:00
Miha Rekar
ca141caec2
Move post_install from cmd to FormulaInstaller 2018-05-12 14:03:37 +02:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
592bafe24e Refactor dependencies usage
Reuse more code to avoid errors due to duplication.
2018-03-24 16:55:16 +00:00
Mike McQuaid
82e82b7fbc install: add --include-test option.
Allow at `install` (or `install --only-dependencies`) time to specify
that test dependencies should be installed. This will allow simplifying
code in `brew test-bot`.

This could also be made an environment variable if desired by
maintainers.
2018-03-15 13:37:34 +00:00
Mike McQuaid
86a6361f4e install: make --only-dependencies fill in missing.
This makes the `brew install --only-dependencies` command more useful by
filling in missing dependencies for a formula even if it's already
installed.
2018-03-13 09:43:29 +00:00
ilovezfs
88b1e92236 formula_installer: also run audit_installed for keg_only formulae 2018-02-14 04:53:57 -08:00
Alyssa Ross
a9dc02a586
Don't suggest install from bottle if not available
It only makes sense to tell a user to try installing from a bottle if
there are bottles available for them to install for all the formulae
they specified.
2018-01-28 22:47:39 +00:00
Mike McQuaid
8a45467ad9
Merge pull request #3661 from MikeMcQuaid/deprecate-default-formula
Deprecate default_formula Requirement DSL
2018-01-18 15:30:56 +00:00
Mike McQuaid
b70b5429d0 Deprecate default_formula Requirement DSL
This has been a nightmare in terms of the complexity to our dependency
system and the whack-a-mole required on bugs. If a Requirement resolves
to a Formula it should just use `depends_on "formula"` instead. This
matches the effective behaviour all users of bottles (the vast majority
of users and installs) and what we're doing in Homebrew/homebrew-core.
2018-01-14 13:27:43 +00:00
Mike McQuaid
838a3f1996 reinstall/upgrade: stop unlinked kegs being sticky
It's not possible to determine the difference between a non-keg-only
keg that failed to link and one that wasn't linked by us intentionally.

To avoid additional complexity of storing this logic in another place
let's back out this relatively new functionality; sticky keg-only links
is a better and more desirable behaviour anyway.
2018-01-10 16:43:21 +00:00
Mike McQuaid
69b38dd9db
Merge pull request #3654 from sjackman/check_install_sanity
check_install_sanity: Use formula.runtime_dependencies
2018-01-10 09:07:17 +00:00
Shaun Jackman
95bf23404e check_install_sanity: Use formula.runtime_dependencies
Fix Error: wget contains conflicting version recursive dependencies:
openssl, openssl@1.1
2018-01-09 10:35:59 -08:00
Alyssa Ross
ef82b188f2
Preserve installed_on_request for dependencies
Fixes https://github.com/Homebrew/brew/issues/3642.
2018-01-09 16:37:59 +00:00
Mike McQuaid
73cb1ac265
Merge pull request #3613 from ilovezfs/allow-install-mixed-python-dependency-tree
formula_installer: allow version mismatched python deps
2017-12-30 20:14:53 +00:00
ilovezfs
ba76e06cff formula_installer: allow version mismatched python deps
Dependency trees with both python@2 and python@3 are not inherently
problematic.
2017-12-30 11:35:35 -08:00
Mike McQuaid
b41eb9d306
Merge pull request #3510 from MikeMcQuaid/remove-bottle-hooks
hooks/bottles: remove bottle hooks.
2017-12-10 17:46:10 +00:00
Mike McQuaid
3c6b1daf2b Revert "formula_installer: tweak dependent requirements."
This reverts commit cc752e97f6dcfb3e58c9e753262926672edeb571.

Fixes #1585.

I will open a new issue for the actual underlying bug here (that
requirements aren't being handled correctly based on the stable/devel
spec used at installation time).
2017-12-09 14:23:34 +00:00
Mike McQuaid
f52d69abea
Merge pull request #3539 from MikeMcQuaid/nil_req_dep
formula_installer: handle nil req_dependency.
2017-12-07 17:16:18 +00:00
Mike McQuaid
4ca9831da6 formula_installer: handle nil req_dependency.
Closes #3538.
2017-12-07 16:17:55 +00:00
Mike McQuaid
b9cf7b2bbc formula_installer: avoid irrelevant build deps.
If dependents are already installed ensure their build dependencies (and
requirements) don't end up in the dependency/requirement tree.

Fixes #3033.
2017-12-07 14:56:12 +00:00
Mike McQuaid
0245b2cfea formula_installer: fix default formula prune.
Only prune it if it's not already installed.

Fixes bug with https://github.com/Homebrew/brew/pull/3479
Closes https://github.com/Homebrew/brew/pull/3535.
2017-12-07 08:55:36 +00:00
Mike McQuaid
8bbe9b744f hooks/bottles: remove bottle hooks.
These were removed from Boxen in:
https://github.com/boxen/puppet-homebrew/pull/108
2017-12-01 09:51:10 +00:00
Mike McQuaid
fb6cf0c3f8 More environment filtering fixes
- Make `brew pull` pass through Git environment variables
- Whitelist all `TRAVIS_` variables.
2017-11-27 10:48:03 +00:00
Mike McQuaid
718f52eda4 formula_installer: force fewer default formulae
Don't force a default formulae install if a requirement is satisfied if
we're building a bottle and it's a build-time dependency.
2017-11-25 12:48:30 +00:00
Mike McQuaid
5241d07474 environment filtering: pass through TRAVIS vars.
We use these internally so let's map them to `HOMEBREW_` variables.
2017-11-13 10:01:54 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Shaun Jackman
a4838d22f4 pour_bottle?: Check bottle.compatible_cellar?
formula.bottled? is false when the bottle has no sha256,
as with a local bottle.
2017-09-30 18:25:23 -07:00
Shaun Jackman
c19cc70ac8 FormulaInstaller: Warn when tap version is newer
Warn if a more recent version of this formula is available in the tap.
2017-09-28 12:29:23 -07:00
Shaun Jackman
2e77de3b58 Fix installing a local bottle from source
Factor Utils::Bottles.formula_contents out of BottleLoader.
2017-09-28 12:29:23 -07:00
Shaun Jackman
3ebf282269 pour_bottle?: Fix when formula.bottle is nil
formula.bottle is nil when bottle.compatible_cellar? is false.
Use formula.bottle_specification.compatible_cellar? rather
than formula.bottle.compatible_cellar?.
2017-09-28 12:29:22 -07:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
ffdda0eb9f Tweaks for older Mac OS X versions.
- `brew update` should try to install `curl` before `git` on older
  versions of Mac OS X where it is needed for accessing modern SSL
  certificates.
- We don't need an HTTP mirror for `git` because `curl` will already be
  installed before it is downloaded.
- Don't recommend GCC on Mac OS X versions where it can't be built with
  the default system compiler.
- Start using the Homebrew `curl` on Mac OS X versions where it is
  needed as soon as it is installed.
2017-09-16 12:41:08 +01:00