Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

requirements are now fatal by default

It doesn't make sense to have something called a "Requirement" that is not
actually required, unless you explicitly set a "yes-I-really-mean-it" flag.
It's better to make the sensible case the default (Requirement means it's
required), and have non-required requirements as the exception.

It turns out that most requirements used in formulas are in fact required,
so the sensible case is also the common one.

It also turns out that most non-fatal requirements are that way because we
are not sure if they really are required or not, so for now we just display
a vague message saying things may work or not. Other times, the message says
the requirement is required, but the code left it non-fatal for unclear
reasons (possibly no reason). For these reasons, a non-fatal requirement is
likely to be a "code smell", and it's useful to make it explicit, so we can
grep for it and improve the affected formulas.
  • Loading branch information...
commit 5eeb6cdf17223ed3dc86c0ea50edb3c60b624c24 1 parent b7b0278
@camillol authored
Showing with 23 additions and 72 deletions.
  1. +0 −3  Library/Formula/asymptote.rb
  2. +0 −3  Library/Formula/auctex.rb
  3. +1 −0  Library/Formula/boost.rb
  4. +1 −0  Library/Formula/cmake.rb
  5. +1 −1  Library/Formula/cmu-sphinxbase.rb
  6. +0 −3  Library/Formula/coq.rb
  7. +0 −4 Library/Formula/cvs2svn.rb
  8. +0 −3  Library/Formula/dbslayer.rb
  9. +0 −4 Library/Formula/diffpdf.rb
  10. +1 −0  Library/Formula/dsniff.rb
  11. +0 −4 Library/Formula/elixir.rb
  12. +1 −0  Library/Formula/exim.rb
  13. +2 −0  Library/Formula/ghc.rb
  14. +1 −0  Library/Formula/git-hg.rb
  15. +2 −0  Library/Formula/google-js-test.rb
  16. +2 −0  Library/Formula/jstalk.rb
  17. +0 −3  Library/Formula/lilypond.rb
  18. +1 −0  Library/Formula/mlton.rb
  19. +0 −3  Library/Formula/mu.rb
  20. +0 −4 Library/Formula/mupdf.rb
  21. +0 −3  Library/Formula/mydumper.rb
  22. +0 −3  Library/Formula/mysql-proxy.rb
  23. +0 −3  Library/Formula/nu.rb
  24. +1 −0  Library/Formula/open-babel.rb
  25. +0 −3  Library/Formula/osm2pgsql.rb
  26. +0 −4 Library/Formula/pdf2svg.rb
  27. +0 −3  Library/Formula/pg_top.rb
  28. +0 −3  Library/Formula/pgpool-ii.rb
  29. +0 −3  Library/Formula/pgtap.rb
  30. +2 −0  Library/Formula/phantomjs.rb
  31. +0 −3  Library/Formula/saga-core.rb
  32. +1 −1  Library/Formula/signing-party.rb
  33. +0 −3  Library/Formula/skytools.rb
  34. +1 −0  Library/Formula/squid.rb
  35. +2 −0  Library/Formula/subversion.rb
  36. +3 −5 Library/Homebrew/dependencies.rb
