diff options
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 11 | ||||
| -rw-r--r-- | Library/Homebrew/test/diagnostic_spec.rb | 6 | ||||
| -rw-r--r-- | docs/FAQ.md | 7 |
3 files changed, 19 insertions, 5 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index a5adfeb63..ceb6ad4d1 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -98,6 +98,17 @@ module Homebrew EOS end + def check_build_from_source + return unless ENV["HOMEBREW_BUILD_FROM_SOURCE"] + + <<-EOS.undent + You have HOMEBREW_BUILD_FROM_SOURCE set. This environment variable is + intended for use by Homebrew developers. If you are encountering errors, + please try unsetting this. Please do not file issues if you encounter + errors when using this environment variable. + EOS + end + # See https://github.com/Homebrew/legacy-homebrew/pull/9986 def check_path_for_trailing_slashes bad_paths = PATH.new(ENV["HOMEBREW_PATH"]).select { |p| p.end_with?("/") } diff --git a/Library/Homebrew/test/diagnostic_spec.rb b/Library/Homebrew/test/diagnostic_spec.rb index 058b9823c..8a25413ed 100644 --- a/Library/Homebrew/test/diagnostic_spec.rb +++ b/Library/Homebrew/test/diagnostic_spec.rb @@ -12,6 +12,12 @@ describe Homebrew::Diagnostic::Checks do .to match("Some directories in your path end in a slash") end + specify "#check_build_from_source" do + ENV["HOMEBREW_BUILD_FROM_SOURCE"] = "1" + expect(subject.check_build_from_source) + .to match("You have HOMEBREW_BUILD_FROM_SOURCE set.") + end + specify "#check_for_anaconda" do mktmpdir do |path| anaconda = "#{path}/anaconda" diff --git a/docs/FAQ.md b/docs/FAQ.md index 4fe11530e..23f53d54c 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -89,16 +89,13 @@ following conditions: will use a bottled version of the formula, but `brew install <formula> --enable-bar` will trigger a source build. * The `--build-from-source` option is invoked. -* The environment variable `HOMEBREW_BUILD_FROM_SOURCE` is set. +* The environment variable `HOMEBREW_BUILD_FROM_SOURCE` is set +(intended for developers only). * The machine is not running a supported version of macOS as all bottled builds are generated only for supported macOS versions. * Homebrew is installed to a prefix other than the standard `/usr/local` (although some bottles support this). -In order to completely disable bottled builds, simply add a value for -the environment variable `HOMEBREW_BUILD_FROM_SOURCE` to -your profile. - We aim to bottle everything. ## How do I get a formula from someone else’s branch? |
