Commit Graph
166 Commits
Author SHA1 Message Date
Jack Nagel ef862627cf FormulaInstaller: ensure locks are always released 2013-06-11 15:35:30 -05:00
Jack Nagel 70069c5d75 Separate formula conflicts from requirements
Closes #20357.
2013-06-09 13:45:25 -05:00
Jack Nagel da5a8ed34c FormulaInstaller: factor out readline workaround 2013-06-08 15:14:23 -05:00
Mike McQuaid b0974b61e7 Use new download strategy for local bottles.
Fixes installation of e.g. ScriptFileFormula/denominator bottles.
2013-06-08 16:41:23 +01:00
Mike McQuaid 0817d4e3a9 Raise bottle exceptions for Homebrew developers. 2013-06-08 16:40:40 +01:00
Jack Nagel aae86b7a84 FormulaInstaller: fix "optional build-time dep" edge case
An "optional build-time dep" is unlikely, but possible, and I happen to
notice this wasn't handled correctly while digging around in the deps
code over the last few days.
2013-06-03 22:55:28 -05:00
Jack Nagel 5052cef024 FormulaInstaller: split up big method 2013-06-03 22:50:11 -05:00
Jack Nagel b2972dc1f9 Allow explicit conversion of requirements to deps
Fixes #19857.
2013-06-03 16:52:00 -05:00
Jack Nagel 75e371684e Adjust semantics of Formula#fetch
It doesn't really make logical sense that this method returns both the
fetched path (or sometimes nil!) and the downloader, so just return the
path (again, or nil!) and callers that want the downloader can ask for
it separately.
2013-05-16 14:06:26 -05:00
Jack Nagel 4386be0a19 Remove last use of deprecated Formula#recursive_deps
Fixes #19107.
2013-04-10 11:55:02 -05:00
Jack Nagel 0dbfedb4b7 FormulaInstaller: this local is an ivar now 2013-04-05 22:07:02 -05:00
Jack Nagel fe7efcca9f FormulaInstaller: initialize @tab 2013-04-05 22:00:36 -05:00
Jack Nagel 14bfaf275f Allow pipe fd to be inherited under Ruby 2.0 2013-04-05 17:42:53 -05:00
Jack Nagel 591496ccbf Don't error out when a package is already installed
Fixes #17010.
2013-04-03 18:27:28 -05:00
Mike McQuaid 391aa8408e Add optional post_install method to Formula.
Sometimes we may want to run commands after bottle installation (such as
creating directories outside the Cellar) so this method allows us to do
so.

Closes #18382.
2013-04-01 22:12:43 +01:00
Mike McQuaid b014824a38 formula_installer: warn on bottles being skipped.
We want to notify users that non-/usr/local installs may result in some
bottles being not used.

References #18540
2013-04-01 22:12:43 +01:00
Mike McQuaid de69336719 Fix local installation of bottles.
Fixes #18631.
2013-03-21 10:33:17 +00: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
Mike McQuaid 1ceff3741c Temporarily omit bottle source warning.
Pending a decent fix.

Fixes #18540.
2013-03-17 14:49:08 +00:00
Mike McQuaid 98047d08c4 Relocate bottles using install_name_tool.
This has two parts:

1. Bottles are temporarily relocated on bottling and tested if that is
sufficient for them to contain no longer reference the prefix or
cellar. If so, they are marked as relocatable.
2. On installation if bottles are marked as relocatable they will be
relocated using install_name_tool to the current prefix and cellar.

