os/mac/ruby_mach: don't hide actual parse errors
The current approach of suppressing all output regardless of what the error is makes it very hard to debug any issues and misread but valid Mach-O files will be silently interpreted as non-Mach-O files instead. Prefer to fail if we are a Homebrew developer or running on the bot (`HOMEBREW_DEVELOPER=1`), so that problems will be noticed and fixed before the silent failure leads to hard-to-diagnose user problems. Closes Homebrew/homebrew#48817. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This commit is contained in:
parent
01d642f150
commit
c20809526c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user