Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linkage_checker: allow linkage via alias #18676

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions Library/Homebrew/linkage_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,9 @@ def dylib_found_in_shared_cache?(dylib)
end

def check_formula_deps
filter_out = proc do |dep|
next true if dep.build? || dep.test?

(dep.optional? || dep.recommended?) && formula.build.without?(dep)
end

declared_deps_full_names = formula.deps
.reject { |dep| filter_out.call(dep) }
.map(&:name)
declared_deps = formula.deps.reject { |dep| dep.build? || dep.test? || dep.prune_from_option?(formula.build) }
declared_deps_aliases = declared_deps.flat_map { |dep| dep.to_formula.aliases }
declared_deps_full_names = declared_deps.map(&:name)
declared_deps_names = declared_deps_full_names.map do |dep|
dep.split("/").last
end
Expand All @@ -232,7 +226,7 @@ def check_formula_deps
next if name == formula.name

if recursive_deps.include?(name)
indirect_deps << full_name unless declared_deps_names.include?(name)
indirect_deps << full_name if declared_deps_names.exclude?(name) && declared_deps_aliases.exclude?(name)
else
undeclared_deps << full_name
end
Expand Down
Loading