Changeset 190515 in webkit


Ignore:
Timestamp:
Oct 2, 2015, 12:43:09 PM (10 years ago)
Author:
dbates@webkit.org
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.
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/built-product-archive

    r190439 r190515  
    6363
    6464    if action == 'archive':
    65         return archiveBuiltProduct(options.configuration, genericPlatform)
     65        return archiveBuiltProduct(options.configuration, genericPlatform, options.platform)
    6666    else:
    6767        return extractBuiltProduct(options.configuration, genericPlatform)
    6868
    6969
    70 def determineWebKitBuildDirectories(platform, fullPlatform, configuration):
    71     global _configurationBuildDirectory
    72     global _topLevelBuildDirectory
     70def webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform='', returnTopLevelDirectory=False):
    7371    if fullPlatform.startswith('ios-simulator'):
    7472        platform = 'ios-simulator'
     
    7674        platform = 'device'
    7775    command = ['perl', os.path.join(os.path.dirname(__file__), '..', 'Scripts', 'webkit-build-directory'), '--' + platform, '--' + configuration]
    78     _configurationBuildDirectory = subprocess.Popen(command + ['--configuration'], stdout=subprocess.PIPE).communicate()[0].strip()
    79     _topLevelBuildDirectory = subprocess.Popen(command + ['--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
     76    if returnTopLevelDirectory:
     77        command += ['--top-level']
     78    else:
     79        command += ['--configuration']
     80    return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0].strip()
     81
     82
     83def determineWebKitBuildDirectories(platform, fullPlatform, configuration):
     84    global _configurationBuildDirectory
     85    global _topLevelBuildDirectory
     86    _configurationBuildDirectory = webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform)
     87    _topLevelBuildDirectory = webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform, returnTopLevelDirectory=True)
    8088    return _topLevelBuildDirectory
    8189
     
    101109
    102110
    103 def createZip(directoryToZip, configuration):
     111def createZip(directoryToZip, configuration, embedParentDirectoryNameOnDarwin=False):
    104112    archiveDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild"))
    105113    archiveFile = os.path.join(archiveDir, configuration + ".zip")
     
    112120
    113121    if sys.platform == 'darwin':
    114         return subprocess.call(["ditto", "-c", "-k", "--keepParent", "--sequesterRsrc", directoryToZip, archiveFile])
     122        command = ['ditto', '-c', '-k', '--sequesterRsrc']
     123        if embedParentDirectoryNameOnDarwin:
     124            command += ['--keepParent']
     125        command += [directoryToZip, archiveFile]
     126        return subprocess.call(command)
    115127    elif sys.platform == 'cygwin':
    116128        return subprocess.call(["zip", "-r", archiveFile, "bin32"], cwd=directoryToZip)
     
    122134
    123135
    124 def archiveBuiltProduct(configuration, platform):
     136def archiveBuiltProduct(configuration, platform, fullPlatform):
    125137    assert platform in ('mac', 'win', 'gtk', 'efl', 'ios')
    126138
    127     if platform in ('mac', 'ios'):
    128         return createZip(_configurationBuildDirectory, configuration)
     139    if fullPlatform.startswith('ios-simulator'):
     140        # We need to include in the archive the Mac tool, LayoutTestRelay, to run layout tests in the iOS simulator.
     141        combinedDirectory = os.path.join(_topLevelBuildDirectory, 'combined-mac-and-ios')
     142        removeDirectoryIfExists(combinedDirectory)
     143        os.makedirs(combinedDirectory)
     144
     145        if subprocess.call(['/bin/cp', '-pR', _configurationBuildDirectory, combinedDirectory]):
     146            return 1
     147
     148        macBuildDirectory = webkitBuildDirectoryForConfigurationAndPlatform(configuration, 'mac')
     149        destinationDirectory = os.path.join(combinedDirectory, os.path.relpath(macBuildDirectory, _topLevelBuildDirectory))
     150        os.makedirs(destinationDirectory)
     151        for filename in ['LayoutTestRelay', 'LayoutTestRelay.dSYM']:
     152            sourceFile = os.path.join(macBuildDirectory, filename)
     153            if not os.path.exists(sourceFile):
     154                continue
     155            if subprocess.call(['/bin/cp', '-pR', sourceFile, destinationDirectory]):
     156                return 1
     157
     158        if createZip(combinedDirectory, configuration):
     159            return 1
     160        shutil.rmtree(combinedDirectory)
     161    elif platform in ('mac', 'ios'):
     162        return createZip(_configurationBuildDirectory, configuration, embedParentDirectoryNameOnDarwin=True)
    129163    elif platform == 'win':
    130164        # FIXME: We shouldn't hardcode the assumption of a 32-bit build. See <https://bugs.webkit.org/show_bug.cgi?id=149715>.
  • trunk/Tools/ChangeLog

    r190511 r190515  
     12015-10-02  Daniel Bates  <dabates@apple.com>
     2
     3        LayoutTestRelay is not built and archived when building for iOS Simulator
     4        https://bugs.webkit.org/show_bug.cgi?id=149753
     5
     6        Reviewed by Alexey Proskuryakov and Andy Estes.
     7
     8        Towards running layout tests on the iOS Simulator test bots, we need to teach scripts build-webkit
     9        and built-product-archive to build the Mac tool LayoutTestRelay and include this tool in the built
     10        product archive when building for iOS Simulator, respectively.
     11
     12        * BuildSlaveSupport/built-product-archive:
     13        (main): Pass the full platform name (options.platform) to archiveBuiltProduct() so that it can
     14        differentiate between iOS device and iOS Simulator platforms.
     15        (webkitBuildDirectoryForConfigurationAndPlatform): Extracted logic to run the script webkit-build-directory
     16        from determineWebKitBuildDirectories() into this function so that it can be used by both
     17        determineWebKitBuildDirectories() and archiveBuiltProduct().
     18        (determineWebKitBuildDirectories): Moved logic to execute the script webkit-build-directory from here to
     19        webkitBuildDirectoryForConfigurationAndPlatform().
     20        (createZip): Added parameter embedParentDirectoryNameOnDarwin (defaults to False) to specify whether
     21        we should call ditto(1) with --keepParent to embed the parent directory name in the zip archive. This
     22        argument is only applicable when building on Darwin. We only pass embedParentDirectoryNameOnDarwin=True
     23        when making an archive for a Mac or iOS device build. For iOS Simulator builds we archive two directories
     24        and we do not want to keep the parent directory because it is a placeholder directory used as a workaround
     25        for the limitation that ditto(1) can only accept a single directory to archive on its command line.
     26        (archiveBuiltProduct): Modified to take the full platform name as an argument. Added logic for iOS.
     27        For iOS device builds we use the same logic as for a Mac build and archive the configuration-specific
     28        build directory. For iOS Simulator builds we archive the configuration-specific iOS build directory,
     29        LayoutTestRelay and LayoutTestRelay.dSYM (if it exists) from the configuration-specific Mac build.
     30        * Scripts/build-layouttestrelay:
     31            - Remove unnecessary include of Perl module POSIX.
     32            - Only build LayoutTestRelay when building for iOS Simulator (i.e. --ios-simulator is passed).
     33        * Scripts/build-webkit:
     34            - Invoke script build-layouttestrelay when building for iOS Simulator.
     35
    1362015-10-02  Brent Fulgham  <bfulgham@apple.com>
    237
  • trunk/Tools/Scripts/build-layouttestrelay

    r171800 r190515  
    11#!/usr/bin/perl -w
    22
    3 # Copyright (C) 2014 Apple Inc. All rights reserved.
     3# Copyright (C) 2014-2015 Apple Inc. All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    3030use lib $FindBin::Bin;
    3131use webkitdirs;
    32 use POSIX;
    3332
    3433my $showHelp = 0;
     
    5857chdir "Tools/LayoutTestRelay" or die;
    5958
    60 if (isAppleMacWebKit()) {
    61     $result = buildXCodeProject("LayoutTestRelay", $clean, XcodeOptions(), @ARGV);
    62 } else {
    63     die "WebKitTestRunner is not supported on this platform.\n";
     59if (isIOSWebKit() && willUseIOSSimulatorSDKWhenBuilding()) {
     60    setXcodeSDK(undef); # Force use of Mac SDK
     61    exit exitStatus(buildXCodeProject("LayoutTestRelay", $clean, XcodeOptions(), @ARGV));
    6462}
    6563
    66 exit exitStatus($result);
     64print STDERR "LayoutTestRelay is only supported for iOS Simulator.\n";
     65exit 1;
  • trunk/Tools/Scripts/build-webkit

    r190419 r190515  
    202202        print(join(" ", @copyLibrariesArgs) . "\n");
    203203        (system(@copyLibrariesArgs) == 0) or die;
     204
     205        if (willUseIOSSimulatorSDKWhenBuilding()) {
     206            (system("perl", "Tools/Scripts/build-layouttestrelay", argumentsForConfiguration()) == 0) or die;
     207        }
    204208    }
    205209
Note: See TracChangeset for help on using the changeset viewer.