Merge pull request #6963 from puxlit/bugfix/#6961-remove-dyld-checks

doctor: remove DYLD checks
This commit is contained in:
Mike McQuaid 2020-01-27 00:27:32 +00:00 committed by GitHub
commit 31aaf48322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 47 deletions

View File

@ -474,28 +474,6 @@ module Homebrew
EOS
end
def check_ld_vars
ld_vars = ENV.keys.grep(/^(|DY)LD_/)
return if ld_vars.empty?
values = ld_vars.map { |var| "#{var}: #{ENV.fetch(var)}" }
message = inject_file_list values, <<~EOS
Setting DYLD_* or LD_* variables can break dynamic linking.
Set variables:
EOS
if ld_vars.include? "DYLD_INSERT_LIBRARIES"
message += <<~EOS
Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail.
Having this set is common if you use this software:
#{Formatter.url("https://asepsis.binaryage.com/")}
EOS
end
message
end
def check_for_symlinked_cellar
return unless HOMEBREW_CELLAR.exist?
return unless HOMEBREW_CELLAR.symlink?

View File

@ -113,26 +113,6 @@ describe Homebrew::Diagnostic::Checks do
HOMEBREW_CELLAR.mkpath
end
specify "#check_ld_vars catches LD vars" do
ENV["LD_LIBRARY_PATH"] = "foo"
expect(subject.check_ld_vars).to match("Setting DYLD_\\* or LD_\\* variables")
end
specify "#check_ld_vars catches DYLD vars" do
ENV["DYLD_LIBRARY_PATH"] = "foo"
expect(subject.check_ld_vars).to match("Setting DYLD_\\* or LD_\\* variables")
end
specify "#check_ld_vars catches LD and DYLD vars" do
ENV["LD_LIBRARY_PATH"] = "foo"
ENV["DYLD_LIBRARY_PATH"] = "foo"
expect(subject.check_ld_vars).to match("Setting DYLD_\\* or LD_\\* variables")
end
specify "#check_ld_vars returns success when neither LD nor DYLD vars are set" do
expect(subject.check_ld_vars).to be nil
end
specify "#check_tmpdir" do
ENV["TMPDIR"] = "/i/don/t/exis/t"
expect(subject.check_tmpdir).to match("doesn't exist")

View File

@ -28,9 +28,4 @@ describe Homebrew::Diagnostic::Checks do
expect(subject.check_ruby_version)
.to match "Ruby version 1.8.6 is unsupported on 10.12"
end
specify "#check_dyld_insert" do
ENV["DYLD_INSERT_LIBRARIES"] = "foo"
expect(subject.check_ld_vars).to match("Setting DYLD_INSERT_LIBRARIES")
end
end