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

formula_cellar_checks: fix cpuid instruction check on Mojave #11671

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,15 @@ def relative_glob(dir, pattern)

def cpuid_instruction?(file, objdump = "objdump")
@instruction_column_index ||= {}
@instruction_column_index[objdump] ||= if Utils.popen_read(objdump, "--version").include? "LLVM"
1 # `llvm-objdump` or macOS `objdump`
else
2 # GNU binutils `objdump`
@instruction_column_index[objdump] ||= begin
objdump_version = Utils.popen_read(objdump, "--version")

if (objdump_version.match?(/^Apple LLVM/) && MacOS.version <= :mojave) ||
objdump_version.exclude?("LLVM")
2 # Mojave `objdump` or GNU Binutils `objdump`
else
1 # `llvm-objdump` or Catalina+ `objdump`
end
end

has_cpuid_instruction = false
Expand Down