Skip to content
Permalink
Browse files
[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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JonWBedard committed Nov 13, 2021
1 parent 788fae4 commit 10ac97710e1e1f5aa8fe6e64fc54f08024425df7
Showing 7 changed files with 62 additions and 6 deletions.
@@ -1,3 +1,26 @@
2021-11-12 Jonathan Bedard <jbedard@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 <darin@apple.com>

Make sort-Xcode-project-file idempotent
@@ -152,6 +152,22 @@ def _print_tests_result_with_status(self, status, runner):
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))

@@ -339,3 +339,6 @@ def copy_from_base_host(self, source, destination):
self.copytree(source, destination)
else:
self.copyfile(source, destination)

def symlink(self, *args, **kwargs):
os.symlink(*args, **kwargs)
@@ -436,6 +436,9 @@ def copy_to_base_host(self, source, destination):
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):
@@ -82,6 +82,9 @@ def print_leaks_summary(self):
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
@@ -60,6 +60,7 @@ def __init__(self, runtime_dict):
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 @@ def _create_device_with_runtime(host, runtime, device_info):
host=host,
device_type=device_type,
build_version=runtime.build_version,
runtime=runtime,
))
SimulatedDeviceManager.AVAILABLE_DEVICES.append(result)
return result
@@ -544,13 +546,14 @@ class DeviceState:
'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
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
@@ -168,35 +168,40 @@
"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",
"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",
"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",
"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",
"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" : {

0 comments on commit 10ac977

Please sign in to comment.