diff options
| author | Misty De Meo | 2013-10-22 22:21:59 -0700 |
|---|---|---|
| committer | Misty De Meo | 2013-10-26 21:54:29 -0700 |
| commit | a90b5cda0c2ecdee373bf17a61599912184f4307 (patch) | |
| tree | 9dee818bdb1d01f0045e1178140e0dfe6dbafbea /Library/Homebrew/build.rb | |
| parent | ef5b82c65f3935abab266990ee4caaf154d1a6f4 (diff) | |
| download | homebrew-a90b5cda0c2ecdee373bf17a61599912184f4307.tar.bz2 | |
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.
Diffstat (limited to 'Library/Homebrew/build.rb')
| -rwxr-xr-x | Library/Homebrew/build.rb | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index cc58bf4b0..8a4267bac 100755 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -141,17 +141,6 @@ class Build end end - # TODO Track user-selected stdlibs, such as boost in C++11 mode - stdlib = ENV.compiler == :clang ? MacOS.default_cxx_stdlib : :libstdcxx - stdlib_in_use = CxxStdlib.new(stdlib, ENV.compiler) - - # This is a bad place for this check, but we don't have access to - # compiler selection within the formula installer, only inside the - # build instance. - # This is also awkward because we don't actually know yet if this package - # will link against a C++ stdlib, but we don't want to test after the build. - stdlib_in_use.check_dependencies(f, deps) - f.brew do if ARGV.flag? '--git' system "git init" @@ -174,7 +163,17 @@ class Build begin f.install - Tab.create(f, ENV.compiler, + + stdlibs = Keg.new(f.prefix).detect_cxx_stdlibs + # It's technically possible for the same lib to link to multiple + # C++ stdlibs, but very bad news. Right now we don't track this + # woeful scenario. + stdlib_in_use = CxxStdlib.new(stdlibs.first, ENV.compiler) + # This will raise and fail the build if there's an + # incompatibility. + stdlib_in_use.check_dependencies(f, deps) + + Tab.create(f, ENV.compiler, stdlibs.first, Options.coerce(ARGV.options_only)).write rescue Exception => e if ARGV.debug? |
