formula_auditor: make Linux-only GCC dep audit non-strict.

Otherwise we have to run this separately in `brew test-bot` which is
slower and more confusing.
This commit is contained in:
Mike McQuaid 2023-09-02 21:39:16 -04:00
parent 9b76182c11
commit b594e87a7f
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -445,16 +445,9 @@ module Homebrew
def audit_gcc_dependency
return unless @core_tap
return if !@strict && !(@git && formula.tap.git?) # git log is required for non-strict audit
return unless Homebrew::SimulateSystem.simulating_or_running_on_linux?
return unless linux_only_gcc_dep?(formula)
bad_gcc_dep = @strict || begin
fv = FormulaVersions.new(formula)
fv.formula_at_revision("origin/HEAD") { |prev_f| !linux_only_gcc_dep?(prev_f) }
end
return unless bad_gcc_dep
problem "Formulae in homebrew/core should not have a Linux-only dependency on GCC."
end