<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[190387] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/190387">190387</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-30 21:57:46 -0700 (Wed, 30 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>built-product-archive archives incorrect build directory for iOS port
https://bugs.webkit.org/show_bug.cgi?id=149695

Reviewed by Darin Adler.

Fixes an issue where the script built-product-archive archives a non-existent
build directory for the iOS port. Without loss of generality, the script assumes
the path to the Release configuration build for iOS is in directory WebKitBuild/Release.
But the built products for this configuration are in directory WebKitBuild/Release-iphonesimulator.

Currently the script built-product-archive calls `webkit-build-directory --top-level ...`
to determine the top-level build directory and computes the configuration-specific
build directory to be the concatenation of the the top-level build directory and
the configuration (e.g. Release). This is incorrect. Instead we should call
webkit-build-directory omitting the flag --top-level to compute the path to the
configuration-specific build directory.

* BuildSlaveSupport/built-product-archive: Fix up the style such that we use single quoted literals.
(main): Renamed global variable _buildDirectory to _topLevelBuildDirectory to better describe
its purpose and added global variable _configurationBuildDirectory to store the path
to the configuration-specific build directory. Ensure that we have a non-empty string
for both the top-level and configuration-specific build directories.
(determineWebKitBuildDirectories): Formerly named determineWebKitBuildDirectory.
Compute the configuration-specific build directory and store it in the global variable
_configurationBuildDirectory.
(archiveBuiltProduct): Modified to use _configurationBuildDirectory.
(extractBuiltProduct): Modified to use _configurationBuildDirectory and _topLevelBuildDirectory
as needed.
(determineWebKitBuildDirectory): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsBuildSlaveSupportbuiltproductarchive">trunk/Tools/BuildSlaveSupport/built-product-archive</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsBuildSlaveSupportbuiltproductarchive"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/built-product-archive (190386 => 190387)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/built-product-archive        2015-10-01 04:21:13 UTC (rev 190386)
+++ trunk/Tools/BuildSlaveSupport/built-product-archive        2015-10-01 04:57:46 UTC (rev 190387)
</span><span class="lines">@@ -31,7 +31,8 @@
</span><span class="cx"> import sys
</span><span class="cx"> import zipfile
</span><span class="cx"> 
</span><del>-_buildDirectory = None
</del><ins>+_configurationBuildDirectory = None
+_topLevelBuildDirectory = None
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> def main():
</span><span class="lines">@@ -52,9 +53,13 @@
</span><span class="cx">         return 1
</span><span class="cx"> 
</span><span class="cx">     genericPlatform = options.platform.split('-', 1)[0]
</span><del>-    if not determineWebKitBuildDirectory(genericPlatform, options.platform, options.configuration):
-        print &gt;&gt; sys.stderr, &quot;Could not determine build directory&quot;
</del><ins>+    determineWebKitBuildDirectories(genericPlatform, options.platform, options.configuration)
+    if not _topLevelBuildDirectory:
+        print &gt;&gt; sys.stderr, 'Could not determine top-level build directory'
</ins><span class="cx">         return 1
</span><ins>+    if not _configurationBuildDirectory:
+        print &gt;&gt; sys.stderr, 'Could not determine configuration-specific build directory'
+        return 1
</ins><span class="cx"> 
</span><span class="cx">     if action == 'archive':
</span><span class="cx">         return archiveBuiltProduct(options.configuration, genericPlatform)
</span><span class="lines">@@ -62,15 +67,17 @@
</span><span class="cx">         return extractBuiltProduct(options.configuration, genericPlatform)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-def determineWebKitBuildDirectory(platform, fullPlatform, configuration):
</del><ins>+def determineWebKitBuildDirectories(platform, fullPlatform, configuration):
</ins><span class="cx">     global _buildDirectory
</span><ins>+    global _topLevelBuildDirectory
</ins><span class="cx">     if fullPlatform.startswith('ios-simulator'):
</span><span class="cx">         platform = 'ios-simulator'
</span><span class="cx">     elif platform == 'ios':
</span><span class="cx">         platform = 'device'
</span><del>-    _buildDirectory = subprocess.Popen(['perl', os.path.join(os.path.dirname(__file__), &quot;..&quot;, &quot;Scripts&quot;, &quot;webkit-build-directory&quot;),
-        &quot;--&quot; + platform, &quot;--&quot; + configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
-    return _buildDirectory
</del><ins>+    command = ['perl', os.path.join(os.path.dirname(__file__), '..', 'Scripts', 'webkit-build-directory'), '--' + platform, '--' + configuration]
+    _configurationBuildDirectory = subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0].strip()
+    _topLevelBuildDirectory = subprocess.Popen(command + ['--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()
+    return _topLevelBuildDirectory
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> def removeDirectoryIfExists(thinDirectory):
</span><span class="lines">@@ -117,13 +124,11 @@
</span><span class="cx"> def archiveBuiltProduct(configuration, platform):
</span><span class="cx">     assert platform in ('mac', 'win', 'gtk', 'efl', 'ios')
</span><span class="cx"> 
</span><del>-    configurationBuildDirectory = os.path.join(_buildDirectory, configuration.title())
-
</del><span class="cx">     if platform in ('mac', 'ios'):
</span><del>-        return createZip(configurationBuildDirectory, configuration)
</del><ins>+        return createZip(_configurationBuildDirectory, configuration)
</ins><span class="cx">     elif platform == 'win':
</span><del>-        binDirectory = os.path.join(configurationBuildDirectory, &quot;bin32&quot;)
-        thinDirectory = os.path.join(configurationBuildDirectory, &quot;thin&quot;)
</del><ins>+        binDirectory = os.path.join(_configurationBuildDirectory, 'bin32')
+        thinDirectory = os.path.join(_configurationBuildDirectory, 'thin')
</ins><span class="cx">         thinBinDirectory = os.path.join(thinDirectory, &quot;bin32&quot;)
</span><span class="cx"> 
</span><span class="cx">         removeDirectoryIfExists(thinDirectory)
</span><span class="lines">@@ -134,7 +139,7 @@
</span><span class="cx">         shutil.rmtree(thinDirectory)
</span><span class="cx"> 
</span><span class="cx">     elif platform == 'gtk' or platform == 'efl':
</span><del>-        thinDirectory = os.path.join(configurationBuildDirectory, &quot;thin&quot;)
</del><ins>+        thinDirectory = os.path.join(_configurationBuildDirectory, 'thin')
</ins><span class="cx"> 
</span><span class="cx">         removeDirectoryIfExists(thinDirectory)
</span><span class="cx">         os.mkdir(thinDirectory)
</span><span class="lines">@@ -144,12 +149,12 @@
</span><span class="cx">         # On GTK we need this for the WebKit GObject DOM bindings API break test
</span><span class="cx">         if platform == 'gtk':
</span><span class="cx">             neededDirectories.append(&quot;DerivedSources/webkitdom&quot;)
</span><del>-            webkitdomFile = os.path.join(configurationBuildDirectory, &quot;gtkdoc-webkitdom.cfg&quot;)
</del><ins>+            webkitdomFile = os.path.join(_configurationBuildDirectory, 'gtkdoc-webkitdom.cfg')
</ins><span class="cx">             if subprocess.call('cp %s %s' % (webkitdomFile, thinDirectory), shell=True):
</span><span class="cx">                 return 1
</span><span class="cx"> 
</span><span class="cx">         for dirname in neededDirectories:
</span><del>-            fromDir = os.path.join(configurationBuildDirectory, dirname, &quot;.&quot;)
</del><ins>+            fromDir = os.path.join(_configurationBuildDirectory, dirname, '.')
</ins><span class="cx">             toDir = os.path.join(thinDirectory, dirname)
</span><span class="cx">             os.makedirs(toDir)
</span><span class="cx">             if subprocess.call('cp -R %s %s' % (fromDir, toDir), shell=True):
</span><span class="lines">@@ -185,17 +190,16 @@
</span><span class="cx"> def extractBuiltProduct(configuration, platform):
</span><span class="cx">     assert platform in ('mac', 'win', 'gtk', 'efl', 'ios')
</span><span class="cx"> 
</span><del>-    archiveFile = os.path.join(_buildDirectory, configuration + &quot;.zip&quot;)
-    configurationBuildDirectory = os.path.join(_buildDirectory, configuration.title())
</del><ins>+    archiveFile = os.path.join(_topLevelBuildDirectory, configuration + '.zip')
</ins><span class="cx"> 
</span><del>-    removeDirectoryIfExists(configurationBuildDirectory)
-    os.makedirs(configurationBuildDirectory)
</del><ins>+    removeDirectoryIfExists(_configurationBuildDirectory)
+    os.makedirs(_configurationBuildDirectory)
</ins><span class="cx"> 
</span><span class="cx">     if platform in ('mac', 'ios'):
</span><span class="cx">         return unzipArchive(_buildDirectory, configuration)
</span><span class="cx">     elif platform == 'win' or platform == 'gtk' or platform == 'efl':
</span><del>-        print &quot;Extracting&quot;, configurationBuildDirectory
-        return unzipArchive(configurationBuildDirectory, configuration)
</del><ins>+        print 'Extracting', _configurationBuildDirectory
+        return unzipArchive(_configurationBuildDirectory, configuration)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> if __name__ == '__main__':
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (190386 => 190387)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-10-01 04:21:13 UTC (rev 190386)
+++ trunk/Tools/ChangeLog        2015-10-01 04:57:46 UTC (rev 190387)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-09-30  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        built-product-archive archives incorrect build directory for iOS port
+        https://bugs.webkit.org/show_bug.cgi?id=149695
+
+        Reviewed by Darin Adler.
+
+        Fixes an issue where the script built-product-archive archives a non-existent
+        build directory for the iOS port. Without loss of generality, the script assumes
+        the path to the Release configuration build for iOS is in directory WebKitBuild/Release.
+        But the built products for this configuration are in directory WebKitBuild/Release-iphonesimulator.
+
+        Currently the script built-product-archive calls `webkit-build-directory --top-level ...`
+        to determine the top-level build directory and computes the configuration-specific
+        build directory to be the concatenation of the the top-level build directory and
+        the configuration (e.g. Release). This is incorrect. Instead we should call
+        webkit-build-directory omitting the flag --top-level to compute the path to the
+        configuration-specific build directory.
+
+        * BuildSlaveSupport/built-product-archive: Fix up the style such that we use single quoted literals.
+        (main): Renamed global variable _buildDirectory to _topLevelBuildDirectory to better describe
+        its purpose and added global variable _configurationBuildDirectory to store the path
+        to the configuration-specific build directory. Ensure that we have a non-empty string
+        for both the top-level and configuration-specific build directories.
+        (determineWebKitBuildDirectories): Formerly named determineWebKitBuildDirectory.
+        Compute the configuration-specific build directory and store it in the global variable
+        _configurationBuildDirectory.
+        (archiveBuiltProduct): Modified to use _configurationBuildDirectory.
+        (extractBuiltProduct): Modified to use _configurationBuildDirectory and _topLevelBuildDirectory
+        as needed.
+        (determineWebKitBuildDirectory): Deleted.
+
</ins><span class="cx"> 2015-09-30  Hunseop Jeong  &lt;hs85.jeong@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] css3/device-adapt/* tests failed after r190335.
</span></span></pre>
</div>
</div>

</body>
</html>