Commit Graph
80 Commits
Author SHA1 Message Date
Misty De Meo 6f7de3568c build: fix typo 2013-10-06 19:34:39 -07:00
Misty De Meo 4ed26b20f4 Track the OS's default C++ stdlib 2013-10-06 19:26:06 -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 045aadb860 Move CompilerSelector logic into build env setup
This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.

ENV.setup_build_environment now optionally takes a Formula argument
to provide the information necessary to do the fails_with, and the new
ENV.validate_cc! extracts the fails_with logic from Build.install.
2013-09-17 12:43:38 -07:00
Misty De Meo 500d40db58 Check dependencies for a compatible C++ stdlib
There are now a few possible C++ standard libraries a given build could
be using, with subtle incompatibilities and possibility of breakage
when mixed. This makes sure that the dependency chain was compiled in
a compatible manner.

Fortunately all of the Apple compilers use the same libstdc++, and we
don't yet support building with libc++, so this will primarily only
nag users trying to use GNU gcc who already have software installed
with Apple compilers.

Future TODOs:

* Add general support for building with libc++ (compatibility checking
  already handled here)
* Possibly track formulae which actually build C++ bindings, so that
  users aren't bothered by spurious nagging re: interpreted languages,
  pure-C software, etc.
2013-09-01 13:19:13 -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
Misty De Meo 4bbe6172c0 Move Tab creation into build process
The parent process doesn't have access to the selected compiler, which
will be important in the next commit.

Fortunately the child process already has a filtered and massaged
ARGV, so it has enough information to build the tab itself.
2013-09-01 13:19:13 -07:00
Jack Nagel 77d02c537d Move common stuff to extend/ENV.rb 2013-08-19 12:32:57 -05:00
Jack Nagel 84a00aa797 Make Superenv activation explicit 2013-08-19 12:32:56 -05:00
Jack Nagel 35752b9038 Handle optional build-time deps correctly 2013-07-22 21:36:11 -05:00
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