formula_auditor: disallow non-test rustup-init dependencies

We want formulae to build with our `rust` formula instead of a random
toolchain downloaded with `rustup`.

Unfortunately, some formulae already do this, so let's gate the check
behind `--strict`. It should also prevent new formulae that build using
`rustup` from being added.

This should hopefully prevent PRs like Homebrew/homebrew-core#119832
from being merged.
This commit is contained in:
Carlo Cabrera 2023-07-11 22:27:04 +08:00
parent bf0c896c34
commit f75ccc005e
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -309,6 +309,10 @@ module Homebrew
next unless @core_tap next unless @core_tap
if @strict && dep.name == "rustup-init" && !dep.test?
problem "Formulae should use `rust` instead of `rustup-init` to build"
end
unless dep_f.tap.core_tap? unless dep_f.tap.core_tap?
problem <<~EOS problem <<~EOS
Dependency '#{dep.name}' is not in homebrew/core. Formulae in homebrew/core Dependency '#{dep.name}' is not in homebrew/core. Formulae in homebrew/core