run-benchmark script should set '__XPC_DYLD_FRAMEWORK_PATH' while launching local...
authordewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Oct 2017 01:15:15 +0000 (01:15 +0000)
committerdewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Oct 2017 01:15:15 +0000 (01:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178199

Reviewed by Saam Barati.

'__XPC_DYLD_FRAMEWORK_PATH' should be set while launching Safari on run-benchmark script.
'force_remove' function should support both file and directory.

* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
(OSXSafariDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/utils.py:
(force_remove):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223226 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py
Tools/Scripts/webkitpy/benchmark_runner/utils.py

index 589832d..df90afd 100644 (file)
@@ -1,3 +1,18 @@
+2017-10-11  Dewei Zhu  <dewei_zhu@apple.com>
+
+        run-benchmark script should set '__XPC_DYLD_FRAMEWORK_PATH' while launching local-built Safari on Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=178199
+
+        Reviewed by Saam Barati.
+
+        '__XPC_DYLD_FRAMEWORK_PATH' should be set while launching Safari on run-benchmark script.
+        'force_remove' function should support both file and directory.
+
+        * Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
+        (OSXSafariDriver.launch_url):
+        * Scripts/webkitpy/benchmark_runner/utils.py:
+        (force_remove):
+
 2017-10-11  Saam Barati  <sbarati@apple.com>
 
         Runtime disable poly proto because it may be a 3-4% Speedometer regression
index be69a6a..a20ada4 100644 (file)
@@ -31,7 +31,7 @@ class OSXSafariDriver(OSXBrowserDriver):
             safari_app_in_build_path = os.path.join(browser_build_path, 'Safari.app/Contents/MacOS/Safari')
             if os.path.exists(safari_app_in_build_path):
                 args = [safari_app_in_build_path]
-                env = {'DYLD_FRAMEWORK_PATH': browser_build_path, 'DYLD_LIBRARY_PATH': browser_build_path, '__XPC_DYLD_LIBRARY_PATH': browser_build_path}
+                env = {'DYLD_FRAMEWORK_PATH': browser_build_path, 'DYLD_LIBRARY_PATH': browser_build_path, '__XPC_DYLD_FRAMEWORK_PATH': browser_build_path, '__XPC_DYLD_LIBRARY_PATH': browser_build_path}
             else:
                 _log.info('Could not find Safari.app at %s, using the system Safari instead' % safari_app_in_build_path)
 
index 718da0e..09ecc9d 100644 (file)
@@ -39,7 +39,10 @@ def get_path_from_project_root(relative_path_to_project_root):
 
 def force_remove(path):
     try:
-        shutil.rmtree(path)
+        if os.path.isdir(path):
+            shutil.rmtree(path)
+        else:
+            os.remove(path)
     except Exception as error:
         # Directory/file does not exist or privilege issue, just ignore it
         _log.info("Error removing %s: %s" % (path, error))