llvm+lldb plaform=darwin: check for lldb_codesign certificate (#7012)

* llvm+lldb plaform=darwin: check for lldb_codesign

Building LLVM with LLDB requires that the "lldb_codesign" code
certificate be created (see
https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt for
details). This commit checks for this certificate on Darwin if LLDB is
to be built, and returns an informative error message if this
certificate is unavailable.
This commit is contained in:
Geoffrey Oxberry 2018-05-09 06:04:06 -07:00 committed by Massimiliano Culpo
parent 4277b42ddc
commit 7dfc0278e7

View file

@ -415,6 +415,26 @@ class Llvm(CMakePackage):
# Github issue #4986
patch('llvm_gcc7.patch', when='@4.0.0:4.0.1+lldb %gcc@7.0:')
@when('+lldb platform=darwin')
@run_before('cmake')
def check_darwin_lldb_codesign_requirement(self):
codesign = which('codesign')
cp = which('cp')
mkdir('tmp')
llvm_check_file = join_path('tmp', 'llvm_check')
cp('/usr/bin/false', llvm_check_file)
try:
codesign('-f', '-s', 'lldb_codesign', '--dryrun',
llvm_check_file)
except ProcessError:
explanation = ('The "lldb_codesign" identity must be available'
' to build LLVM with LLDB. See https://llvm.org/'
'svn/llvm-project/lldb/trunk/docs/code-signing'
'.txt for details on how to create this identity.')
raise RuntimeError(explanation)
def setup_environment(self, spack_env, run_env):
spack_env.append_flags('CXXFLAGS', self.compiler.cxx11_flag)