Title: [190515] trunk/Tools
Revision
190515
Author
[email protected]
Date
2015-10-02 12:43:09 -0700 (Fri, 02 Oct 2015)

Log Message

LayoutTestRelay is not built and archived when building for iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=149753

Reviewed by Alexey Proskuryakov and Andy Estes.

Towards running layout tests on the iOS Simulator test bots, we need to teach scripts build-webkit
and built-product-archive to build the Mac tool LayoutTestRelay and include this tool in the built
product archive when building for iOS Simulator, respectively.

* BuildSlaveSupport/built-product-archive:
(main): Pass the full platform name (options.platform) to archiveBuiltProduct() so that it can
differentiate between iOS device and iOS Simulator platforms.
(webkitBuildDirectoryForConfigurationAndPlatform): Extracted logic to run the script webkit-build-directory
from determineWebKitBuildDirectories() into this function so that it can be used by both
determineWebKitBuildDirectories() and archiveBuiltProduct().
(determineWebKitBuildDirectories): Moved logic to execute the script webkit-build-directory from here to
webkitBuildDirectoryForConfigurationAndPlatform().
(createZip): Added parameter embedParentDirectoryNameOnDarwin (defaults to False) to specify whether
we should call ditto(1) with --keepParent to embed the parent directory name in the zip archive. This
argument is only applicable when building on Darwin. We only pass embedParentDirectoryNameOnDarwin=True
when making an archive for a Mac or iOS device build. For iOS Simulator builds we archive two directories
and we do not want to keep the parent directory because it is a placeholder directory used as a workaround
for the limitation that ditto(1) can only accept a single directory to archive on its command line.
(archiveBuiltProduct): Modified to take the full platform name as an argument. Added logic for iOS.
For iOS device builds we use the same logic as for a Mac build and archive the configuration-specific
build directory. For iOS Simulator builds we archive the configuration-specific iOS build directory,
LayoutTestRelay and LayoutTestRelay.dSYM (if it exists) from the configuration-specific Mac build.
* Scripts/build-layouttestrelay:
    - Remove unnecessary include of Perl module POSIX.
    - Only build LayoutTestRelay when building for iOS Simulator (i.e. --ios-simulator is passed).
* Scripts/build-webkit:
    - Invoke script build-layouttestrelay when building for iOS Simulator.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/built-product-archive (190514 => 190515)


--- trunk/Tools/BuildSlaveSupport/built-product-archive	2015-10-02 19:36:32 UTC (rev 190514)
+++ trunk/Tools/BuildSlaveSupport/built-product-archive	2015-10-02 19:43:09 UTC (rev 190515)
@@ -62,21 +62,29 @@
         return 1
 
     if action == 'archive':
-        return archiveBuiltProduct(options.configuration, genericPlatform)
+        return archiveBuiltProduct(options.configuration, genericPlatform, options.platform)
     else:
         return extractBuiltProduct(options.configuration, genericPlatform)
 
 
-def determineWebKitBuildDirectories(platform, fullPlatform, configuration):
-    global _configurationBuildDirectory
-    global _topLevelBuildDirectory
+def webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform='', returnTopLevelDirectory=False):
     if fullPlatform.startswith('ios-simulator'):
         platform = 'ios-simulator'
     elif platform == 'ios':
         platform = 'device'
     command = ['perl', os.path.join(os.path.dirname(__file__), '..', 'Scripts', 'webkit-build-directory'), '--' + platform, '--' + configuration]
-    _configurationBuildDirectory = subprocess.Popen(command + ['--configuration'], stdout=subprocess.PIPE).communicate()[0].strip()
-    _topLevelBuildDirectory = subprocess.Popen(command + ['--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
+    if returnTopLevelDirectory:
+        command += ['--top-level']
+    else:
+        command += ['--configuration']
+    return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0].strip()
+
+
+def determineWebKitBuildDirectories(platform, fullPlatform, configuration):
+    global _configurationBuildDirectory
+    global _topLevelBuildDirectory
+    _configurationBuildDirectory = webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform)
+    _topLevelBuildDirectory = webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform, returnTopLevelDirectory=True)
     return _topLevelBuildDirectory
 
 
