⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285772 in webkit


Ignore:
Timestamp:
Nov 12, 2021, 8:45:28 PM (5 years ago)
Author:
Jonathan Bedard
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

Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r285770 r285772  
     12021-11-12  Jonathan Bedard  <jbedard@apple.com>
     2
     3        [webkitpy] Symlink daemons into simulator runtime root
     4        https://bugs.webkit.org/show_bug.cgi?id=233080
     5        <rdar://problem/85362551>
     6
     7        Reviewed by Brady Eidson.
     8
     9        * Scripts/webkitpy/api_tests/manager.py:
     10        (Manager._initialize_devices): Symlink daemons in the WebKit.framework into
     11        simulator runtime root.
     12        * Scripts/webkitpy/common/system/filesystem.py:
     13        (FileSystem.symlink):
     14        * Scripts/webkitpy/common/system/filesystem_mock.py:
     15        (MockFileSystem.symlink):
     16        * Scripts/webkitpy/port/darwin.py:
     17        (DarwinPort.path_to_daemons):
     18        * Scripts/webkitpy/xcode/simulated_device.py:
     19        (SimulatedDeviceManager.Runtime.__init__): Add root.
     20        (SimulatedDeviceManager._create_device_with_runtime): Pass runtime.
     21        (SimulatedDevice.__init__): Link to runtime.
     22        * Scripts/webkitpy/xcode/simulated_device_unittest.py:
     23
    1242021-11-12  Darin Adler  <darin@apple.com>
    225
  • trunk/Tools/Scripts/webkitpy/api_tests/manager.py

    r284637 r285772  
    153153        if 'simulator' in self._port.port_name:
    154154            SimulatedDeviceManager.initialize_devices(DeviceRequest(self._port.DEVICE_TYPE, allow_incomplete_match=True), self.host, simulator_ui=False)
     155
     156            # A Daemons executable path must be located within the runtime root.
     157            roots = {
     158                device.platform_device.runtime.root for device in SimulatedDeviceManager.INITIALIZED_DEVICES
     159                if device.platform_device.runtime and device.platform_device.runtime.root
     160            }
     161            fs = self._port.host.filesystem
     162            for root in roots:
     163                _log.debug("Linking Daemons into runtime root '{}'".format(root))
     164                for file in fs.files_under(self._port.path_to_daemons()):
     165                    target = fs.join(root, 'usr', 'local', 'bin', 'webkit-testing', fs.basename(file))
     166                    fs.maybe_make_directory(fs.dirname(target))
     167                    if fs.isfile(target):
     168                        fs.remove(target)
     169                    fs.symlink(file, target)
     170
    155171        elif 'device' in self._port.port_name:
    156172            raise RuntimeError('Running api tests on {} is not supported'.format(self._port.port_name))
  • trunk/Tools/Scripts/webkitpy/common/system/filesystem.py

    r284398 r285772  
    340340        else:
    341341            self.copyfile(source, destination)
     342
     343    def symlink(self, *args, **kwargs):
     344        os.symlink(*args, **kwargs)
  • trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py

    r284398 r285772  
    437437        self.move(source, destination)
    438438
     439    def symlink(self, src, dst):
     440        self.move(src, dst)
     441
    439442
    440443class WritableBinaryFileObject(object):
  • trunk/Tools/Scripts/webkitpy/port/darwin.py

    r266638 r285772  
    8282    def _path_to_webcore_library(self):
    8383        return self._build_path('WebCore.framework/Versions/A/WebCore')
     84
     85    def path_to_daemons(self):
     86        return self._build_path('WebKit.framework/Daemons')
    8487
    8588    def show_results_html_file(self, results_filename):
  • trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py

    r283429 r285772  
    6161            self.identifier = runtime_dict['identifier']
    6262            self.name = runtime_dict['name']
     63            self.root = runtime_dict.get('runtimeRoot')
    6364
    6465    AVAILABLE_RUNTIMES = []
     
    124125            device_type=device_type,
    125126            build_version=runtime.build_version,
     127            runtime=runtime,
    126128        ))
    127129        SimulatedDeviceManager.AVAILABLE_DEVICES.append(result)
     
    545547    }
    546548
    547     def __init__(self, name, udid, host, device_type, build_version):
     549    def __init__(self, name, udid, host, device_type, build_version, runtime):
    548550        assert device_type.software_version
    549551
     
    552554        self.device_type = device_type
    553555        self.build_version = build_version
     556        self.runtime = runtime
    554557        self._state = SimulatedDevice.DeviceState.SHUTTING_DOWN
    555558
  • trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py

    r284775 r285772  
    169169     "name" : "iOS 9.3",
    170170     "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-9-3",
    171      "version" : "9.3"
     171     "version" : "9.3",
     172     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot"
    172173   },
    173174   {
     
    176177     "name" : "iOS 11.0",
    177178     "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-0",
    178      "version" : "11.0.1"
     179     "version" : "11.0.1",
     180     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 11.0.1.simruntime/Contents/Resources/RuntimeRoot"
    179181   },
    180182   {
     
    183185     "name" : "tvOS 11.0",
    184186     "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-0",
    185      "version" : "11.0"
     187     "version" : "11.0",
     188     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS 11.simruntime/Contents/Resources/RuntimeRoot"
    186189   },
    187190   {
     
    190193     "name" : "watchOS 4.0",
    191194     "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-0",
    192      "version" : "4.0"
     195     "version" : "4.0",
     196     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 4.simruntime/Contents/Resources/RuntimeRoot"
    193197   },
    194198   {
     
    197201     "name" : "iOS 12.0",
    198202     "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-0",
    199      "version" : "12.0"
     203     "version" : "12.0",
     204     "runtimeRoot" : "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.simruntime/Contents/Resources/RuntimeRoot"
    200205   }
    201206 ],
Note: See TracChangeset for help on using the changeset viewer.