Closes #18374.
2013-03-11 18:58:37 +00:00
Shaun Jackman 076fcd11b0 Portability fixes to run Homebrew on Linux systems
Closes #16344.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-11 18:26:25 +00:00
Mike McQuaid 6c32a0d075 Add current Ruby globals.
Allows access to the Ruby path. Needed for Linux
porting.
2013-03-11 18:26:25 +00:00
Mike McQuaid a9a3cf7a19 Warn on bottles skipped due to non-default Cellar.
Closes #18333.
2013-03-09 21:29:53 +00:00
Jack Nagel 360fca45d0 Normalize magic encoding comments 2013-03-02 17:43:58 -06:00
Mike McQuaid 1e4af27b1d Build from source on bottle pour failure.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-01 17:49:09 +00:00
Jack Nagel e078d42740 This file has embedded UTF-8 2013-02-19 14:27:17 -06:00
Jack Nagel 33393a2597 Remove unused variables 2013-02-18 12:13:35 -06:00
Jack Nagel 5a34e80675 Don't use deprecated form of attr
The form "attr :name, true" is deprecated and causes Ruby to emit a
warning in verbose mode. Using attr_{reader,writer,accessor} is more
clear anyway, so do so.
2013-02-18 12:13:34 -06:00
Jack Nagel f8735f69a1 FormulaInstaller#check_requirements: fix inverted conditional 2013-02-02 14:51:10 -06:00
Jack Nagel 7522e4883b Proper recursive expansion of requirements with filtering
Expand requirements recursively while applying the same optional? and
recommended? filters that dependencies are run through. Options
generated by requirements are now checked against the correct list of
requirements, eliminating the temporary "best guess" logic in the
installer.
2013-01-31 15:40:06 -06:00
Jack Nagel 6797ae057a FormulaInstaller: actually select unsatisfied requirements
Fixes #17422.
2013-01-29 23:43:44 -06:00
Jack Nagel 01dca28dca Filter optional and reccommended requirements 2013-01-28 10:35:15 -06:00
Jack Nagel 1d1c9ba55c Consider correct dependent when skipping build-time deps
We skip build-time deps when installing from bottles. However, the
current logic only considers the root, rather than the actual dependent
formula. Given

  A (bottled)
  |__B (not bottled)
     |__C (build-time)

C will be pruned from the effective dependency tree of A. This is wrong,
because C is required in order to build B.

Fix this by examining the current dependent rather than the root.

Fixes #17356.
2013-01-27 21:20:09 -06:00
Jack Nagel 1ef497780a Extract unsatisfied dependency logic from installer 2013-01-27 21:20:09 -06:00
Jack Nagel 74a4c8e97d Don't force universal for build deps 2013-01-26 17:24:17 -06:00
Jack Nagel f54b81ba3e FormulaInstaller: wrap --build-from-source in an Option object
c.f. #17327.
2013-01-26 13:53:32 -06:00
Jack Nagel 41980bdfdf Replace usages of recursive_deps with recursive_dependencies 2013-01-26 12:14:49 -06: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 7a8935455b FormulaInstaller: allow formulae to pass options to deps
Formulae can now pass build options to dependencies. The following
syntax is supported:

  depends_on 'foo' => 'with-bar'
  depends_on 'foo' => ['with-bar', 'with-baz']

If a dependency is already installed but lacks the required build
options, an exception is raised. Eventually we may be able to just stash
the existing keg and reinstall it with the combined set of used_options
and passed options, but enabling that is left for another day.
2013-01-26 12:14:46 -06:00
Jack Nagel 0551dedf79 FormulaInstaller: don't install bottle if options were passed 2013-01-26 12:14:46 -06:00
Jack Nagel f76a8bdd1f FormulaInstaller: make tab an attr, but never a parameter 2013-01-26 12:14:46 -06:00
Jack Nagel f82ed2f33d FormulaInstaller: implement installation locks
FormulaInstaller now attempts to take a lock on a "foo.brewing" file for
the formula and all of its dependencies before attempting installation.

The lock is an advisory lock implemented using flock(), and as such it
only locks out other processes that attempt to take the lock. It also
means that it is never necessary to manually remove the lock file,
because the lock is not enforced by I/O.

The uninstall, link, and unlink commands all learn to respect this lock
as well, so that the installation cannot be corrupted by a concurrent
Homebrew process, and keg operations cannot occur simultaneously.
2013-01-26 12:14:45 -06:00
Jack Nagel d1dca30bef FormulaInstaller: skip build-time deps for bottles 2013-01-26 12:14:44 -06:00
Jack Nagel 0e5ca665bb FormulaInstaller: factor out dependency installation 2013-01-26 12:14:44 -06:00
Jack Nagel dc96fe8567 FormulaInstaller: factor out requirement checking 2013-01-26 12:14:44 -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 76c01e91e4 Clean up Tab creation 2013-01-26 11:37:00 -06:00
Randy Thiemann 9b173745e4 Allow hiding Homebrew emoji with an env var.
Closes #17085.
Closes #17086.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-19 23:13:01 +00:00
Jack Nagel 6497ab24ea Restore keg-only caveats
Fixes #16989.
2013-01-14 14:57:42 -06:00
Jack Nagel a2840225d8 Only mark install as attempted if it was actually attempted
Commit 30a08f5cc7 ("Don't attempt installation multiple times") was
correct in raising FormulaInstallationAlreadyAttemptedError early enough
to prevent the other exceptions in #check_install_sanity from being
raised, but it should not have moved the point at which formulae are
added to the attempted set. Doing so prevents the installer from being
instantiated multiple times on the same formula, even if installation
was never attempted.

Put it back where it belongs.
2013-01-13 15:46:46 -06:00