Add support infrastructure for OpenSource iOS builders and testers
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Sep 2015 18:36:27 +0000 (18:36 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Sep 2015 18:36:27 +0000 (18:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149534

Reviewed by Darin Adler.

Towards setting up OpenSource iOS build bots, teach buildbot and its support
scripts about iOS.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(appendCustomBuildFlags): Require the caller to pass parameter fullPlatform and append
--ios-simulator or --device for a builder/tester whose full platform name begins with
"ios-simulator" or "ios", respectively.
(RunJavaScriptCoreTests.start): Pass the full platform name to appendCustomBuildFlags().
* BuildSlaveSupport/built-product-archive:
(main): Pass the full platform name to determineWebKitBuildDirectory().
(determineWebKitBuildDirectory): Call script webkit-build-directory with the appropriate
command line flag when building for iOS.
(archiveBuiltProduct): Use the same logic for iOS as we do for Mac. Also, remove unused
parameter fullPlatform. This parameter was originally added in r125066 to support the
Chromium Android port, which has since been removed from the OpenSource WebKit Project.
(extractBuiltProduct): Use the same logic for iOS as we do for Mac.
* BuildSlaveSupport/clean-build:
(main): Call script webkit-build-directory with the appropriate command line flag when
building for iOS.
* BuildSlaveSupport/delete-stale-build-files:
(main): Use the same logic for iOS as we do for Mac.
(webkitBuildDirectory): Call script webkit-build-directory with the appropriate command line
flag when building for iOS.
* BuildSlaveSupport/test-result-archive:
(archiveTestResults): Use the same logic for iOS as we do for Mac.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg
Tools/BuildSlaveSupport/built-product-archive
Tools/BuildSlaveSupport/clean-build
Tools/BuildSlaveSupport/delete-stale-build-files
Tools/BuildSlaveSupport/test-result-archive
Tools/ChangeLog

index f9430ae..0599ce8 100644 (file)
@@ -188,9 +188,14 @@ class InstallGtkDependencies(shell.ShellCommand):
     command = ["perl", "./Tools/Scripts/update-webkitgtk-libs"]
     haltOnFailure = True
 
-def appendCustomBuildFlags(step, platform, fullPlatform=""): 
-    if platform in ('efl', 'gtk', 'wincairo'):
-        step.setCommand(step.command + ['--' + platform])
+def appendCustomBuildFlags(step, platform, fullPlatform):
+    if platform not in ('efl', 'gtk', 'wincairo', 'ios'):
+        return
+    if fullPlatform.startswith('ios-simulator'):
+        platform = 'ios-simulator'
+    elif platform == 'ios':
+        platform = 'device'
+    step.setCommand(step.command + ['--' + platform])
 
 class CompileWebKit(shell.Compile):
     command = ["perl", "./Tools/Scripts/build-webkit", WithProperties("--%(configuration)s")]
@@ -287,7 +292,7 @@ class RunJavaScriptCoreTests(TestWithFailureCount):
     failedTestsFormatString = "%d JSC test%s failed"
 
     def start(self):
-        appendCustomBuildFlags(self, self.getProperty('platform'))
+        appendCustomBuildFlags(self, self.getProperty('platform'), self.getProperty('fullPlatform'))
         return shell.Test.start(self)
 
     def countFailures(self, cmd):
index 0e39b2b..09f262b 100644 (file)
@@ -52,7 +52,7 @@ def main():
         return 1
 
     genericPlatform = options.platform.split('-', 1)[0]
-    if not determineWebKitBuildDirectory(genericPlatform, options.configuration):
+    if not determineWebKitBuildDirectory(genericPlatform, options.platform, options.configuration):
         print >> sys.stderr, "Could not determine build directory"
         return 1
 
@@ -62,8 +62,12 @@ def main():
         return extractBuiltProduct(options.configuration, genericPlatform)
 
 
-def determineWebKitBuildDirectory(platform, configuration):
+def determineWebKitBuildDirectory(platform, fullPlatform, configuration):
     global _buildDirectory
+    if fullPlatform.startswith('ios-simulator'):
+        platform = 'ios-simulator'
+    elif platform == 'ios':
+        platform = 'device'
     _buildDirectory = subprocess.Popen(['perl', os.path.join(os.path.dirname(__file__), "..", "Scripts", "webkit-build-directory"),
         "--" + platform, "--" + configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
     return _buildDirectory
@@ -110,12 +114,12 @@ def createZip(directoryToZip, configuration):
         return subprocess.call(["zip", "-y", "-r", archiveFile, "."], cwd=directoryToZip)
 
 
-def archiveBuiltProduct(configuration, platform, fullPlatform):
-    assert platform in ('mac', 'win', 'gtk', 'efl')
+def archiveBuiltProduct(configuration, platform):
+    assert platform in ('mac', 'win', 'gtk', 'efl', 'ios')
 
     configurationBuildDirectory = os.path.join(_buildDirectory, configuration.title())
 
-    if platform == 'mac':
+    if platform in ('mac', 'ios'):
         return createZip(configurationBuildDirectory, configuration)
     elif platform == 'win':
         binDirectory = os.path.join(configurationBuildDirectory, "bin32")
@@ -179,7 +183,7 @@ def unzipArchive(directoryToExtractTo, configuration):
 
 
 def extractBuiltProduct(configuration, platform):
-    assert platform in ('mac', 'win', 'gtk', 'efl')
+    assert platform in ('mac', 'win', 'gtk', 'efl', 'ios')
 
     archiveFile = os.path.join(_buildDirectory, configuration + ".zip")
     configurationBuildDirectory = os.path.join(_buildDirectory, configuration.title())
@@ -187,7 +191,7 @@ def extractBuiltProduct(configuration, platform):
     removeDirectoryIfExists(configurationBuildDirectory)
     os.makedirs(configurationBuildDirectory)
 
-    if platform == 'mac':
+    if platform in ('mac', 'ios'):
         return unzipArchive(_buildDirectory, configuration)
     elif platform == 'win' or platform == 'gtk' or platform == 'efl':
         print "Extracting", configurationBuildDirectory
index eaecb12..1ff6bb0 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright (C) 2013 Apple Inc.  All rights reserved.
+# Copyright (C) 2013, 2015 Apple Inc.  All rights reserved.
 # Copyright (C) 2012 Google Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -43,10 +43,15 @@ def main():
         parser.error("Configuration is required")
         return -2
 
-    generic_platform = options.platform.split('-', 1)[0]
+    if options.platform.startswith('ios-simulator'):
+        platform = 'ios-simulator'
+    elif options.platform.startswith('ios'):
+        platform = 'device'
+    else:
+        platform = options.platform.split('-', 1)[0]
 
     webkit_build_directory = subprocess.Popen(['perl', os.path.join(os.path.dirname(__file__), "..", "Scripts", "webkit-build-directory"),
-        "--" + generic_platform, "--" + options.configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
+        "--" + platform, "--" + options.configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
 
     shutil.rmtree(webkit_build_directory)
 
index d4c50d7..bb31c0f 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright (C) 2013 Apple Inc.  All rights reserved.
+# Copyright (C) 2013, 2015 Apple Inc.  All rights reserved.
 # Copyright (C) 2012 Google Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -45,14 +45,14 @@ def main():
         return -2
 
     genericPlatform = options.platform.split('-', 1)[0]
-    if genericPlatform != 'mac':
+    if genericPlatform not in ('mac', 'ios'):
         print 'Exited without removing any files.'
         return 0
 
     if options.build_directory:
         buildDirectory = options.build_directory
     else:
-        buildDirectory = webkitBuildDirectory(genericPlatform, options.configuration)
+        buildDirectory = webkitBuildDirectory(genericPlatform, options.platform, options.configuration)
 
     exit_code = 0
 
@@ -78,7 +78,11 @@ def main():
     return exit_code
 
 
-def webkitBuildDirectory(platform, configuration):
+def webkitBuildDirectory(platform, fullPlatform, configuration):
+    if fullPlatform.startswith('ios-simulator'):
+        platform = 'ios-simulator'
+    elif platform == 'ios':
+        platform = 'device'
     return subprocess.Popen(['perl', os.path.join(os.path.dirname(__file__), "..", "Scripts", "webkit-build-directory"),
         "--" + platform, "--" + configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
 
index aed195e..4b81f8e 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-# Copyright (C) 2009 Apple Inc.  All rights reserved.
+# Copyright (C) 2009, 2015 Apple Inc.  All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -46,7 +46,7 @@ def main():
     return archiveTestResults(options.configuration, options.platform, layoutTestResultsDir)
 
 def archiveTestResults(configuration, platform, layoutTestResultsDir):
-    assert platform in ('mac', 'win', 'gtk', 'efl', 'wincairo')
+    assert platform in ('mac', 'win', 'gtk', 'efl', 'wincairo', 'ios')
 
     try:
         os.unlink(archiveFile)
@@ -63,7 +63,7 @@ def archiveTestResults(configuration, platform, layoutTestResultsDir):
 
     open(os.path.join(layoutTestResultsDir, '.placeholder'), 'w').close()
 
-    if platform == 'mac':
+    if platform in ('mac', 'ios'):
         if subprocess.call(["ditto", "-c", "-k", "--sequesterRsrc", "--zlibCompressionLevel", "2", layoutTestResultsDir, archiveFile]):
             return 1
     elif platform in ('win', 'gtk', 'efl', 'wincairo'):
index 651b541..73494c3 100644 (file)
@@ -1,5 +1,38 @@
 2015-09-24  Daniel Bates  <dabates@apple.com>
 
+        Add support infrastructure for OpenSource iOS builders and testers
+        https://bugs.webkit.org/show_bug.cgi?id=149534
+
+        Reviewed by Darin Adler.
+
+        Towards setting up OpenSource iOS build bots, teach buildbot and its support
+        scripts about iOS.
+
+        * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+        (appendCustomBuildFlags): Require the caller to pass parameter fullPlatform and append
+        --ios-simulator or --device for a builder/tester whose full platform name begins with
+        "ios-simulator" or "ios", respectively.
+        (RunJavaScriptCoreTests.start): Pass the full platform name to appendCustomBuildFlags().
+        * BuildSlaveSupport/built-product-archive:
+        (main): Pass the full platform name to determineWebKitBuildDirectory().
+        (determineWebKitBuildDirectory): Call script webkit-build-directory with the appropriate
+        command line flag when building for iOS.
+        (archiveBuiltProduct): Use the same logic for iOS as we do for Mac. Also, remove unused
+        parameter fullPlatform. This parameter was originally added in r125066 to support the
+        Chromium Android port, which has since been removed from the OpenSource WebKit Project.
+        (extractBuiltProduct): Use the same logic for iOS as we do for Mac.
+        * BuildSlaveSupport/clean-build:
+        (main): Call script webkit-build-directory with the appropriate command line flag when
+        building for iOS.
+        * BuildSlaveSupport/delete-stale-build-files:
+        (main): Use the same logic for iOS as we do for Mac.
+        (webkitBuildDirectory): Call script webkit-build-directory with the appropriate command line
+        flag when building for iOS.
+        * BuildSlaveSupport/test-result-archive:
+        (archiveTestResults): Use the same logic for iOS as we do for Mac.
+
+2015-09-24  Daniel Bates  <dabates@apple.com>
+
         Remove Chromium-specific changes to script built-product-archive
         https://bugs.webkit.org/show_bug.cgi?id=149530