57 Commits

Author SHA1 Message Date
Jack Nagel
dd90030213 Fix "possible reference to past scope" warnings on 2.2 2014-12-26 11:58:09 -05:00
Mike McQuaid
33b3449621 tab: remap deprecated options in tabs.
If a deprecated option is found in a tab, rename it to the new option.
2014-10-19 13:58:52 +01:00
Jack Nagel
7266ecd4e3 Hide install receipt key names 2014-10-15 01:30:56 -05:00
Jack Nagel
285f8f77e6 Tab#with? accepts the same types as BuildOptions#with? 2014-10-09 00:20:15 -05:00
Jack Nagel
c7444d34f7 Use the as_flags method instead of map 2014-08-14 01:00:23 -05:00
Jack Nagel
268cd143be Replace Options.coerce with an alternate constructor 2014-08-13 11:09:57 -05:00
Jack Nagel
5c1c9e6550 Only store strings in the tab object 2014-08-13 11:09:57 -05:00
Mike McQuaid
a61c3615d2 Revert "Replace Options.coerce with an alternate constructor"
This reverts commit 8d2ef974a3a87bf4207f71ccb8a7b4776e16a016.
2014-08-13 08:45:06 +01:00
Jack Nagel
25395c6de6 Replace Options.coerce with an alternate constructor 2014-08-12 23:55:28 -05:00
Jack Nagel
2f1d40a764 Disconnect defined options from the build object 2014-08-10 21:45:24 -05:00
Jack Nagel
ca3c727267 Stop exposing combined options from the tab 2014-08-09 16:27:57 -05:00
Jack Nagel
f1cf62a4b5 Add predicate methods to Tab to match BuildOptions 2014-08-03 18:17:49 -05:00
Jack Nagel
142beddd7a Use polymorphism to simplify stdlib compatibility check 2014-08-02 19:29:59 -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
Jack Nagel
4c05d411f3 Add a method for getting the repo HEAD 2014-06-30 19:18:28 -05:00
Jack Nagel
d083efdbda Don't mutate the tab object 2014-06-29 23:18:09 -05:00
Jack Nagel
ac687d3b5f Remove explicit self 2014-06-29 22:26:15 -05:00
Jack Nagel
391bc4c981 Normalize paths before calling Tab.from_file 2014-06-29 21:50:08 -05:00
Jack Nagel
b0cffe4a7c explicitly initialize stdlib 2014-06-29 00:56:29 -05:00
Jack Nagel
4d9d01893e Move deprecated Formula class methods to compat
These have all been moved to Formulary.
2014-06-22 15:03:17 -05:00
Jack Nagel
543f2a68e9 Don't send, just call the method directly 2014-03-22 13:16:16 -05:00
Jack Nagel
26c93c9544 Drop inaccurate comment
require "time"
  Time.parse(Time.now.to_s)
2014-03-22 13:16:16 -05:00
Jack Nagel
f0966cf6b6 Use canonicalized path for loaded install receipts 2014-03-22 11:48:49 -05:00
Jack Nagel
b4e5401e66 Try to find install receipt when keg is unlinked
This roughly matches the logic we use to determine the active keg in
ARGV.kegs.
2014-03-22 11:47:07 -05:00
Jack Nagel
a8eb84812a Write install receipts atomically 2014-03-22 11:13:33 -05:00
Jack Nagel
d9be3eee8c Stop mutating build options in Tab.create 2014-03-02 20:35:41 -06:00
Misty De Meo
3657393017 Move stdlib tracking postinstall
This moves stdlib tracking after the install completes, which allows
the tracking to have access to the actual stdlib in use.

This unfortunately means that builds can error out *after* a build,
resulting in wasted time; however, it reduces false positives, and the
overall user experience is still likely to be better this way.
2013-10-26 21:54:29 -07:00
Jack Nagel
a8fe03f72b Tab: ensure file is closed after reading 2013-10-23 23:24:42 -05:00
Misty De Meo
15963322fd Tab#cxxstdlib: don't try to convert nil to_sym 2013-10-07 00:25:26 -07:00
Misty De Meo
d5ac2deefb Tab#cxxstdlib: remove default stdlib
Fixes Homebrew/homebrew#23089.
2013-10-07 00:15:03 -07:00
Misty De Meo
61ca8721fb Tab.dummy_tab: don't provide default stdlib value 2013-10-07 00:00:43 -07:00
Misty De Meo
74ab023422 Only track C++ stdlibs for C++ code
After a formula is built, scan all mach-o files for dynamic links
to see if any of them point to a C++ stdlib (libc++ or libstdc++).
If one of them is linked, record that information in the formula's tab.

