Skip to content

Commit

Permalink
linkage_checker: deprecate linkage to libcrypt.so.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Apr 15, 2022
1 parent 589c136 commit 8ffd2a9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Library/Homebrew/extend/os/linux/linkage_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,31 @@ class LinkageChecker
libstdc++.so.6
].freeze

def display_deprecated_warning
return unless @libcrypt_found

opoo "Linkage to libcrypt.so.1 is deprecated and will be removed in Homebrew 3.??.0."
end

def display_normal_output
generic_display_normal_output
display_deprecated_warning
end

def display_test_output(puts_output: true, strict: false)
generic_display_test_output(puts_output: puts_output, strict: strict)
display_deprecated_warning
end

def broken_library_linkage?(strict: false)
generic_broken_library_linkage?(strict: strict) || (strict && @libcrypt_found)
end

def check_dylibs(rebuild_cache:)
generic_check_dylibs(rebuild_cache: rebuild_cache)

@libcrypt_found = true if @system_dylibs.any? { |s| File.basename(s) == "libcrypt.so.1" }

# glibc and gcc are implicit dependencies.
# No other linkage to system libraries is expected or desired.
@unwanted_system_dylibs = @system_dylibs.reject do |s|
Expand Down
6 changes: 6 additions & 0 deletions Library/Homebrew/linkage_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def display_normal_output
display_items "Unwanted system libraries", @unwanted_system_dylibs
display_items "Files with missing rpath", @files_missing_rpaths
end
alias generic_display_normal_output display_normal_output
private :generic_display_normal_output

def display_reverse_output
return if @reverse_links.empty?
Expand All @@ -75,13 +77,17 @@ def display_test_output(puts_output: true, strict: false)
display_items "Undeclared dependencies with linkage", @undeclared_deps, puts_output: puts_output
display_items "Files with missing rpath", @files_missing_rpaths, puts_output: puts_output
end
alias generic_display_test_output display_test_output
private :generic_display_test_output

sig { params(strict: T::Boolean).returns(T::Boolean) }
def broken_library_linkage?(strict: false)
issues = [@broken_deps, @unwanted_system_dylibs, @version_conflict_deps]
issues += [@undeclared_deps, @files_missing_rpaths] if strict
[issues, unexpected_broken_dylibs, unexpected_present_dylibs].flatten.any?(&:present?)
end
alias generic_broken_library_linkage? broken_library_linkage?
private :generic_broken_library_linkage?

def unexpected_broken_dylibs
return @unexpected_broken_dylibs if @unexpected_broken_dylibs
Expand Down

0 comments on commit 8ffd2a9

Please sign in to comment.