https://bugs.webkit.org/show_bug.cgi?id=141255
<rdar://problem/
19619691>
Reviewed by David Kilzer and Alexey Proskuryakov.
Fixes an issue where test-webkitpy fails on a Mac without the iOS SDK. We should
should not require the iphoneos SDK to be installed to run the webkitpy tests.
* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo.xcode_sdk_version): Added; return the version of the specified SDK, if
installed. We take advantage of the behavior that xcrun --show-sdk-version only writes
to standard output if the SDK is installed to return the empty string if the SDK is
not installed.
* Scripts/webkitpy/common/system/platforminfo_mock.py:
(MockPlatformInfo.xcode_sdk_version): Added.
* Scripts/webkitpy/port/ios.py:
(IOSPort.determine_full_port_name): Modified to call PlatformInfo.xcode_sdk_version()
to get the version of the iphoneos SDK, if installed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179622
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-02-04 Daniel Bates <dabates@apple.com>
+
+ test-webkitpy fails on Mac without iphoneos SDK
+ https://bugs.webkit.org/show_bug.cgi?id=141255
+ <rdar://problem/19619691>
+
+ Reviewed by David Kilzer and Alexey Proskuryakov.
+
+ Fixes an issue where test-webkitpy fails on a Mac without the iOS SDK. We should
+ should not require the iphoneos SDK to be installed to run the webkitpy tests.
+
+ * Scripts/webkitpy/common/system/platforminfo.py:
+ (PlatformInfo.xcode_sdk_version): Added; return the version of the specified SDK, if
+ installed. We take advantage of the behavior that xcrun --show-sdk-version only writes
+ to standard output if the SDK is installed to return the empty string if the SDK is
+ not installed.
+ * Scripts/webkitpy/common/system/platforminfo_mock.py:
+ (MockPlatformInfo.xcode_sdk_version): Added.
+ * Scripts/webkitpy/port/ios.py:
+ (IOSPort.determine_full_port_name): Modified to call PlatformInfo.xcode_sdk_version()
+ to get the version of the iphoneos SDK, if installed.
+
2015-02-04 Alexey Proskuryakov <ap@apple.com>
run-webkit-tests doesn't always capture ASan violation reports
import re
import sys
+from webkitpy.common.system.executive import Executive
class PlatformInfo(object):
"""This class provides a consistent (and mockable) interpretation of
except:
return sys.maxint
+ def xcode_sdk_version(self, sdk_name):
+ if self.is_mac():
+ # Assumes that xcrun does not write to standard output on failure (e.g. SDK does not exist).
+ return self._executive.run_command(["xcrun", "--sdk", sdk_name, "--show-sdk-version"], return_stderr=False, error_handler=Executive.ignore_error).rstrip()
+ return ''
+
def _determine_os_name(self, sys_platform):
if sys_platform == 'darwin':
return 'mac'
def terminal_width(self):
return 80
+
+ def xcode_sdk_version(self, sdk_name):
+ return '8.1'
@classmethod
def determine_full_port_name(cls, host, options, port_name):
if port_name == cls.port_name:
- sdk_version = '8.0'
- # FIXME: We should move the call to xcrun to the PlatformInfo object so that
- # we can use MockPlatformInfo to set an expectation when running the unit tests.
- if os.path.isfile('/usr/bin/xcrun'):
- sdk_command_output = subprocess.check_output(['/usr/bin/xcrun', '--sdk', 'iphoneos', '--show-sdk-version'], stderr=None).rstrip()
- if sdk_command_output:
- sdk_version = sdk_command_output
-
- port_name = port_name + '-' + re.match('^([0-9]+)', sdk_version).group(1)
-
+ iphoneos_sdk_version = host.platform.xcode_sdk_version('iphoneos')
+ if not iphoneos_sdk_version:
+ raise Exception("Ensure that the Xcode command line tools and the iphoneos SDK are installed.")
+ major_version_number = iphoneos_sdk_version.split('.')[0]
+ port_name = port_name + '-' + major_version_number
return port_name
def __init__(self, *args, **kwargs):