linkage_checker: deprecate linkage to libcrypt.so.1
This commit is contained in:
		
							parent
							
								
									6ec9095946
								
							
						
					
					
						commit
						5d28c5166b
					
				@ -26,9 +26,47 @@ class LinkageChecker
 | 
			
		||||
    libstdc++.so.6
 | 
			
		||||
  ].freeze
 | 
			
		||||
 | 
			
		||||
  def display_deprecated_warning(strict: false)
 | 
			
		||||
    return unless @libcrypt_found
 | 
			
		||||
 | 
			
		||||
    # Steps when moving this to `odisabled`:
 | 
			
		||||
    # - Remove `libcrypt.so.1` from SYSTEM_LIBRARY_ALLOWLIST above.
 | 
			
		||||
    # - Remove the `disable` and `disable_for_developer` kwargs here.
 | 
			
		||||
    # - Remove `broken_library_linkage?` override below and the generic alias in HOMEBREW_LIBRARY/linkage_checker.rb.
 | 
			
		||||
    # - Remove `fail_on_libcrypt1?`.
 | 
			
		||||
    # Steps when removing this entirely (assuming the above has already been done):
 | 
			
		||||
    # - Remove the `display_` overrides here and the associated generic aliases in HOMEBREW_LIBRARY/linkage_checker.rb
 | 
			
		||||
    # - Remove the setting of `@libcrypt_found` in `check_dylibs` below.
 | 
			
		||||
    odeprecated "linkage to libcrypt.so.1", "libcrypt.so.2 in the libxcrypt formula",
 | 
			
		||||
                disable:                fail_on_libcrypt1?(strict: strict),
 | 
			
		||||
                disable_for_developers: false
 | 
			
		||||
  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(strict: strict)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def broken_library_linkage?(strict: false)
 | 
			
		||||
    generic_broken_library_linkage?(strict: strict) || (fail_on_libcrypt1?(strict: strict) && @libcrypt_found)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  def fail_on_libcrypt1?(strict:)
 | 
			
		||||
    strict || ENV["HOMEBREW_DISALLOW_LIBCRYPT1"].present?
 | 
			
		||||
  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|
 | 
			
		||||
 | 
			
		||||
@ -49,6 +49,8 @@ class LinkageChecker
 | 
			
		||||
    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?
 | 
			
		||||
@ -75,6 +77,8 @@ class LinkageChecker
 | 
			
		||||
    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)
 | 
			
		||||
@ -82,6 +86,8 @@ class LinkageChecker
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user