@@ -100,7 +108,7 @@
     archiveZip.close()
 
 
-def createZip(directoryToZip, configuration):
+def createZip(directoryToZip, configuration, embedParentDirectoryNameOnDarwin=False):
     archiveDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild"))
     archiveFile = os.path.join(archiveDir, configuration + ".zip")
 
@@ -111,7 +119,11 @@
             raise
 
     if sys.platform == 'darwin':
-        return subprocess.call(["ditto", "-c", "-k", "--keepParent", "--sequesterRsrc", directoryToZip, archiveFile])
+        command = ['ditto', '-c', '-k', '--sequesterRsrc']
+        if embedParentDirectoryNameOnDarwin:
+            command += ['--keepParent']
+        command += [directoryToZip, archiveFile]
+        return subprocess.call(command)
     elif sys.platform == 'cygwin':
         return subprocess.call(["zip", "-r", archiveFile, "bin32"], cwd=directoryToZip)
     elif sys.platform == 'win32':
@@ -121,11 +133,33 @@
         return subprocess.call(["zip", "-y", "-r", archiveFile, "."], cwd=directoryToZip)
 
 
-def archiveBuiltProduct(configuration, platform):
+def archiveBuiltProduct(configuration, platform, fullPlatform):
     assert platform in ('mac', 'win', 'gtk', 'efl', 'ios')
 
-    if platform in ('mac', 'ios'):
-        return createZip(_configurationBuildDirectory, configuration)
+    if fullPlatform.startswith('ios-simulator'):
+        # We need to include in the archive the Mac tool, LayoutTestRelay, to run layout tests in the iOS simulator.
+        combinedDirectory = os.path.join(_topLevelBuildDirectory, 'combined-mac-and-ios')
+        removeDirectoryIfExists(combinedDirectory)
+        os.makedirs(combinedDirectory)
+
+        if subprocess.call(['/bin/cp', '-pR', _configurationBuildDirectory, combinedDirectory]):
+            return 1
+
+        macBuildDirectory = webkitBuildDirectoryForConfigurationAndPlatform(configuration, 'mac')
+        destinationDirectory = os.path.join(combinedDirectory, os.path.relpath(macBuildDirectory, _topLevelBuildDirectory))
+        os.makedirs(destinationDirectory)
+        for filename in ['LayoutTestRelay', 'LayoutTestRelay.dSYM']:
+            sourceFile = os.path.join(macBuildDirectory, filename)
+            if not os.path.exists(sourceFile):
+                continue
+            if subprocess.call(['/bin/cp', '-pR', sourceFile, destinationDirectory]):
+                return 1
+
+        if createZip(combinedDirectory, configuration):
+            return 1
+        shutil.rmtree(combinedDirectory)
+    elif platform in ('mac', 'ios'):
+        return createZip(_configurationBuildDirectory, configuration, embedParentDirectoryNameOnDarwin=True)
     elif platform == 'win':
         # FIXME: We shouldn't hardcode the assumption of a 32-bit build. See <https://bugs.webkit.org/show_bug.cgi?id=149715>.
         binDirectory = os.path.join(_configurationBuildDirectory, 'bin32')

Modified: trunk/Tools/ChangeLog (190514 => 190515)


