C++ stdlibs: issue warning, don't fail the build

This commit is contained in:
Misty De Meo committed 2014-02-02 11:04:30 -08:00
1 parent 3d82b7303c
commit c3a331dfbf
3 files changed
+15 -15

No files matched your search

+8 -6
View File
@@ -168,13 +168,15 @@ class Build
# want to record the stdlib for something that installs no
# dylibs.
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.
# This currently only tracks a single C++ stdlib per dep,
# though it's possible for different libs/executables in
# a given formula to link to different ones.
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)
begin
stdlib_in_use.check_dependencies(f, deps)
rescue IncompatibleCxxStdlibs => e
opoo e.message
end
# This second check is recorded for checking dependencies,
# so executable are irrelevant at this point. If a piece
+2 -8
View File
@@ -115,14 +115,8 @@ end
class IncompatibleCxxStdlibs < Homebrew::InstallationError
def initialize(f, dep, wrong, right)
super f, <<-EOS.undent
#{f} dependency #{dep} was built with the following
C++ standard library: #{wrong.type_string} (from #{wrong.compiler})
This is incompatible with the standard library being used
to build #{f}: #{right.type_string} (from #{right.compiler})
Please reinstall #{dep} using a compatible compiler.
hint: Check https://github.com/Homebrew/homebrew/wiki/C++-Standard-Libraries
#{f} dependency #{dep} was built with a different C++ standard
library (#{wrong.type_string} from #{wrong.compiler}). This could cause problems at runtime.
EOS
end
end
+5 -1
View File
@@ -123,7 +123,11 @@ class FormulaInstaller
stdlibs = Keg.new(f.prefix).detect_cxx_stdlibs
stdlib_in_use = CxxStdlib.new(stdlibs.first, MacOS.default_compiler)
stdlib_in_use.check_dependencies(f, f.recursive_dependencies)
begin
stdlib_in_use.check_dependencies(f, f.recursive_dependencies)
rescue IncompatibleCxxStdlibs => e
opoo e.message
end
stdlibs = Keg.new(f.prefix).detect_cxx_stdlibs :skip_executables => true
tab = Tab.for_keg f.prefix