Commit Graph
70 Commits
Author SHA1 Message Date
Jack Nagel 5f032942ed Remove unused variable 2013-06-12 17:25:29 -05:00
Jack Nagel d6ff5fb1bf Cast deps to formula before passing them to superenv
Dependency names retain the "tap prefix", e.g. the "homebrew/dupes"
part of "homebrew/dupes/zlib". However formula objects do not, and this
is desired because we do not record the tap name as part of the
installation prefix.

So we need to ensure the correct dep names are passed to superenv,
otherwise it will not add the correct directories to various environment
variables.
2013-06-10 17:38:52 -05:00
Jack Nagel b2972dc1f9 Allow explicit conversion of requirements to deps
Fixes #19857.
2013-06-03 16:52:00 -05:00
Jack Nagel c2624cd40e build: expand dependencies only once
Closes #20081.
2013-05-25 15:27:10 -05:00
Jack Nagel fec99760d7 build: expand requirements only once 2013-05-25 15:26:55 -05:00
Jack Nagel c6e638bb75 build: make deps an attribute of Build 2013-05-25 15:26:55 -05:00
Jack Nagel d948946adf build: move build methods into a class 2013-05-25 15:26:55 -05:00
Misty De Meo 7780e13182 CompilerSelector: raise when no compatible compiler
This replaces the old behaviour of falling back to the original
compiler with no messaging.

Fixes #19170.
Fixes mistydemeo/tigerbrew#45.
2013-05-20 23:25:15 -05:00
Jack Nagel b2802888d9 build: use ARGV.interactive? instead of .flag? 2013-05-20 22:34:53 -05:00
Jack Nagel 725704f7fb Isolate compiler selector tests 2013-04-02 13:19:04 -05:00
Jack Nagel 6ab348ea0a Decouple CompilerSelector from ENV 2013-03-16 13:05:02 -05:00
Jack Nagel 5ddd40b844 Switch compilers when no build is specified
Given the current state of OS X compilers, the original fails_with
behavior is becoming less useful, mostly resulting in build failures
each time the compiler is updated. So make the following changes:

When a build is specified, we retain the old behavior: switch compilers
if the available compiler is <= the build, don't switch if it is > the
build.

When no build is specified, unconditionally switch compilers, and don't
output the advice message. This allows us to mark formulae as
perpetually failing, avoiding the need to update formulae each time a
new compiler build is made available.

As a bonus, this makes the logic much easier to reason about.

Closes #18175.
2013-03-12 13:55:15 -05:00
Jack Nagel 7000d48d99 Rename these collections for clarity 2013-03-09 17:13:34 -06:00
Jack Nagel cfe799a43d Save a subshell here 2013-03-02 23:28:27 -06:00
Jack Nagel d4dfe35a0c build: ignore non-explicit build-time dependencies
Given the following dependency tree:

  foo
    bar (bottled)
      baz (build-time only)

We skip installing baz because it is a build-time dependency of
something that is bottled. However, during the build of foo, this filter
is not applied because the dependent-dep relationship is not considered
at this stage. If baz wasn't installed prior to this build, fixopt(baz)
will fail.

Further, build-time deps are tightly coupled to the formula they are
specified by, and we shouldn't rely on them coming from dependencies
several levels down.

Fixes #17697.
2013-02-09 14:37:36 -06:00
Jack Nagel 46e29cb12e build: accept X11 proxies as X11 deps 2013-01-31 19:46:18 -06:00
Jack Nagel 41980bdfdf Replace usages of recursive_deps with recursive_dependencies 2013-01-26 12:14:49 -06:00
Jack Nagel 05fedd5c98 build: reorganize #install for readability 2013-01-21 17:14:16 -06:00
Jack Nagel 21fa09cebb Set userpaths before processing requirement ENV modifications 2013-01-09 11:46:51 -06:00
Jack Nagel bb03a39ad8 Allow requirements to specify env options 2012-12-26 14:37:03 -06:00
Adam Vandenberg e7f2e449e7 Teach Pathname how to scan for metafiles 2012-11-11 10:45:58 -08:00
Adam Vandenberg eb25ba8452 Use a class for FORMULA_META_FILES
* lets more text types get picked up
* better filter for `brew list`
2012-11-11 10:27:03 -08:00
Camillo Lugaresi dbfe304575 debrew: formula debugging for homebrew
A new feature for easing the pain of working with complex formulas, or
formulas for large packages. When running brew in debug mode (-d), if an
exception propagates outside the formula's install method, you now get a menu
which lets you return to the point where the exception was raised and perfom
several useful actions, such as:
- printing a backtrace
- entering IRB to examine the context and test ruby code
- entering the debugger (if ruby-debug is available)
- entering a shell
- ignoring the exception or proceeding with the raise as normal

Signed-off-by: Max Howell <mxcl@me.com>

* Fixed conflict in build.rb.
* Removed old debug handling in Formula.brew.

Closes #10435.
2012-10-28 11:39:02 -04:00
Adam Vandenberg 3831d104a7 Make --ignore-dependencies work again 2012-10-23 16:05:01 -07:00
Max Howell 1fc68c62d8 Clean up and improve build-error output and logs
All logs are now stored from each command executed in Formula.install.

Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
2012-09-25 11:31:56 -04:00
Max Howell 023f2bd85b Fix fixopt and fixopt error handling
The Keg constructor was throwing because we were returning a relative path, and the error-handler was just returning a string rather than raising a string.

Worrying because a lot of opts have not been fixed and I thought this was essential for depending on keg-only formula nowadays.