--- trunk/Tools/ChangeLog	2015-10-02 19:36:32 UTC (rev 190514)
+++ trunk/Tools/ChangeLog	2015-10-02 19:43:09 UTC (rev 190515)
@@ -1,3 +1,38 @@
+2015-10-02  Daniel Bates  <[email protected]>
+
+        LayoutTestRelay is not built and archived when building for iOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=149753
+
+        Reviewed by Alexey Proskuryakov and Andy Estes.
+
+        Towards running layout tests on the iOS Simulator test bots, we need to teach scripts build-webkit
+        and built-product-archive to build the Mac tool LayoutTestRelay and include this tool in the built
+        product archive when building for iOS Simulator, respectively.
+
+        * BuildSlaveSupport/built-product-archive:
+        (main): Pass the full platform name (options.platform) to archiveBuiltProduct() so that it can
+        differentiate between iOS device and iOS Simulator platforms.
+        (webkitBuildDirectoryForConfigurationAndPlatform): Extracted logic to run the script webkit-build-directory
+        from determineWebKitBuildDirectories() into this function so that it can be used by both
+        determineWebKitBuildDirectories() and archiveBuiltProduct().
+        (determineWebKitBuildDirectories): Moved logic to execute the script webkit-build-directory from here to
+        webkitBuildDirectoryForConfigurationAndPlatform().
+        (createZip): Added parameter embedParentDirectoryNameOnDarwin (defaults to False) to specify whether
+        we should call ditto(1) with --keepParent to embed the parent directory name in the zip archive. This
+        argument is only applicable when building on Darwin. We only pass embedParentDirectoryNameOnDarwin=True
+        when making an archive for a Mac or iOS device build. For iOS Simulator builds we archive two directories
+        and we do not want to keep the parent directory because it is a placeholder directory used as a workaround
+        for the limitation that ditto(1) can only accept a single directory to archive on its command line.
+        (archiveBuiltProduct): Modified to take the full platform name as an argument. Added logic for iOS.
+        For iOS device builds we use the same logic as for a Mac build and archive the configuration-specific
+        build directory. For iOS Simulator builds we archive the configuration-specific iOS build directory,
+        LayoutTestRelay and LayoutTestRelay.dSYM (if it exists) from the configuration-specific Mac build.
+        * Scripts/build-layouttestrelay:
+            - Remove unnecessary include of Perl module POSIX.
+            - Only build LayoutTestRelay when building for iOS Simulator (i.e. --ios-simulator is passed).
+        * Scripts/build-webkit:
+            - Invoke script build-layouttestrelay when building for iOS Simulator.
+
 2015-10-02  Brent Fulgham  <[email protected]>
 
         [Win] Unreviewed test fix.

Modified: trunk/Tools/Scripts/build-layouttestrelay (190514 => 190515)


--- trunk/Tools/Scripts/build-layouttestrelay	2015-10-02 19:36:32 UTC (rev 190514)
+++ trunk/Tools/Scripts/build-layouttestrelay	2015-10-02 19:43:09 UTC (rev 190515)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (C) 2014 Apple Inc. All rights reserved.
+# Copyright (C) 2014-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
@@ -29,7 +29,6 @@
 use Getopt::Long qw(:config pass_through);
 use lib $FindBin::Bin;
 use webkitdirs;
-use POSIX;
 
 my $showHelp = 0;
 my $clean = 0;
@@ -57,10 +56,10 @@
 
 chdir "Tools/LayoutTestRelay" or die;
 
-if (isAppleMacWebKit()) {
-    $result = buildXCodeProject("LayoutTestRelay", $clean, XcodeOptions(), @ARGV);
-} else {
-    die "WebKitTestRunner is not supported on this platform.\n";
+if (isIOSWebKit() && willUseIOSSimulatorSDKWhenBuilding()) {
+    setXcodeSDK(undef); # Force use of Mac SDK
+    exit exitStatus(buildXCodeProject("LayoutTestRelay", $clean, XcodeOptions(), @ARGV));
 }
 
-exit exitStatus($result);
+print STDERR "LayoutTestRelay is only supported for iOS Simulator.\n";
+exit 1;

Modified: trunk/Tools/Scripts/build-webkit (190514 => 190515)


--- trunk/Tools/Scripts/build-webkit	2015-10-02 19:36:32 UTC (rev 190514)
+++ trunk/Tools/Scripts/build-webkit	2015-10-02 19:43:09 UTC (rev 190515)
@@ -201,6 +201,10 @@
         );
         print(join(" ", @copyLibrariesArgs) . "\n");
         (system(@copyLibrariesArgs) == 0) or die;
+
+        if (willUseIOSSimulatorSDKWhenBuilding()) {
+            (system("perl", "Tools/Scripts/build-layouttestrelay", argumentsForConfiguration()) == 0) or die;
+        }
     }
 
     # Build Tools needed for Apple ports
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to