119 Commits

Author SHA1 Message Date
Jack Nagel
3c9cc18c17 Add ARGV.git? 2014-11-03 21:39:11 -06:00
Jack Nagel
3bbc9998a5 Rewrite debugger to remove monkeypatches and use of call/cc 2014-09-18 14:16:07 -05:00
Jack Nagel
f3b7c3236b Consistently call name on formula instead of relying on to_s 2014-09-14 11:19:30 -05:00
Jack Nagel
b14851903c Add a method for retrieving only flags from ARGV 2014-08-29 19:38:32 -05:00
Jack Nagel
26467fa9d7 Make sure all exceptions are sent back to the parent process 2014-08-27 17:25:13 -05:00
Jack Nagel
9386902cf8 Explicitly pass options into the build object 2014-08-27 17:25:13 -05:00
Jack Nagel
889996daf1 Spell out formula in parameter and attribute names 2014-08-27 17:25:13 -05:00
Jack Nagel
f5d18cceb6 Structure the build process so that we don't need an at_exit hook 2014-08-26 22:06:43 -05:00
Jack Nagel
8aabba670f Consider on-disk state when computing dependencies
Fixes Homebrew/homebrew#28754.
Fixes Homebrew/homebrew#29846.
Fixes Homebrew/homebrew#30920.
2014-08-24 14:46:34 -05:00
Jack Nagel
05bb612ce7 Use opt_prefix instead of constructing it manually 2014-08-23 17:42:13 -05:00
Jack Nagel
3d26b75847 Pull common stdlib checking code into a method 2014-08-22 22:18:03 -05:00
Jack Nagel
2a5218dacc Remove unnecessary lasgn 2014-08-09 17:50:55 -05:00
Jack Nagel
47a82b036e Move tab creation outside of the debug loop 2014-08-09 17:50:53 -05:00
Jack Nagel
105db77fc0 Extract build-time stdlib check to a method 2014-08-09 17:50:52 -05:00
Jack Nagel
142beddd7a Use polymorphism to simplify stdlib compatibility check 2014-08-02 19:29:59 -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
c1ba34734d Remove unused require 2014-07-29 17:09:04 -05:00
Jack Nagel
3f12ddbccd Decouple DATA patches from the executing script 2014-07-29 16:22:06 -05:00
Jack Nagel
8ca8ec3993 Fix up dep directories before activating ENV extensions 2014-07-28 23:20:23 -05:00
Jack Nagel
8a971f7268 Move the fixopt method into the Build class 2014-07-28 21:25:49 -05:00
Jack Nagel
001b2ee471 Reuse existing keg object 2014-06-26 17:21:10 -05:00
Jack Nagel
10fda9e9b9 Decouple spec selection from ARGV 2014-06-20 21:32:36 -05:00
Jack Nagel
f0e13ee97b Use multiple argument form of system 2014-06-20 18:37:24 -05:00
Jack Nagel
e3f082c294 Stop joining symbols to pathnames
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-09 14:57:21 -05:00
Jack Nagel
974b7e71ef Use opt shortcut methods 2014-06-09 14:57:21 -05:00
Jack Nagel
59515ea126 Remove executable bit from build.rb
- the executed script is the formula file, build.rb is a library
 - ruby is invoked directly, so it wouldn't need to be executable anyway
2014-05-03 10:01:30 -05:00
Jack Nagel
ce1f598e98 Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
2014-04-05 12:17:19 -05:00
Jack Nagel
c7a54f8da1 Use ARGV.env 2014-03-13 16:37:11 -05:00
Jack Nagel
d965bbba47 Allow the debugger to work from inside staged resources
References Homebrew/homebrew#23263.
Closes Homebrew/homebrew#27445.
2014-03-13 10:05:57 -05:00
Jack Nagel
9a83f63c21 Prefer Formula#name method over Formula#to_s 2014-03-03 23:51:30 -06:00
Jack Nagel
caa12678d8 Skip dependency expansion completely when ignore_deps? is true 2014-03-03 23:48:25 -06:00
Misty De Meo
d885d98164 C++ stdlibs: issue warning, don't fail the build 2014-02-02 11:04:30 -08:00
Misty De Meo
edf474cb63 C++ stdlib check: don't check executables for deps
This avoids some possible false positives, as happens with, e.g., qt4.
2014-02-02 11:04:30 -08:00
Jack Nagel
08055e1776 Ensure option names are consistent for default formula requirements 2013-12-09 14:36:10 -06:00
Jack Nagel
69dcc2592c Don't mutate deps collection when expanding requirements
Fixes Homebrew/homebrew-science#213.
2013-12-02 12:47:50 -06:00
Jack Nagel
ae1d00e31f Revert "FormulaInstaller: flush before closing writes."
This reverts commit 5ce8f7a3a494e1d8e812369301fd4c4a05a7d9b7.
2013-11-29 21:05:27 -06:00
Mike McQuaid
3c3bd76528 FormulaInstaller: flush before closing writes.
This seems to help the problem with `brew install -v` sometimes truncating output.

Closes Homebrew/homebrew#24666.
2013-11-26 16:28:27 +00:00
Jack Nagel
2fb5ead38a Prevent deps of build-time deps from leaking into the build environment
When decided what dependencies should be part of the build environment
(and have appropriate entries added to variables like PKG_CONFIG_PATH),
we select the entire dependency tree except for

 (1) inactive optional and recommended deps (2) indirect build-time deps
 (i.e., build-time deps of other deps)

There is a third category that sould be excluded: dependencies of direct
build-time deps. These are irrelevant to the build, and including them
can cause unexpected linkages.
2013-11-13 10:38:14 -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
Misty De Meo
80c77e6113 build: fix typo 2013-10-06 19:34:39 -07:00
Misty De Meo
8427e71368 Track the OS's default C++ stdlib 2013-10-06 19:26:06 -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
1ae81f0bf7 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
7c3d6ea81c 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
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
Misty De Meo
3ac74331a8 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
eebc04ec9b Move common stuff to extend/ENV.rb 2013-08-19 12:32:57 -05:00
Jack Nagel
bf0e329010 Make Superenv activation explicit 2013-08-19 12:32:56 -05:00
Jack Nagel
93af660c7f Handle optional build-time deps correctly 2013-07-22 21:36:11 -05:00
Jack Nagel
0f314f9808 Remove unused variable 2013-06-12 17:25:29 -05:00