Refs #15077.
2012-09-24 11:41:21 -04:00
Max Howell 9de4b5f030 Attempt to fix opt-paths for all deps
Since we changed superenv to set a PATH without /usr/local, all deps need to have opt paths.

Fixes #15077.
2012-09-24 11:09:13 -04:00
Max Howell c524ffe9ba superenv: Remove HOMEBREW_PREFIX/bin from PATH
We add the bins from all deps instead. Rationale: formula find and use eg. GNU-coreutils versions of things and then break. Only allow formula to use tools that they depend on and expect.

I want to go further and only add include paths etc. for dependencies, I have done some work on this, but I fear it may be impossible. If an include path is eg. /usr/local/lib/foo/include, is it possible to know if this path is bad? Not always AFAICT.
2012-09-23 21:26:50 -04:00
Adam Vandenberg c6f30a77b3 Support env :std, :userpaths
Closes #14654.
2012-09-14 09:14:48 -07:00
Max Howell 728fe7e637 Install plists in FormulaInstaller, not build.rb
Build rb should only build!
2012-09-13 17:00:02 -04:00
Max Howell 86d8f1c211 ghc requires std-env
Because it builds a tool (cabal) that uses the same env that built it to build stuff.
2012-09-13 16:49:53 -04:00
Max Howell 9d9217da7a Auctex needs user path; Fixes #14699 2012-09-13 09:15:24 -04:00
Max Howell 2506bcec9e Apply userpaths after superenv-setup
Fixes #14701. Stupid mistake.
2012-09-13 09:06:37 -04:00
Adam Vandenberg 1a5df200bb Fix code that chmods metafiles 2012-09-09 13:23:03 -07:00
Adam Vandenberg ac59720b27 Install plists by default 2012-09-09 13:02:48 -07:00
Max Howell 19971f7579 Prevent possible bug in build's optlink 2012-09-03 15:12:29 -04:00
Jack Nagel dbc9523d30 Process requirements before keg-only deps under stdenv
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-02 14:41:19 -05:00
Max Howell 817f27e3fd Blacklist graphviz: don't use superenv
Mysterious link errors due to two missing symbols are too mysterious for me. For now, blacklist.

Fixes #14566.
2012-09-01 00:27:52 -04:00
Max Howell b644ed4f59 Fixes #14594; superenv recursively finds X11 req 2012-08-31 13:29:46 -04:00
Max Howell 3c274e2ad0 Revert the user-PATH fix
User paths might have anything in them, anything can break builds.

Instead special case these two formula with the view to having an eventual DSL to allow injection of user paths into superenv. Certainly defaulting to off.
2012-08-31 10:22:10 -04:00
Max Howell e729885ea1 Force Wine to use stdenv for now
Fixes #14535.
2012-08-29 19:49:10 -04:00
Max Howell a96686ab33 Warn about removed warnings less shockingly
The problem here now is though that the warnings only appear when compiling verbosely. But they should thus be visible if the build fails. Or if people are hunting for problems.
2012-08-29 15:19:42 -04:00
Max Howell 45aef5a812 Fixes #14528; undefined vars.
Due to copy/pasta.
2012-08-29 14:54:07 -04:00
Max Howell 3a35b5208e superenv only adds X11 paths if required
Since we are moving towards only depending on X11 for X-headers, superenv now doesn't automatically add X11 compilation. I was reluctant to do this, but it is the right thing to do now that X11 is not automatically installed by OS X or Xcode.

I didn't implement ENV.x11 because the order that the X headers are inserted is important. It must be done at initial setup to ensure that brewed versions of e.g. freetype and Cairo are used and not the ones installed by XQuartz.
2012-08-29 12:41:37 -04:00
Max Howell 6fca47ae5f Warn user if they set CFLAGS, etc. with superenv
Since we remove some CFLAGS under their noses, this would otherwise be quite confusing.

Notably, this will now trigger in numerous formula. Sucks.
2012-08-29 12:41:37 -04:00
Max Howell 7116a5bd3d Attempt to fix opt link if absent
This is mainly to prevent errors when users for the transitionary period where most installed kegs do not have an opt link.
2012-08-29 12:41:36 -04:00
Max Howell b1dc03861e Much better CTRL-C handling
Let's not show weird error messages when user interrupts during various stages of brew initialization.

Tested by doing `for x in $(brew search); do brew install $x; done` and pressing CTRL-C at random short intervals.
2012-08-29 12:41:35 -04:00
Max Howell 74bdd04729 Force --env=std for stuff using scons, etc.
Python et al, require stdenv because otherwise pip, gem, etc. don't work. Can be fixed, just I'm not doing it now.

We want a DSL to do this but I couldn't be bothered to make that work etc. I want to commit. Apologies.
2012-08-29 12:41:34 -04:00
Max Howell 59736fb537 superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.

Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.

The previous ENV-system is still available when --env=std is specified.

superenv applies to Xcode >= 4.3 only currently.
2012-08-29 12:41:34 -04:00
Max Howell 0c74cd92cf Create active symlinks for installed formula
Similar to the LinkedKegs record, we write a symlink for installed kegs to PREFIX/opt.

Unlike the linked-keg record, unlinking doesn't remove the link, only uninstalling, and keg-only formula have a record too.

The reason for this addition is so that formula that depend on keg-only formula can build against the opt directory and not the cellar keg. Thus surviving upgrades.

To enforce this fix_install_names and built were adapted to use the opt path.

Standard kegs also create an opt symlink so that caveats can now refer to the opt directory and thus provide steps that survive upgrades too.

Thus the choice of /opt. It is short, neat and the right choice: POSIX dictates that opt is for stand-alone prefixes of software.
2012-08-29 12:41:33 -04:00