View
3  Library/Formula/asymptote.rb
@@ -10,9 +10,6 @@ def message; <<-EOS.undent
def satisfied?
which 'latex'
end
- def fatal?
- true
- end
end
class Asymptote < Formula
View
3  Library/Formula/auctex.rb
@@ -10,9 +10,6 @@ def message; <<-EOS.undent
def satisfied?
which 'latex'
end
- def fatal?
- true
- end
end
class Auctex < Formula
View
1  Library/Formula/boost.rb
@@ -15,6 +15,7 @@ def message; <<-EOS.undent
def satisfied?
archs_for_command("python").universal?
end
+ def fatal?; false; end # "likely" fail? is this required or not??
end
class Boost < Formula
View
1  Library/Formula/cmake.rb
@@ -13,6 +13,7 @@ def message; <<-EOS.undent
def satisfied?
not File.exist? "/Library/Frameworks/expat.framework"
end
+ def fatal?; false; end # shouldn't we check for an actual arch mismatch?
end
View
2  Library/Formula/cmu-sphinxbase.rb
@@ -12,7 +12,7 @@ def message; <<-EOS.undent
def satisfied?
Formula.factory('python').installed?
end
- def fatal?
+ def fatal? # TODO: figure this out
false
end
end
View
3  Library/Formula/coq.rb
@@ -12,9 +12,6 @@ def satisfied?
# If installed, make sure it is transitional instead of strict.
`camlp5 -pmode 2>&1`.chomp == 'transitional'
end
- def fatal?
- true
- end
end
class Coq < Formula
View
4 Library/Formula/cvs2svn.rb
@@ -14,10 +14,6 @@ def message; <<-EOS.undent
def satisfied?
quiet_system "python", "-c", "import gdbm"
end
-
- def fatal?
- true
- end
end
class Cvs2svn < Formula
View
3  Library/Formula/dbslayer.rb
@@ -18,9 +18,6 @@ def message; <<-EOS.undent
def satisfied?
which 'mysql_config'
end
- def fatal?
- true
- end
end
class Dbslayer < Formula
View
4 Library/Formula/diffpdf.rb
@@ -6,10 +6,6 @@ def satisfied?
poppler.installed_with? '--with-qt4'
end
- def fatal?
- true
- end
-
def message; <<-EOS.undent
DiffPDF requires the Poppler-Qt4 bindings but Poppler was not installed
with support for Qt. Please reinstall Poppler using the `--with-qt4`
View
1  Library/Formula/dsniff.rb
@@ -13,6 +13,7 @@ def satisfied?
f = Formula.factory("berkeley-db")
not f.installed?
end
+ def fatal?; false; end # can fail? what is the problem, and why don't we fix it?
end
class Dsniff < Formula
View
4 Library/Formula/elixir.rb
@@ -15,10 +15,6 @@ def message; <<-EOS.undent
def satisfied?
which 'erl'
end
-
- def fatal?
- true
- end
end
class Elixir < Formula
View
1  Library/Formula/exim.rb
@@ -13,6 +13,7 @@ def satisfied?
f = Formula.factory("berkeley-db")
not f.installed?
end
+ def fatal?; false; end # need to figure this out
end
class Exim < Formula
View
2  Library/Formula/ghc.rb
@@ -11,6 +11,8 @@ def message; <<-EOS.undent
http://hackage.haskell.org/trac/ghc/ticket/6009
EOS
end
+
+ def fatal?; false; end # why is this non-fatal? is 10.6 required or not?
end
class Ghc < Formula
View
1  Library/Formula/git-hg.rb
@@ -14,6 +14,7 @@ def message; <<-EOS.undent
def satisfied?
which 'hg'
end
+ def fatal?; false; end # why is this non-fatal? is mercurial required or not?
end
class GitHg < Formula
View
2  Library/Formula/google-js-test.rb
@@ -8,6 +8,8 @@ def message
def satisfied?
MacOS.snow_leopard?
end
+
+ def fatal?; false; end # why is this non-fatal? is 10.6 required or not?
end
class GoogleJsTest < Formula
View
2  Library/Formula/jstalk.rb
@@ -8,6 +8,8 @@ def satisfied?
def message
"jstalk requires Mac OS X 10.6 or newer"
end
+
+ def fatal?; false; end # why is this non-fatal? is 10.6 required or not?
end
class Jstalk < Formula
View
3  Library/Formula/lilypond.rb
@@ -10,9 +10,6 @@ def message; <<-EOS.undent
def satisfied?
which 'mpost'
end
- def fatal?
- true
- end
end
class Lilypond < Formula
View
1  Library/Formula/mlton.rb
@@ -16,6 +16,7 @@ def message; <<-EOS.undent
def satisfied?
HOMEBREW_PREFIX.to_s == "/usr/local"
end
+ def fatal?; false; end # why is this non-fatal if it won't work without it?
end
class Mlton < Formula
View
3  Library/Formula/mu.rb
@@ -15,9 +15,6 @@ def satisfied?
`emacs --version 2>/dev/null` =~ /^GNU Emacs (\d{2})/
$1.to_i >= 23
end
- def fatal?
- true
- end
end
class Mu < Formula
View
4 Library/Formula/mupdf.rb
@@ -5,10 +5,6 @@ def satisfied?
MACOS_VERSION >= 10.6
end
- def fatal?
- true
- end
-
def message; <<-EOS.undent
The version of Freetype that comes with Leopard is too old to build MuPDF
against. It is possible to get MuPDF working on Leopard using the Freetype
View
3  Library/Formula/mydumper.rb
@@ -18,9 +18,6 @@ def message; <<-EOS.undent
def satisfied?
which 'mysql_config'
end
- def fatal?
- true
- end
end
class Mydumper < Formula
View
3  Library/Formula/mysql-proxy.rb
@@ -18,9 +18,6 @@ def message; <<-EOS.undent
def satisfied?
which 'mysql_config'
end
- def fatal?
- true
- end
end
class MysqlProxy < Formula
View
3  Library/Formula/nu.rb
@@ -7,9 +7,6 @@ def satisfied?
def message
"Nu requires Mac OS X 10.7 or newer"
end
- def fatal?
- true
- end
end
class Nu < Formula
View
1  Library/Formula/open-babel.rb
@@ -11,6 +11,7 @@ def satisfied?
args = %W{/usr/bin/env python -c import\ oasa}
quiet_system *args
end
+ def fatal?; false; end # eventually we should have depends_on ... => :optional
end
class OpenBabel < Formula
View
3  Library/Formula/osm2pgsql.rb
@@ -14,9 +14,6 @@ def message; <<-EOS.undent
def satisfied?
which 'pg_config'
end
- def fatal?
- true
- end
end
class Osm2pgsql < Formula
View
4 Library/Formula/pdf2svg.rb
@@ -6,10 +6,6 @@ def satisfied?
poppler.installed_with? '--with-glib'
end
- def fatal?
- true
- end
-
def message; <<-EOS.undent
pdf2svg requires the Poppler-Glib bindings but Poppler was not installed
with support for glib. Please reinstall Poppler using the `--with-glib`
View
3  Library/Formula/pg_top.rb
@@ -14,9 +14,6 @@ def message; <<-EOS.undent
def satisfied?
which 'pg_config'
end
- def fatal?
- true
- end
end
View
3  Library/Formula/pgpool-ii.rb
@@ -14,9 +14,6 @@ def message; <<-EOS.undent
def satisfied?
which 'pg_config'
end
- def fatal?
- true
- end
end
class PgpoolIi < Formula
View
3  Library/Formula/pgtap.rb
@@ -14,9 +14,6 @@ def message; <<-EOS.undent
def satisfied?
which 'pg_config'
end
- def fatal?
- true
- end
end
class Pgtap < Formula
View
2  Library/Formula/phantomjs.rb
@@ -8,6 +8,8 @@ def satisfied?
def message
"PhantomJS requires Mac OS X 10.6 (Snow Leopard) or newer."
end
+
+ def fatal?; false; end # why is this non-fatal? is 10.6 required or not?
end
class Phantomjs < Formula
View
3  Library/Formula/saga-core.rb
@@ -14,9 +14,6 @@ def message; <<-EOS.undent
def satisfied?
which 'pg_config'
end
- def fatal?
- true
- end
end
class SagaCore < Formula
View
2  Library/Formula/signing-party.rb
@@ -17,7 +17,7 @@ def satisfied?
which 'gpg' or which 'gpg2'
end
- def fatal?
+ def fatal? # is it really useful to allow users to build this without installing the requirements?
false
end
end
View
3  Library/Formula/skytools.rb
@@ -14,9 +14,6 @@ def message; <<-EOS.undent
def satisfied?
which 'postgres'
end
- def fatal?
- true
- end
end
class Skytools < Formula
View
1  Library/Formula/squid.rb
@@ -13,6 +13,7 @@ def satisfied?
f = Formula.factory("berkeley-db")
not f.installed?
end
+ def fatal?; false; end # figure out what the problem is
end
class Squid < Formula
View
2  Library/Formula/subversion.rb
@@ -16,6 +16,7 @@ def satisfied?
f = Formula.factory('neon')
!f.installed? || archs_for_command(f.lib+'libneon.dylib').universal?
end
+ def fatal?; false; end # why is this non-fatal? is it required or not?
end
class UniversalSqlite < Requirement
@@ -28,6 +29,7 @@ def satisfied?
f = Formula.factory('sqlite')
!f.installed? || archs_for_command(f.lib+'libsqlite3.dylib').universal?
end
+ def fatal?; false; end # why is this non-fatal? is it required or not?
end
class Subversion < Formula
View
8 Library/Homebrew/dependencies.rb
@@ -85,11 +85,11 @@ def options
# A base class for non-formula requirements needed by formulae.
-# A "fatal" requirement is one that will fail the build if it is not present.
-# By default, Requirements are non-fatal.
+# A "fatal" requirement is one that is required for the build to proceed.
+# A requirement may be made non-fatal to simply display a message before the build.
class Requirement
def satisfied?; false; end
- def fatal?; false; end
+ def fatal?; true; end
def message; ""; end
end
@@ -102,8 +102,6 @@ def initialize language, module_name, import_name=nil
@import_name = import_name || module_name
end
- def fatal?; true; end
-
def satisfied?
quiet_system(*the_test)
end
Please sign in to comment.
Something went wrong with that request. Please try again.