From f75ccc005ed42a8996f93a5e538db0b7d6ccb8f8 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:27:04 +0800 Subject: [PATCH] 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. --- Library/Homebrew/formula_auditor.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index c466c84872..b3ede3f4e7 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -309,6 +309,10 @@ module Homebrew 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? problem <<~EOS Dependency '#{dep.name}' is not in homebrew/core. Formulae in homebrew/core