Title: [179622] trunk/Tools
- Revision
- 179622
- Author
- [email protected]
- Date
- 2015-02-04 12:26:23 -0800 (Wed, 04 Feb 2015)
Log Message
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.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (179621 => 179622)
--- trunk/Tools/ChangeLog 2015-02-04 20:03:52 UTC (rev 179621)
+++ trunk/Tools/ChangeLog 2015-02-04 20:26:23 UTC (rev 179622)
@@ -1,3 +1,25 @@
+2015-02-04 Daniel Bates <[email protected]>
+
+ 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 <[email protected]>
run-webkit-tests doesn't always capture ASan violation reports
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py (179621 => 179622)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py 2015-02-04 20:03:52 UTC (rev 179621)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py 2015-02-04 20:26:23 UTC (rev 179622)
@@ -29,6 +29,7 @@
import re
import sys
+from webkitpy.common.system.executive import Executive
class PlatformInfo(object):
"""This class provides a consistent (and mockable) interpretation of
@@ -118,6 +119,12 @@
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'
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (179621 => 179622)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py 2015-02-04 20:03:52 UTC (rev 179621)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py 2015-02-04 20:26:23 UTC (rev 179622)
@@ -55,3 +55,6 @@
def terminal_width(self):
return 80
+
+ def xcode_sdk_version(self, sdk_name):
+ return '8.1'
Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (179621 => 179622)
--- trunk/Tools/Scripts/webkitpy/port/ios.py 2015-02-04 20:03:52 UTC (rev 179621)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py 2015-02-04 20:26:23 UTC (rev 179622)
@@ -52,16 +52,11 @@
@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):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes