From a683404d44d5066a6ec434d025e2496b0c5bb44f Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 14 Nov 2013 23:18:08 +0000 Subject: [PATCH] PR 17916: Don't fail if xcrun is not present. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194745 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/lit.cfg | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/lit.cfg b/test/lit.cfg index 139126db99..bfac9f2415 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -359,11 +359,14 @@ if use_gmalloc: # On Darwin, support relocatable SDKs by providing Clang with a # default system root path. if 'darwin' in config.target_triple: - cmd = subprocess.Popen(['xcrun', '--show-sdk-path'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = cmd.communicate() - out = out.strip() - res = cmd.wait() + try: + cmd = subprocess.Popen(['xcrun', '--show-sdk-path'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = cmd.communicate() + out = out.strip() + res = cmd.wait() + except OSError: + res = -1 if res == 0 and out: sdk_path = out lit_config.note('using SDKROOT: %r' % sdk_path) -- 2.40.0