Title: [277105] trunk/Tools
Revision
277105
Author
fpi...@apple.com
Date
2021-05-06 11:58:21 -0700 (Thu, 06 May 2021)

Log Message

Make it easy to pass __XPC variables to run-benchmark
https://bugs.webkit.org/show_bug.cgi?id=225473

Reviewed by Stephanie Lewis.

* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
(OSXSafariDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(config_argument_parser):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (277104 => 277105)


--- trunk/Tools/ChangeLog	2021-05-06 18:40:03 UTC (rev 277104)
+++ trunk/Tools/ChangeLog	2021-05-06 18:58:21 UTC (rev 277105)
@@ -1,3 +1,15 @@
+2021-05-06  Filip Pizlo  <fpi...@apple.com>
+
+        Make it easy to pass __XPC variables to run-benchmark
+        https://bugs.webkit.org/show_bug.cgi?id=225473
+
+        Reviewed by Stephanie Lewis.
+
+        * Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
+        (OSXSafariDriver.launch_url):
+        * Scripts/webkitpy/benchmark_runner/run_benchmark.py:
+        (config_argument_parser):
+
 2021-05-06  Aakash Jain  <aakash_j...@apple.com>
 
         EWS bubbles should show current status after pressing 'Retry failed builds' button

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py (277104 => 277105)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py	2021-05-06 18:40:03 UTC (rev 277104)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py	2021-05-06 18:58:21 UTC (rev 277105)
@@ -2,6 +2,7 @@
 
 import logging
 import os
+import re
 import subprocess
 import time
 
@@ -26,6 +27,9 @@
     def launch_url(self, url, options, browser_build_path, browser_path):
         args = ['/Applications/Safari.app/Contents/MacOS/Safari']
         env = {}
+        for key, value in os.environ.items():
+            if re.match(r"^__XPC_", key):
+                env[key] = value
         if browser_build_path:
             browser_build_absolute_path = os.path.abspath(browser_build_path)
             safari_app_in_build_path = os.path.join(browser_build_absolute_path, 'Safari.app/Contents/MacOS/Safari')
@@ -37,8 +41,10 @@
                 args = [safari_app_in_build_path]
 
             if contains_frameworks:
-                env = {'DYLD_FRAMEWORK_PATH': browser_build_absolute_path, 'DYLD_LIBRARY_PATH': browser_build_absolute_path,
-                    '__XPC_DYLD_FRAMEWORK_PATH': browser_build_absolute_path, '__XPC_DYLD_LIBRARY_PATH': browser_build_absolute_path}
+                env['DYLD_FRAMEWORK_PATH'] = browser_build_absolute_path
+                env['DYLD_LIBRARY_PATH'] = browser_build_absolute_path
+                env['__XPC_DYLD_FRAMEWORK_PATH'] = browser_build_absolute_path
+                env['__XPC_DYLD_LIBRARY_PATH'] = browser_build_absolute_path
             elif not has_safari_app:
                 raise Exception('Could not find any framework "{}"'.format(browser_build_path))
 

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py (277104 => 277105)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py	2021-05-06 18:40:03 UTC (rev 277104)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py	2021-05-06 18:58:21 UTC (rev 277105)
@@ -32,7 +32,7 @@
 
 
 def config_argument_parser():
-    parser = argparse.ArgumentParser(description='Run browser based performance benchmarks. To run a single benchmark in the recommended way, use run-benchmark --plan. To see the vailable benchmarks, use run-benchmark --list-plans.')
+    parser = argparse.ArgumentParser(description='Run browser based performance benchmarks. To run a single benchmark in the recommended way, use run-benchmark --plan. To see the vailable benchmarks, use run-benchmark --list-plans. This script passes through the __XPC variables in its environment to the Safari process.')
     mutual_group = parser.add_mutually_exclusive_group(required=True)
     mutual_group.add_argument('--plan', help='Run a specific benchmark plan (e.g. speedometer, jetstream).')
     mutual_group.add_argument('--list-plans', action='', help='List all available benchmark plans.')
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to