Title: [285772] trunk/Tools
Revision
285772
Author
jbed...@apple.com
Date
2021-11-12 20:45:28 -0800 (Fri, 12 Nov 2021)

Log Message

[webkitpy] Symlink daemons into simulator runtime root
https://bugs.webkit.org/show_bug.cgi?id=233080
<rdar://problem/85362551>

Reviewed by Brady Eidson.

* Scripts/webkitpy/api_tests/manager.py:
(Manager._initialize_devices): Symlink daemons in the WebKit.framework into
simulator runtime root.
* Scripts/webkitpy/common/system/filesystem.py:
(FileSystem.symlink):
* Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.symlink):
* Scripts/webkitpy/port/darwin.py:
(DarwinPort.path_to_daemons):
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.Runtime.__init__): Add root.
(SimulatedDeviceManager._create_device_with_runtime): Pass runtime.
(SimulatedDevice.__init__): Link to runtime.
* Scripts/webkitpy/xcode/simulated_device_unittest.py:

Canonical link: https://commits.webkit.org/244216@main

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (285771 => 285772)


--- trunk/Tools/ChangeLog	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/ChangeLog	2021-11-13 04:45:28 UTC (rev 285772)
@@ -1,3 +1,26 @@
+2021-11-12  Jonathan Bedard  <jbed...@apple.com>
+
+        [webkitpy] Symlink daemons into simulator runtime root
+        https://bugs.webkit.org/show_bug.cgi?id=233080
+        <rdar://problem/85362551>
+
+        Reviewed by Brady Eidson.
+
+        * Scripts/webkitpy/api_tests/manager.py:
+        (Manager._initialize_devices): Symlink daemons in the WebKit.framework into
+        simulator runtime root.
+        * Scripts/webkitpy/common/system/filesystem.py:
+        (FileSystem.symlink):
+        * Scripts/webkitpy/common/system/filesystem_mock.py:
+        (MockFileSystem.symlink):
+        * Scripts/webkitpy/port/darwin.py:
+        (DarwinPort.path_to_daemons):
+        * Scripts/webkitpy/xcode/simulated_device.py:
+        (SimulatedDeviceManager.Runtime.__init__): Add root.
+        (SimulatedDeviceManager._create_device_with_runtime): Pass runtime.
+        (SimulatedDevice.__init__): Link to runtime.
+        * Scripts/webkitpy/xcode/simulated_device_unittest.py:
+
 2021-11-12  Darin Adler  <da...@apple.com>
 
         Make sort-Xcode-project-file idempotent

Modified: trunk/Tools/Scripts/webkitpy/api_tests/manager.py (285771 => 285772)


--- trunk/Tools/Scripts/webkitpy/api_tests/manager.py	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/Scripts/webkitpy/api_tests/manager.py	2021-11-13 04:45:28 UTC (rev 285772)
@@ -152,6 +152,22 @@
     def _initialize_devices(self):
         if 'simulator' in self._port.port_name:
             SimulatedDeviceManager.initialize_devices(DeviceRequest(self._port.DEVICE_TYPE, allow_incomplete_match=True), self.host, simulator_ui=False)
+
+            # A Daemons executable path must be located within the runtime root.
+            roots = {
+                device.platform_device.runtime.root for device in SimulatedDeviceManager.INITIALIZED_DEVICES
+                if device.platform_device.runtime and device.platform_device.runtime.root
+            }
+            fs = self._port.host.filesystem
+            for root in roots:
+                _log.debug("Linking Daemons into runtime root '{}'".format(root))
+                for file in fs.files_under(self._port.path_to_daemons()):
+                    target = fs.join(root, 'usr', 'local', 'bin', 'webkit-testing', fs.basename(file))
+                    fs.maybe_make_directory(fs.dirname(target))
+                    if fs.isfile(target):
+                        fs.remove(target)
+                    fs.symlink(file, target)
+
         elif 'device' in self._port.port_name:
             raise RuntimeError('Running api tests on {} is not supported'.format(self._port.port_name))
 

Modified: trunk/Tools/Scripts/webkitpy/common/system/filesystem.py (285771 => 285772)


