775 Commits

Author SHA1 Message Date
Mike McQuaid
b0f382c177
Merge pull request #5297 from MikeMcQuaid/postinstall-developer-failures
formula_installer: output postinstall failures for developers.
2018-11-11 10:40:19 +00:00
Mike McQuaid
dd22198b59
formula_installer: output postinstall failures for developers.
This message is pretty useless without a backtrace.
2018-11-11 10:01:16 +00:00
Mike McQuaid
50c9670605
formula_installer: don't automatically upgrade from another tap.
Rather than automatically upgrading a formula from one tap to a formula
from another when specified as a dependency require a manual
intervention to be clear that's the user's intention.
2018-11-10 12:04:26 +00:00
Shaun Jackman
605e61095a relocation_formulae: Poured bottles depend on gcc [Linux] 2018-10-23 09:03:20 -07:00
Markus Reiter
16618d0fc7 Use ActiveSupport’s #pluralize and #to_sentence. 2018-10-07 23:10:56 +02:00
Mike McQuaid
59c858a8e8
Cleanup Travis and CI configuration.
Use the environment variables set by `brew test-bot`. Eventually we'll
disable Travis CI running CodeCov so move `TRAVIS` references to
`HOMEBREW_TRAVIS_CI` so it doesn't need whitelisted.

Also, fix `azure-pipelines.yml` so it's testing the correct version of
Homebrew/brew (the one checked out in the `pwd`).
2018-09-19 15:01:33 +01:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
7615d3a812
Improve writable directory handling
Consolidate the handling of which directories need to exist and which
need to be writable. Additionally, add a fatal check for formula
installations to ensure that any directories that need to be writable
are so before attempting an installation.

Fixes #4626.
2018-09-06 18:38:43 +01:00
William Woodruff
367629d289
utils: Use JSON to marshal child errors
Replaces our serialization of child process
errors via Marshal with JSON, preventing
unintentional or malicious code execution outside
of the build sandbox.

Additionally, adds tests for the new behavior.
2018-09-04 11:03:32 -04:00
Mike McQuaid
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Mike McQuaid
ca6c75d229
Check version conflicts using linkage.
Instead of refusing to install software preemptively by assuming
multiple linkage to differing versions of the same library we now make
`brew linkage --test` verify that we don't have two versions of the
same library linked at the same time.

This will be considerably more permissive whilst checking the actual
problem that we're worried about.
2018-08-27 10:12:02 +01:00
Mike McQuaid
7df5b7057e
Revert "Use JSON to marshal errors from children" 2018-08-18 08:20:13 +01:00
William Woodruff
5c90833f0a
Use JSON to marshal errors from children 2018-08-17 15:23:08 -04:00
Michka Popoff
dc527fccdc formula_installer: avoid cyclic dependency
Fixes:
==> Installing patchelf dependency: patchelf
==> Installing dependencies for patchelf: patchelf
==> Installing patchelf dependency: patchelf
==> Installing dependencies for patchelf: patchelf
==> Installing patchelf dependency: patchelf
==> Installing dependencies for patchelf: patchelf
...
2018-08-08 21:21:56 +02:00
Markus Reiter
5841b992ac Refactor $LOAD_PATH. 2018-07-17 23:38:57 +02:00
Mike McQuaid
375d401580 Handle missing formulae in runtime_dependencies
Hopefully put this to bed for once and for all. Add a new method
`runtime_formulae_dependencies` which returns the `runtime_dependencies`
which have only the `Formula` objects that exist. I've checked all the
`runtime_dependencies` callers and updated them accordingly.

Also, fix a few cases where runtime dependencies were being read from
the tab when this wasn't desirable.
2018-07-16 16:46:39 +01:00
Andrew Janke
0a2d8c3d4d Add --display-times option to install, reinstall, and upgrade 2018-07-14 11:06:03 -04:00
Andrew Janke
c644392a85 Display collected caveats at end of install or upgrade 2018-07-12 20:41:32 -04:00
Mike McQuaid
3e85afc8b7
Merge pull request #4382 from sjackman/keg_relocate
Relocate bottles on Linux using patchelf
2018-07-12 20:33:58 +01:00
Shaun Jackman
1b688a3a25 Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles.
2018-07-12 10:21:26 -07:00
Markus Reiter
5b3bbb76c9 Separate staging from download. 2018-07-12 10:39:27 +02:00
Mike McQuaid
139fef8e74 formula_installer: correctly handle build dep reqs.
When a build dependency has a requirement it should be ignored when
checking for valid requirements. This requires calculating the
dependencies for a formula again and checking them when calculating
which requirements should be pruned.
2018-07-05 20:51:44 +01:00
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