diff --git a/Library/Homebrew/os/mac/ruby_mach.rb b/Library/Homebrew/os/mac/ruby_mach.rb index 3cd0ac0b9d..adef7b6613 100644 --- a/Library/Homebrew/os/mac/ruby_mach.rb +++ b/Library/Homebrew/os/mac/ruby_mach.rb @@ -41,7 +41,15 @@ module RubyMachO end mach_data + rescue MachO::NotAMachOError + # Silently ignore errors that indicate the file is not a Mach-O binary ... + [] rescue + # ... but complain about other (parse) errors for further investigation. + if ARGV.homebrew_developer? + onoe "Failed to read Mach-O binary: #{self}" + raise + end [] end end