Commit Graph
29 Commits
Author SHA1 Message Date
Jack Nagel 070255da2d Tab: ensure file is closed after reading 2013-10-23 23:24:42 -05:00
Misty De Meo f40af36f90 Tab#cxxstdlib: don't try to convert nil to_sym 2013-10-07 00:25:26 -07:00
Misty De Meo f05865ba9b Tab#cxxstdlib: remove default stdlib
Fixes #23089.
2013-10-07 00:15:03 -07:00
Misty De Meo 7da592ca12 Tab.dummy_tab: don't provide default stdlib value 2013-10-07 00:00:43 -07:00
Misty De Meo 52af93123a 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 881d2295ea 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 81cc136f34 Be explicit about passing formulae names or instances to Tab 2013-06-26 19:58:08 -07:00
Jack Nagel c7c8d6c02d Use OkJson directly 2013-06-22 21:34:03 -05:00
Jack Nagel 163067512b Add Utils::JSON to wrap the JSON implementation 2013-06-22 21:34:02 -05:00
Jack Nagel 94209b221a 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 74cf152787 Tab#to_s returns a one-line summary of the receipt 2013-03-28 14:16:15 -05:00
Mike McQuaid 5010dca995 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 #18430.
Closes #18475.
2013-03-20 23:06:38 +00:00
Jack Nagel 775184240d 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 5590331290 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 8f5ea8eea6 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 8d0c65e47b Move option comparison into BuildOptions 2013-01-26 11:37:00 -06:00
Jack Nagel 76c01e91e4 Clean up Tab creation 2013-01-26 11:37:00 -06:00
Max Howell 8c87b475a9 Record HEAD SHA and date of installs in receipt 2012-08-29 12:41:33 -04:00
Mike McQuaid 8837423a5a Rename tab 'built_bottle' to 'build_as_bottle'. 2012-08-25 11:52:37 -07:00
Mike McQuaid 1b7056346b Move used_options and unused_options to ARGV. 2012-08-25 11:52:37 -07:00
Jack Nagel 803535556c 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 e532239fea Fix writing build options to install receipt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 13:37:40 -05:00
Max Howell f9c87aecc3 Record tap-origin in the install-receipt 2012-03-16 21:06:17 +00:00
Jack Nagel 17743d34a3 Don't return nil from Formula#linked_keg
Doing so was the result of a quick hack to fix the "deps installed as
upgrades don't get linked" bug, but it was a mistake. Instead, always
return the LinkedKegs entry as a Pathname object, and let callers be
responsible for checking that it exists.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 23:52:01 -06:00
Mike McQuaid 47bd7be80a Store in tab whether --build-bottle flag was used.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2012-01-16 21:05:00 +00:00
Jack Nagel 8fa64c00b4 Tab: handle non-core kegs without receipts
Passing Formula.factory the name of a keg that belongs to a non-core
formula will cause an error to be raised; we don't really care, so just
fake a totally empty install receipt in this case.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-05 12:03:04 -06:00
Jack Nagel 913b8c4d60 tab: allow retrieving tabs from arbitrary kegs
This will be useful in places where we need information about things
other than the currently linked keg, such as `brew info`.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-03 19:50:19 -06:00
Charlie Sharpsteen 7148211304 metadata: Use options from previous installs
FormulaInstaller now loads the install recipt of a previous install and appends
the `used_options` to ARGV before forking to build. This means `brew upgrade`
will "remember" which options were invoked for the last install and re-use
them.

Fixes #5250.
2011-11-13 12:14:56 -08:00
Charlie Sharpsteen 9e773c3344 metadata: Record installation options
Adds a new class called `Tab` that acts as a recipt for install options. A
`Tab` can be serialized to a JSON file for future reference.
2011-11-13 12:14:56 -08:00