This replaces the old behaviour where all files were assumed to be C++
code, and stdlibs were always tracked regardless of whether they were
actually linked against.

This also modifies the way that tabs are written - now tabs are written
with the stdlib field null, and values are only written if an stdlib
is detected.
2013-10-06 19:26:06 -07:00
Misty De Meo
b71682bdc7 Tab: track C++ stdlib in use
There are subtle incompatibilities between Apple's libstdc++ and the
libstdc++ used by the various GNU GCC formulae. In addition, we'll
likely also be supporting libc++ in the future, and that's also
incompatible with the other stdlibs.

Tracking it in the tab lets us make sure that dependencies are all
built against the same stdlib to avoid subtle breakage.
2013-09-01 13:19:13 -07:00
Adam Vandenberg
1cd3149677 Be explicit about passing formulae names or instances to Tab 2013-06-26 19:58:08 -07:00
Jack Nagel
d6929f96a5 Use OkJson directly 2013-06-22 21:34:03 -05:00
Jack Nagel
083b3c84d0 Add Utils::JSON to wrap the JSON implementation 2013-06-22 21:34:02 -05:00
Jack Nagel
891cfe454b Remove circular require
Will this break anything? It shouldn't; Formula will always be loaded
before Tab anyway. But really there is a design problem here, Tab
shouldn't have any hardcoded references to Formula. I think this is
fixable, but callers of for_formula will need to be checked first.
2013-03-28 17:37:29 -05:00
Jack Nagel
5e5e82f9ef Tab#to_s returns a one-line summary of the receipt 2013-03-28 14:16:15 -05:00
Mike McQuaid
b578a47bb9 brew-info: specify whether poured or built.
- Store in the tab if a bottle was poured for the build.
- Add an additional line of output to `brew info` outputting whether
  the formula was built from source or poured from a bottle.

Closes Homebrew/homebrew#18430.
Closes Homebrew/homebrew#18475.
2013-03-20 23:06:38 +00:00
Jack Nagel
cf08b71bf8 FormulaInstaller: construct new ARGV from an Options collection
The array of options that is passed to the spawned build process is a
combination of the current ARGV, options passed in by a dependent
formula, and an existing install receipt. The objects that are
interacting here each expect the resulting collection to have certain
properties, and the expectations are not consistent.

Clear up this confusing mess by only dealing with Options collections.
This keeps our representation of options uniform across the codebase.

We can remove BuildOptions dependency on HomebrewArgvExtension, which
allows us to pass any Array-like collection to Tab.create. The only
other site inside of FormulaInstaller that uses the array is the #exec
call, and there it is splatted and thus we can substitute our Options
collection there as well.
2013-01-26 12:14:47 -06:00
Jack Nagel
02b8d34339 Tab#with? to mirror BuildOptions#with?
Eventually a common interface could be factored out into a module, but
for now this will suffice.
2013-01-26 12:14:43 -06:00
Jack Nagel
70ff06c827 Refactor option handling internals
Currently we handle options in several ways, and it is hard to remember
what code needs an option string ("--foo"), what needs only the name
("foo") and what needs an Option object.

Now that Option objects can act as strings and be converted to JSON, we
can start using them instead of passing around strings between Formula
objects, Tab objects, and ARGV-style arrays.

The Options class is a special collection that can be queried for the
inclusion of options in any form: '--foo', 'foo', or Option.new("foo").
2013-01-26 11:37:01 -06:00
Jack Nagel
f3d3bc4368 Move option comparison into BuildOptions 2013-01-26 11:37:00 -06:00
Jack Nagel
d8a83073ff Clean up Tab creation 2013-01-26 11:37:00 -06:00
Max Howell
50767c6077 Record HEAD SHA and date of installs in receipt 2012-08-29 12:41:33 -04:00
Mike McQuaid
3af3bc7dd5 Rename tab 'built_bottle' to 'build_as_bottle'. 2012-08-25 11:52:37 -07:00
Mike McQuaid
ebbc3438a1 Move used_options and unused_options to ARGV. 2012-08-25 11:52:37 -07:00
Jack Nagel
3f9e88ae69 Simplify build options API
Simplify access to the different forms of a formula's build options by
making options into real objects rather than strings, and expose both
the 'name' and 'flag' form.
2012-08-20 14:16:08 -05:00
Jack Nagel
8952bcf315 Fix writing build options to install receipt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 13:37:40 -05:00