Merge pull request #13741 from Bo98/libnsl-deprecate
linkage_checker: deprecate libnsl.so.1 linkage
This commit is contained in:
commit
41c9112574
@ -26,12 +26,27 @@ class LinkageChecker
|
|||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
def display_deprecated_warning(strict: false)
|
def display_deprecated_warning(strict: false)
|
||||||
return unless @libcrypt_found
|
# Steps when moving these to `odisabled`:
|
||||||
|
# - Remove the old library from SYSTEM_LIBRARY_ALLOWLIST above.
|
||||||
# Steps when removing this entirely:
|
# - Remove the `disable` and `disable_for_developer` kwargs here.
|
||||||
|
# - Adjust the `broken_library_linkage?` override below to not check for the library.
|
||||||
|
# - Remove the relevant `fail_on_lib*?`.
|
||||||
|
# If there's no more deprecations left:
|
||||||
|
# - Remove the `broken_library_linkage?` override and the generic alias in HOMEBREW_LIBRARY/linkage_checker.rb.
|
||||||
|
#
|
||||||
|
# Steps when removing handling for a library entirely (assuming the steps to `odisabled` has already been done):
|
||||||
|
# - Remove the relevant setting of `@lib*_found` in `check_dylibs` below.
|
||||||
|
# - Remove the `odisabled` line
|
||||||
|
# If there's no library deprecated/disabled handling left:
|
||||||
# - Remove the `display_` overrides here and the associated generic aliases in HOMEBREW_LIBRARY/linkage_checker.rb
|
# - 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.
|
|
||||||
odisabled "linkage to libcrypt.so.1", "libcrypt.so.2 in the libxcrypt formula"
|
odisabled "linkage to libcrypt.so.1", "libcrypt.so.2 in the libxcrypt formula" if @libcrypt_found
|
||||||
|
|
||||||
|
return unless @libnsl_found
|
||||||
|
|
||||||
|
odeprecated "linkage to libnsl.so.1", "libnsl.so.3 in the libnsl formula",
|
||||||
|
disable: fail_on_libnsl1?(strict: strict),
|
||||||
|
disable_for_developers: false
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_normal_output
|
def display_normal_output
|
||||||
@ -45,15 +60,20 @@ class LinkageChecker
|
|||||||
end
|
end
|
||||||
|
|
||||||
def broken_library_linkage?(test: false, strict: false)
|
def broken_library_linkage?(test: false, strict: false)
|
||||||
generic_broken_library_linkage?(test: test, strict: strict)
|
generic_broken_library_linkage?(test: test, strict: strict) || (fail_on_libnsl1?(strict: strict) && @libnsl_found)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def fail_on_libnsl1?(strict:)
|
||||||
|
strict || ENV["HOMEBREW_DISALLOW_LIBNSL1"].present?
|
||||||
|
end
|
||||||
|
|
||||||
def check_dylibs(rebuild_cache:)
|
def check_dylibs(rebuild_cache:)
|
||||||
generic_check_dylibs(rebuild_cache: rebuild_cache)
|
generic_check_dylibs(rebuild_cache: rebuild_cache)
|
||||||
|
|
||||||
@libcrypt_found = true if @system_dylibs.any? { |s| File.basename(s) == "libcrypt.so.1" }
|
@libcrypt_found = true if @system_dylibs.any? { |s| File.basename(s) == "libcrypt.so.1" }
|
||||||
|
@libnsl_found = true if @system_dylibs.any? { |s| File.basename(s) == "libnsl.so.1" }
|
||||||
|
|
||||||
# glibc and gcc are implicit dependencies.
|
# glibc and gcc are implicit dependencies.
|
||||||
# No other linkage to system libraries is expected or desired.
|
# No other linkage to system libraries is expected or desired.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user