Title: [275122] trunk/Tools
Revision
275122
Author
[email protected]
Date
2021-03-26 16:47:47 -0700 (Fri, 26 Mar 2021)

Log Message

System installing webkitcorepy can break certain scripts
https://bugs.webkit.org/show_bug.cgi?id=223822
<rdar://problem/75905163>

Rubber-stamped by Alan Coon.

* Scripts/libraries/resultsdbpy/resultsdbpy/example/environment.py:
* Scripts/test-lldb-webkit: Replace sys.path.append with sys.path.insert.
* Scripts/webkitpy/__init__.py: Only put webkitcorepy path into sys.path if it isn't already there.
* Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
Replace sys.path.append with sys.path.insert.
* Scripts/webkitpy/common/system/executive_unittest.py: Ditto.
* Scripts/webkitpy/port/config_standalone.py: Ditto.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (275121 => 275122)


--- trunk/Tools/ChangeLog	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/ChangeLog	2021-03-26 23:47:47 UTC (rev 275122)
@@ -1,5 +1,21 @@
 2021-03-26  Jonathan Bedard  <[email protected]>
 
+        System installing webkitcorepy can break certain scripts
+        https://bugs.webkit.org/show_bug.cgi?id=223822
+        <rdar://problem/75905163>
+
+        Rubber-stamped by Alan Coon.
+
+        * Scripts/libraries/resultsdbpy/resultsdbpy/example/environment.py:
+        * Scripts/test-lldb-webkit: Replace sys.path.append with sys.path.insert.
+        * Scripts/webkitpy/__init__.py: Only put webkitcorepy path into sys.path if it isn't already there.
+        * Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
+        Replace sys.path.append with sys.path.insert.
+        * Scripts/webkitpy/common/system/executive_unittest.py: Ditto.
+        * Scripts/webkitpy/port/config_standalone.py: Ditto.
+
+2021-03-26  Jonathan Bedard  <[email protected]>
+
         [webkit-patch] Use commit.webkit.org instead of remote SVN to compute identifier
         https://bugs.webkit.org/show_bug.cgi?id=223820
         <rdar://problem/75902125>

Modified: trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/example/environment.py (275121 => 275122)


--- trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/example/environment.py	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/example/environment.py	2021-03-26 23:47:47 UTC (rev 275122)
@@ -27,7 +27,7 @@
 from fakeredis import FakeStrictRedis
 from redis import StrictRedis
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
 
 from resultsdbpy.model.cassandra_context import CassandraContext
 from resultsdbpy.model.casserole import CasseroleNodes, CasseroleRedis

Modified: trunk/Tools/Scripts/test-lldb-webkit (275121 => 275122)


--- trunk/Tools/Scripts/test-lldb-webkit	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/Scripts/test-lldb-webkit	2021-03-26 23:47:47 UTC (rev 275122)
@@ -135,7 +135,7 @@
     webkit_root = up(up(up(host.filesystem.abspath(__file__))))
 
     if lldb_python_directory not in sys.path:
-        sys.path.append(lldb_python_directory)
+        sys.path.insert(0, lldb_python_directory)
     tester.add_tree(host.filesystem.join(webkit_root, 'Tools', 'lldb'))
 
     return not tester.run(host=host, webkit_root=webkit_root)

Modified: trunk/Tools/Scripts/webkitpy/__init__.py (275121 => 275122)


--- trunk/Tools/Scripts/webkitpy/__init__.py	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/Scripts/webkitpy/__init__.py	2021-03-26 23:47:47 UTC (rev 275122)
@@ -19,7 +19,10 @@
 os.environ['SYSTEM_VERSION_COMPAT'] = '0'
 
 libraries = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'libraries')
-sys.path.insert(0, os.path.join(libraries, 'webkitcorepy'))
+webkitcorepy_path = os.path.join(libraries, 'webkitcorepy')
+if webkitcorepy_path not in sys.path:
+    sys.path.insert(0, webkitcorepy_path)
+import webkitcorepy
 
 if sys.platform == 'darwin':
     is_root = not os.getuid()

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py (275121 => 275122)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py	2021-03-26 23:47:47 UTC (rev 275122)
@@ -9,7 +9,7 @@
 # that Tools/Scripts is in sys.path for the next imports to work correctly.
 script_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../..'))
 if script_dir not in sys.path:
-    sys.path.append(script_dir)
+    sys.path.insert(0, script_dir)
 
 from pkg_resources import require, VersionConflict, DistributionNotFound
 from webkitpy.autoinstalled import twisted

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py (275121 => 275122)


--- trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py	2021-03-26 23:47:47 UTC (rev 275122)
@@ -38,10 +38,10 @@
 # that Tools/Scripts is in sys.path for the next imports to work correctly.
 script_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
 if script_dir not in sys.path:
-    sys.path.append(script_dir)
+    sys.path.insert(0, script_dir)
 third_party_py = os.path.join(script_dir, "webkitpy", "thirdparty", "autoinstalled")
 if third_party_py not in sys.path:
-    sys.path.append(third_party_py)
+    sys.path.insert(0, third_party_py)
 
 from webkitpy.common.system.executive import Executive, ScriptError
 from webkitpy.common.system.filesystem_mock import MockFileSystem

Modified: trunk/Tools/Scripts/webkitpy/port/config_standalone.py (275121 => 275122)


--- trunk/Tools/Scripts/webkitpy/port/config_standalone.py	2021-03-26 23:32:58 UTC (rev 275121)
+++ trunk/Tools/Scripts/webkitpy/port/config_standalone.py	2021-03-26 23:47:47 UTC (rev 275122)
@@ -41,7 +41,7 @@
 up = os.path.dirname
 script_dir = up(up(this_dir))
 if script_dir not in sys.path:
-    sys.path.append(script_dir)
+    sys.path.insert(0, script_dir)
 
 from webkitpy.common.system import executive
 from webkitpy.common.system import executive_mock
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to