Merge pull request #11750 from carlocab/audit-archs-fixed
formula_cellar_checks: handle universal binaries in `check_binary_arches`
This commit is contained in:
commit
eb27ba4832
@ -325,11 +325,36 @@ module FormulaCellarChecks
|
|||||||
end
|
end
|
||||||
return if mismatches.empty?
|
return if mismatches.empty?
|
||||||
|
|
||||||
<<~EOS
|
compatible_universal_binaries, mismatches = mismatches.partition do |file|
|
||||||
Binaries built for a non-native architecture were installed into #{formula}'s prefix.
|
file.arch == :universal && file.archs.include?(Hardware::CPU.arch)
|
||||||
The offending files are:
|
end
|
||||||
#{mismatches * "\n "}
|
|
||||||
EOS
|
universal_binaries_expected = if formula.tap.present? && formula.tap.core_tap?
|
||||||
|
tap_audit_exception(:universal_binary_allowlist, formula.name)
|
||||||
|
else
|
||||||
|
true
|
||||||
|
end
|
||||||
|
return if mismatches.empty? && universal_binaries_expected
|
||||||
|
|
||||||
|
s = ""
|
||||||
|
|
||||||
|
if mismatches.present?
|
||||||
|
s += <<~EOS
|
||||||
|
Binaries built for an incompatible architecture were installed into #{formula}'s prefix.
|
||||||
|
The offending files are:
|
||||||
|
#{mismatches * "\n "}
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
|
if compatible_universal_binaries.present? && !universal_binaries_expected
|
||||||
|
s += <<~EOS
|
||||||
|
Unexpected universal binaries were found.
|
||||||
|
The offending files are:
|
||||||
|
#{compatible_universal_binaries * "\n "}
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
def audit_installed
|
def audit_installed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user