5601 Commits

Author SHA1 Message Date
Jack Nagel
a6bf5fa2ba Read from the error pipe in a separate thread
If the build process tries to write more bytes than will fit in the pipe
buffer, it will block until the parent process does a read. However, the
parent process will only do a read after the child process has exited or
died, leading to a deadlock. Fix this by doing the read in a separate
thread.
2014-08-08 17:31:13 -05:00
Jack Nagel
dfe1de7acd Delegate homepage to the class instead of storing it on the instance 2014-08-08 10:53:00 -05:00
Jack Nagel
392407c5f1 Default description to the empty string in top-level option DSL 2014-08-08 01:34:45 -05:00
Jack Nagel
af804f7475 Remove another unnecessary default argument 2014-08-08 01:34:45 -05:00
Jack Nagel
472a2cec1e Avoid using setters in tab tests 2014-08-07 17:39:55 -05:00
Jack Nagel
0c51cf1245 Use predefined options for universal, cxx11, and 32-bit options
:universal and :cxx11 are now handled directly, so we don't need to
always convert symbols to strings in this method. Symbols should be
reserved for future use.
2014-08-07 10:45:32 -05:00
Jack Nagel
efd63447d8 Move management of options collection to the spec object 2014-08-07 10:45:32 -05:00
Jack Nagel
8039107afb Default to the empty string instead of nil 2014-08-07 00:48:13 -05:00
Jack Nagel
6718bc554f Spell out the empty string instead of calling to_s on nil 2014-08-07 00:48:13 -05:00
Jack Nagel
22d1f6516f Remove a defensive to_s call
This method is only used internally and we always pass strings.
2014-08-07 00:48:13 -05:00
Jack Nagel
dc9872eb83 Remove default argument
This method is called in two places, always with two arguments.
2014-08-07 00:48:13 -05:00
Jack Nagel
acc1c35f35 Raise ArgumentError for argument errors 2014-08-07 00:48:13 -05:00
Jack Nagel
20452f3edc Add more test coverage for option descriptions 2014-08-07 00:48:13 -05:00
Jack Nagel
e34a497b3e Prefer interpolation 2014-08-07 00:11:14 -05:00
Jack Nagel
fa88b9697c Add a test for cxx11 option special case 2014-08-07 00:03:32 -05:00
Jack Nagel
9f6bd0798f Use opt_bin 2014-08-06 20:52:36 -05:00
Jack Nagel
1eecf1ac0b Don't use Hash#first
Fixes Homebrew/homebrew#31360.
2014-08-06 09:56:09 -05:00
Federico Bond
22a98624d2 utils: use the $stderr global variable.
For easier capturing.

Closes Homebrew/homebrew#31303.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-08-04 13:17:10 +01:00
Jack Nagel
f1cf62a4b5 Add predicate methods to Tab to match BuildOptions 2014-08-03 18:17:49 -05:00
Jack Nagel
cf3c12dd5b Add inspect to CxxStdlib 2014-08-03 15:28:51 -05:00
Jack Nagel
9aac71045c Add inspect to CompilerFailure 2014-08-03 15:28:51 -05:00
Jack Nagel
5a2ae61e66 Add another TODO 2014-08-03 15:28:51 -05:00
Jack Nagel
eb528fd7cd Eliminate a nil check 2014-08-03 13:14:50 -05:00
Jack Nagel
d54bce6a1a Remove dead code 2014-08-03 13:13:23 -05:00
Jack Nagel
b6e9600b9f Eliminate consideration of major_version
The major version is implicit in the compiler name. Since the name is
used when matching failures to compilers, we don't need to consider the
major version separately.
2014-08-03 11:15:39 -05:00
Jack Nagel
4580d86809 Use a separate class for GNU compiler failures
major_version is now only used internally by the failure object
2014-08-03 10:47:47 -05:00
Jack Nagel
8e8b9acc01 Move compiler failure matching logic into failure object 2014-08-03 10:47:47 -05:00
Jack Nagel
e5d6247ae7 Rename compiler attribute to name 2014-08-03 10:47:47 -05:00
Jack Nagel
2fedd5b09a Don't pass nil to fails_with? 2014-08-03 10:47:47 -05:00
Jack Nagel
fded4d0385 Remove an is_a check 2014-08-03 10:47:47 -05:00
Jack Nagel
5b38e89107 Simplify compatibility logic 2014-08-02 20:11:04 -05:00
Jack Nagel
fccfddb510 Partially revert e1f97e2 to pass new test cases 2014-08-02 20:03:42 -05:00
Jack Nagel
018aeb05ab Drop unnecessary parens 2014-08-02 19:43:13 -05:00
Jack Nagel
142beddd7a Use polymorphism to simplify stdlib compatibility check 2014-08-02 19:29:59 -05:00
Jack Nagel
90e370d2ef type is guaranteed to be a symbol by the factory method 2014-08-02 19:29:58 -05:00
Jack Nagel
cdf1a7b41c CxxStdlib should be immutable so remove writer methods 2014-08-02 19:29:58 -05:00
Jack Nagel
ffc5687fc2 Eagerly create and reuse cxx11 compiler failure objects 2014-08-01 20:15:58 -05:00
Jack Nagel
525e5f791f Remove knowledge of DSL implementation from initialize 2014-08-01 20:15:57 -05:00
Mike McQuaid
426737eb9e outdated: allow passing formulae as arguments.
If formulae names are passed as arguments check if just they are outdated. Additionally, return a failed code if they are outdated.

This will hopefully be able to stop people complaining about the outdated error code as they can now just run e.g.:
`brew outdated git && brew upgrade git`

Closes Homebrew/homebrew#31242.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-08-01 17:46:05 +02:00
Adam Vandenberg
c043a93bdf show cmd being executed 2014-08-01 07:58:09 -07:00
Adam Vandenberg
c003e805be add helpers for formula tests 2014-08-01 07:58:09 -07:00
Jack Nagel
f4ae1c9e1b Hide the options data structure better 2014-07-31 19:59:09 -05:00
Jack Nagel
abdff27cd7 Make options available on the spec objects 2014-07-31 19:37:39 -05:00
Jack Nagel
fad2e26395 Reduce direct accesses of the args collection 2014-07-31 16:36:54 -05:00
Jack Nagel
b160cc9bb6 Handle tap file renames that remove a file from the formula directory 2014-07-31 15:58:03 -05:00
Jack Nagel
5a94cfc4a3 Use a module since the @build ivar is going away soon 2014-07-30 22:24:24 -05:00
Jack Nagel
fd86e6d636 Remove confusing implicit options handling
This code is supposed to allow

  depends_on "foo" => "with-bar"

to work when foo has only a "without-bar" option.

The options system was not designed to support this. Unfortunately, it
was bolted on anyway. The implementation is extremely difficult to
understand, and it only works for certain types of options, which is
confusing from a user's point of view. Luckily, no formulae in core or
the official taps rely on the behavior in order to function.

It is hindering progress in improving this code, so I am removing it.
2014-07-30 21:46:22 -05:00
Jack Nagel
5ccce044ca Use the tab in place of build during tests 2014-07-30 21:04:17 -05:00
Jack Nagel
331737ab25 Add without? to Tab 2014-07-30 21:04:17 -05:00
Jack Nagel
393e10849b Pass the build object into the Tab
Since the Tab is written in the build process, the formula's build
object will have the correct args attached to it already, so we don't
need to reconstruct it.
2014-07-30 20:27:46 -05:00