Warn more when building from source

We warn sometimes when we tell people to build from source and it's
not supported but we don't actually warn non-developers when invoking
the various install commands so: let's start doing so.

While we're here, also update the existing messaging to reflect the fact
we're on Mastodon now too and we don't want maintainers being
individually bothered about errors either.

I've tried to balance having messages here vs. having them be so long
at the beginning of installation that they will be missed or be overly
obnoxious.
This commit is contained in:
Mike McQuaid 2023-02-17 14:33:53 +00:00
parent c9e0971a84
commit fbdec8738d
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829
6 changed files with 27 additions and 9 deletions

View File

@ -162,7 +162,7 @@ rescue BuildError => e
This build failure is expected behaviour.
Do not create issues about this on Homebrew's GitHub repositories.
Any opened issues will be immediately closed without response.
Do not ask for help from MacHomebrew on Twitter.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

View File

@ -198,9 +198,8 @@ module Homebrew
# if the user's flags will prevent bottle only-installations when no
# developer tools are available, we need to stop them early on
unless DevelopmentTools.installed?
build_flags = []
unless DevelopmentTools.installed?
build_flags << "--HEAD" if args.HEAD?
build_flags << "--build-bottle" if args.build_bottle?
build_flags << "--build-from-source" if args.build_from_source?
@ -208,6 +207,11 @@ module Homebrew
raise BuildFlagsError.new(build_flags, bottled: formulae.all?(&:bottled?)) if build_flags.present?
end
if build_flags.present? && !Homebrew::EnvConfig.developer?
opoo "building from source is not supported!"
puts "You're on your own. Failures are expected so don't create any issues, please!"
end
installed_formulae = formulae.select do |f|
Install.install_formula?(
f,

View File

@ -97,10 +97,17 @@ module Homebrew
formulae, casks = args.named.to_formulae_and_casks(method: :resolve)
.partition { |o| o.is_a?(Formula) }
if args.build_from_source? && !DevelopmentTools.installed?
if args.build_from_source?
unless DevelopmentTools.installed?
raise BuildFlagsError.new(["--build-from-source"], bottled: formulae.all?(&:bottled?))
end
unless Homebrew::EnvConfig.developer?
opoo "building from source is not supported!"
puts "You're on your own. Failures are expected so don't create any issues, please!"
end
end
Install.perform_preinstall_checks
formulae.each do |formula|

View File

@ -125,10 +125,17 @@ module Homebrew
def upgrade_outdated_formulae(formulae, args:)
return false if args.cask?
if args.build_from_source? && !DevelopmentTools.installed?
if args.build_from_source?
unless DevelopmentTools.installed?
raise BuildFlagsError.new(["--build-from-source"], bottled: formulae.all?(&:bottled?))
end
unless Homebrew::EnvConfig.developer?
opoo "building from source is not supported!"
puts "You're on your own. Failures are expected so don't create any issues, please!"
end
end
Install.perform_preinstall_checks
if formulae.blank?

View File

@ -118,7 +118,7 @@ module Homebrew
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from MacHomebrew on Twitter.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

View File

@ -274,7 +274,7 @@ class FormulaInstaller
Do not create any issues about failures building from source on Homebrew's GitHub repositories.
Do not create any issues building from source even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help building from source from MacHomebrew on Twitter.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help building from source in Homebrew's discussions but are unlikely to receive a response.
If building from source fails, try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.