Skip to content

Commit b9c52b9

Browse files
teach build.webkit.org to include run-webkit-archive in the root folder of uploaded macOS archives.
https://bugs.webkit.org/show_bug.cgi?id=176965 Reviewed by Alexey Proskuryakov. * BuildSlaveSupport/built-product-archive: (addLauncherToArchive): Helper function to add the launcher script (createZip): teach function about addLauncherToArchive * BuildSlaveSupport/run-webkit-archive: Added. (check_for_valid_platform): Add logic to ensure platform is Darwin (find_dyld_framework_path): Find the dyld framework path (run_safari_for_webkit_development): launch SafariForWebKitDevelopment (set_dyld_framework_path): export the environment for dydl framework path git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 97ebee1 commit b9c52b9

File tree

3 files changed

+90
-1
lines changed

3 files changed

+90
-1
lines changed

Tools/BuildSlaveSupport/built-product-archive

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ _configurationBuildDirectory = None
3636
_topLevelBuildDirectory = None
3737
_hostBuildDirectory = None
3838

39+
PATH_TO_LAUNCHER = './Tools/BuildSlaveSupport/run-webkit-archive'
3940

4041
def main():
4142
parser = optparse.OptionParser("usage: %prog [options] [action]")
@@ -136,6 +137,9 @@ def createZipManually(directoryToZip, archiveFile):
136137

137138
archiveZip.close()
138139

140+
def addLauncherToArchive(archiveFile):
141+
command = ['/usr/bin/zip', '-j', archiveFile, PATH_TO_LAUNCHER]
142+
return subprocess.call(command)
139143

140144
def createZip(directoryToZip, configuration, embedParentDirectoryNameOnDarwin=False, minify=False):
141145
archiveDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild"))
@@ -154,7 +158,7 @@ def createZip(directoryToZip, configuration, embedParentDirectoryNameOnDarwin=Fa
154158
if embedParentDirectoryNameOnDarwin:
155159
command += ['--keepParent']
156160
command += [directoryToZip, archiveFile]
157-
return subprocess.call(command)
161+
return subprocess.call(command) or addLauncherToArchive(archiveFile)
158162
elif sys.platform == 'cygwin':
159163
return subprocess.call(["zip", "-r", archiveFile, "bin32"], cwd=directoryToZip)
160164
elif sys.platform == 'win32':
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (C) 2017 Apple Inc. All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# 2. Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in the
13+
# documentation and/or other materials provided with the distribution.
14+
# 3. Neither the name of Apple Inc. ("Apple") nor the names of
15+
# its contributors may be used to endorse or promote products derived
16+
# from this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27+
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
import os, platform, subprocess
30+
31+
SAFARI_FOR_WEBKIT_DEVELOPMENT='/Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment'
32+
33+
def check_for_valid_platform():
34+
if 'Darwin' not in platform.system():
35+
print('Unsupported OS, exiting.')
36+
exit(1)
37+
38+
def find_dyld_framework_path(script_path):
39+
current_directory = os.path.dirname(script_path)
40+
sub_directories = [name for name in os.listdir(current_directory) if os.path.isdir(name)]
41+
if 'Debug' in sub_directories:
42+
return current_directory + '/Debug'
43+
elif 'Release' in sub_directories:
44+
return current_directory + '/Release'
45+
else:
46+
print('No Release or Debug framework directories found in the current folder, exiting.')
47+
exit(1)
48+
49+
def run_safari_for_webkit_development():
50+
subprocess.call(SAFARI_FOR_WEBKIT_DEVELOPMENT)
51+
52+
def set_dyld_framework_path(script_path):
53+
dyld_path = find_dyld_framework_path(script_path)
54+
print('Setting DYLD FRAMEWORK and LIBRARY paths to {}'.format(dyld_path))
55+
os.environ['DYLD_FRAMEWORK_PATH'] = dyld_path
56+
os.environ['DYLD_LIBRARY_PATH'] = dyld_path
57+
58+
def main():
59+
check_for_valid_platform()
60+
script_path = os.path.abspath(__file__)
61+
os.chdir(os.path.dirname(script_path))
62+
set_dyld_framework_path(script_path)
63+
run_safari_for_webkit_development()
64+
65+
if __name__ == '__main__':
66+
try:
67+
main()
68+
except KeyboardInterrupt:
69+
exit("Aborting.")

Tools/ChangeLog

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2017-09-15 Lucas Forschler <[email protected]>
2+
3+
teach build.webkit.org to include run-webkit-archive in the root folder of uploaded macOS archives.
4+
https://bugs.webkit.org/show_bug.cgi?id=176965
5+
6+
Reviewed by Alexey Proskuryakov.
7+
8+
* BuildSlaveSupport/built-product-archive:
9+
(addLauncherToArchive): Helper function to add the launcher script
10+
(createZip): teach function about addLauncherToArchive
11+
* BuildSlaveSupport/run-webkit-archive: Added.
12+
(check_for_valid_platform): Add logic to ensure platform is Darwin
13+
(find_dyld_framework_path): Find the dyld framework path
14+
(run_safari_for_webkit_development): launch SafariForWebKitDevelopment
15+
(set_dyld_framework_path): export the environment for dydl framework path
16+
117
2017-09-15 Myles C. Maxfield <[email protected]>
218

319
[WSL] Small cleanup in Evaluator

0 commit comments

Comments
 (0)