--- trunk/Tools/Scripts/webkitpy/common/system/filesystem.py	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/Scripts/webkitpy/common/system/filesystem.py	2021-11-13 04:45:28 UTC (rev 285772)
@@ -339,3 +339,6 @@
             self.copytree(source, destination)
         else:
             self.copyfile(source, destination)
+
+    def symlink(self, *args, **kwargs):
+        os.symlink(*args, **kwargs)

Modified: trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py (285771 => 285772)


--- trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py	2021-11-13 04:45:28 UTC (rev 285772)
@@ -436,7 +436,10 @@
     def copy_from_base_host(self, source, destination):
         self.move(source, destination)
 
+    def symlink(self, src, dst):
+        self.move(src, dst)
 
+
 class WritableBinaryFileObject(object):
     def __init__(self, fs, path):
         self.fs = fs

Modified: trunk/Tools/Scripts/webkitpy/port/darwin.py (285771 => 285772)


--- trunk/Tools/Scripts/webkitpy/port/darwin.py	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/Scripts/webkitpy/port/darwin.py	2021-11-13 04:45:28 UTC (rev 285772)
@@ -82,6 +82,9 @@
     def _path_to_webcore_library(self):
         return self._build_path('WebCore.framework/Versions/A/WebCore')
 
+    def path_to_daemons(self):
+        return self._build_path('WebKit.framework/Daemons')
+
     def show_results_html_file(self, results_filename):
         # We don't use self._run_script() because we don't want to wait for the script
         # to exit and we want the output to show up on stdout in case there are errors

Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py (285771 => 285772)


--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2021-11-13 04:45:28 UTC (rev 285772)
@@ -60,6 +60,7 @@
             self.version = Version.from_string(runtime_dict['version'])
             self.identifier = runtime_dict['identifier']
             self.name = runtime_dict['name']
+            self.root = runtime_dict.get('runtimeRoot')
 
     AVAILABLE_RUNTIMES = []
     AVAILABLE_DEVICES = []
@@ -123,6 +124,7 @@
             host=host,
             device_type=device_type,
             build_version=runtime.build_version,
+            runtime=runtime,
         ))
         SimulatedDeviceManager.AVAILABLE_DEVICES.append(result)
         return result
@@ -544,7 +546,7 @@
         'watchOS': 'com.apple.carousel.sessionservice',
     }
 
-    def __init__(self, name, udid, host, device_type, build_version):
+    def __init__(self, name, udid, host, device_type, build_version, runtime):
         assert device_type.software_version
 
         self.name = name
@@ -551,6 +553,7 @@
         self.udid = udid
         self.device_type = device_type
         self.build_version = build_version
+        self.runtime = runtime
         self._state = SimulatedDevice.DeviceState.SHUTTING_DOWN
 
         self.executive = host.executive

Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py (285771 => 285772)


--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py	2021-11-13 03:22:14 UTC (rev 285771)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py	2021-11-13 04:45:28 UTC (rev 285772)
@@ -168,7 +168,8 @@
      "availability" : "(available)",
      "name" : "iOS 9.3",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-9-3",
-     "version" : "9.3"
+     "version" : "9.3",
+     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot"
    },
    {
      "buildversion" : "15A8401",
@@ -175,7 +176,8 @@
      "availability" : "(available)",
      "name" : "iOS 11.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-0",
-     "version" : "11.0.1"
+     "version" : "11.0.1",
+     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 11.0.1.simruntime/Contents/Resources/RuntimeRoot"
    },
    {
      "buildversion" : "15J380",
@@ -182,7 +184,8 @@
      "availability" : "(available)",
      "name" : "tvOS 11.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-0",
-     "version" : "11.0"
+     "version" : "11.0",
+     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS 11.simruntime/Contents/Resources/RuntimeRoot"
    },
    {
      "buildversion" : "15R372",
@@ -189,7 +192,8 @@
      "availability" : "(available)",
      "name" : "watchOS 4.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-0",
-     "version" : "4.0"
+     "version" : "4.0",
+     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 4.simruntime/Contents/Resources/RuntimeRoot"
    },
    {
      "buildversion" : "16A367",
@@ -196,7 +200,8 @@
      "isAvailable" : "YES",
      "name" : "iOS 12.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-0",
-     "version" : "12.0"
+     "version" : "12.0",
+     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.simruntime/Contents/Resources/RuntimeRoot"
    }
  ],
  "devices" : {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to