73 Commits

Author SHA1 Message Date
Mike McQuaid
9216d8abe6
rubocop-rails: make fixes. 2020-12-02 10:43:04 +00:00
Mike McQuaid
7228e60da5
linkage_checker: system framework links are harmless.
These do not seem to cause runtime errors.

Fixes #9338
2020-11-30 16:00:42 +00:00
Mike McQuaid
7c56fa9caf
linkage: correctly detect missing kegs.
- manually `raise Errno::ENOENT` to ensure that a keg that doesn't exist
  isn't flagged as a system dependency.
- remove the inconsistent and incorrect summary messaging.
2020-11-27 13:12:09 +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
3a04377b51 Document LinkageChecker. 2020-08-26 03:13:59 +02:00
Maxim Belkin
4f119ad85f
linkage_checker.rb: Use ||= instead of "return ... if ... "
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-07-23 08:40:45 -05:00
Maxim Belkin
2918f92b89
linkage_checker.rb: fix indentation in display_items
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-07-23 08:38:42 -05:00
Maxim Belkin
590f77b111 Unexpected linkage 2020-07-22 17:25:16 +00:00
Maxim Belkin
42f90dba46 linkage_checker.rb: rename lib to broken_lib 2020-07-22 14:41:15 +00:00
Maxim Belkin
77a38aed0d linkage_checker.rb: meld allowed_missing_lib? into unexpected_broken_dylibs 2020-07-22 14:39:29 +00:00
Maxim Belkin
1b8c32c716 Move allowed_missing_libs? to linkage_checker.rb.
Optimize 'unexpected_broken_dylibs'
2020-07-22 14:30:52 +00:00
Maxim Belkin
28227bd26b linkage_checker.rb: replace conditional assignment with an if-else 2020-07-21 14:11:00 +00:00
Maxim Belkin
c61aba4ec3 Formula: ignore_missing_libraries DSL 2020-07-16 13:51:16 +00:00
Maxim Belkin
e7b3b8e559 Allow missing libraries 2020-07-16 13:51:16 +00:00
Mike McQuaid
f951ea83d4
Fix brew style. 2020-07-07 12:23:29 +01:00
Bo Anderson
9c4aaa9719 linkage_checker: handle system libraries on Big Sur 2020-06-24 16:27:57 +01:00
Mike McQuaid
dfa22680df
Autofix rubocop checks. 2020-02-19 11:24:12 +00:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
fe6b78a3f3
Use cache_store for descriptions
This makes use of both the existing interfaces and could use the
existing cache file but we'll create a new one and cleanup the old one
to avoid issues and use a more consistent name.
2018-10-13 08:22:52 -07:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
3a0a9f9073 Add String#delete_prefix backport. 2018-09-16 20:07:34 +02:00
Shaun Jackman
5cbddd2aca LinkageChecker: Report linkage of unwanted system libraries [Linux]
gcc and glibc are implicit dependencies on Linux.
No other linkage to system libraries is expected or desired.
2018-09-05 15:32:06 -07: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
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
Mike McQuaid
f5fbb74aaf linkage: fix output of optional dependencies.
Check the runtime dependencies from the tab when outputting the
`brew linkage` declared vs. undeclared dependencies.
2018-07-05 20:29:19 +01:00
Mike McQuaid
6f5c8b8509 linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone.
2018-06-29 19:57:39 +01: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
Gautham Goli
1caa0c0219 linkage: Fix brew linkage --reverse 2018-06-02 20:58:34 +05:30
Mike McQuaid
1a2c2f2e1b linkage_cache: cache input data and not results.
Cache all the non-weak dynamic library links for a keg rather than the
result of running `brew linkage`. This means that we correctly handle
changes to e.g. what non-keg files are present on disk.
2018-06-01 14:05:16 +01:00
Mike McQuaid
63aacd71d3 linkage_checker: fix bad instance variable usage. 2018-05-24 14:53:03 +01:00
Andrew R. McBurney
ddb7f06e9f Fixed rubocop offenses from brew style. 2018-05-22 12:54:54 -04: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
d3120c0206 Use cache if HOMEBREW_LINKAGE_CACHE exists in formula_cellar_checks and formula. Make functions private in LinkageChecker. 2018-05-06 15:55:33 -04:00
Mike McQuaid
555e2a2fc8 Merge remote-tracking branch 'origin/master' into cache-optimization 2018-05-02 09:46:58 +01:00
Mike McQuaid
8f3ddf968f linkage_checker: correctly handle multiple taps.
Fix upgrades of formulae with the same name in multiple taps.

As reported in:
https://github.com/Homebrew/brew/pull/3789#issuecomment-384890624
2018-04-28 17:24:48 +01:00
AndrewMcBurney
a756af3b32 Fixed style issue offenses from brew style. 2018-04-25 10:27:03 -04:00
AndrewMcBurney
27e5d1aee5 Merge remote-tracking branch 'origin/master' into cache-optimization 2018-04-25 10:04:36 -04:00
Mike McQuaid
8035afcc36 linkage_checker: fix generic pathname calls. 2018-04-25 12:08:33 +01:00
Mike McQuaid
3454d6a961 runtime_deps: improve documentation and consistency. 2018-04-25 11:44:29 +01:00
Mike McQuaid
598bbd4c72
Merge branch 'master' into undeclared_runtime_dependencies 2018-04-25 10:41:43 +01:00
Mike McQuaid
c167614797 linkage_checker: handle missing formulae. 2018-04-25 10:26:02 +01:00
AndrewMcBurney
916247b920 Merge remote-tracking branch 'origin/master' into cache-optimization 2018-04-24 16:49:51 -04:00
Mike McQuaid
4a03145c1c linkage: fix --test exit code.
Ensure that a non-zero exit code is set both for missing random dylibs
and random missing dependencies.

Additionally, while we are here, drastically trim down the public
interface for this class to the bare minimum and allow getting the
output from `display_test_output` as a variable.

Fixes issue mentioned by @ilovezfs in:
https://github.com/Homebrew/brew/pull/3940#issuecomment-383794520
2018-04-24 09:52:51 +01:00
AndrewMcBurney
d5795d816a Added broken_deps to LinkageStore. 2018-04-09 14:01:42 -04:00
AndrewMcBurney
dcdd16237c Merge remote-tracking branch 'origin/master' into cache-optimization 2018-04-09 13:49:58 -04:00
Mike McQuaid
de82d3a945
Merge pull request #3940 from maxim-belkin/fix-undeclared
linkage_checker: fix detection of broken dependencies and missing libraries
2018-04-08 16:13:28 -07:00