Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 436e26eebf6a25eba1655429ad2d0f6678af558f
      
https://github.com/WebKit/WebKit/commit/436e26eebf6a25eba1655429ad2d0f6678af558f
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M CMakePresets.json
    M Source/WebCore/CMakeLists.txt
    M Source/WebKit/PlatformCocoa.cmake
    M Source/WebKitLegacy/PlatformCocoa.cmake
    M Source/cmake/OptionsCocoa.cmake
    M Source/cmake/WebKitEntitlements.cmake
    M Source/cmake/WebKitMacros.cmake
    M Source/cmake/WebKitXcodeSDK.cmake
    M Tools/WebKitTestRunner/CMakeLists.txt
    M Tools/WebKitTestRunner/PlatformCocoa.cmake

  Log Message:
  -----------
  [CMake] Build WebKitTestRunnerApp.app for the iOS family
https://bugs.webkit.org/show_bug.cgi?id=325240
rdar://188352980

Reviewed by Zak Ridouh and Elliott Williams.

No layout test ran against a CMake iOS-family build. Five issues, each exposed 
by
fixing the one before:

1) The iOS family built WebKitTestRunner.app with CMake's stock Info.plist, no
   entitlements, no PlugIns directory and no launch storyboard. webkitpy looks 
for
   WebKitTestRunnerApp.app, isRunningTest() in DefaultWebBrowserChecks.mm 
accepts
   org.webkit.WebKitTestRunnerApp, and 
TestController::initializeInjectedBundlePath()
   reads the injected bundle out of PlugIns.

2) Tools was never configured for an embedded SDK: cocoa-embedded set 
ENABLE_TOOLS
   to OFF.

3) Every test timed out with no output. InjectedBundle/mac/TestRunnerMac.mm was
   compiled only on macOS, although Xcode compiles it for the iOS family too, so
   WTR::TestRunner::platformInitialize() was undefined in the injected bundle.

4) WebCoreTestSupport was static where Xcode ships a dylib, so the injected 
bundle
   carried its own copies of the WebCore symbols it used and was loaded into a
   process that already had WebCore.framework.

5) -undefined dynamic_lookup hid frameworks the application and the bundle used
   without linking. GameController is not otherwise loaded, so the iOS mouse 
input
   path failed at runtime.

The iOS family now builds the WebKitTestRunner target as WebKitTestRunnerApp.app
with the Xcode Info.plist and per-SDK entitlements. The injected bundle is built
straight into the app's PlugIns directory and Launch.storyboard is compiled 
into the
app before it links, so the app's existing code signing covers both.
WebCoreTestSupport is a shared library, and both binaries link the frameworks 
their
xcconfigs list. The simulator DER entitlements come from derq; the inline 
generator
encoded every value as a BOOLEAN, which the WebKitTestRunnerApp entitlements'
strings and arrays would have broken. UIDeviceFamily follows Xcode's rules on 
every
SDK.

Compared against an Xcode iphonesimulator build:
- The app's signed entitlements are identical.
- The app's Info.plist is identical except for the build machine and SDK keys
  Xcode adds (BuildMachineOSBuild, DTCompiler, DTPlatformBuild, 
DTPlatformVersion,
  DTSDKBuild, DTSDKName, DTXcode, DTXcodeBuild).
- The app contains the same files, except that it has no PkgInfo and the
  injected bundle also contains WebKit Layout Tests.ttf and
  WebKit Layout Tests 2.ttf.
- Each embedded appex contains the same files.

* CMakePresets.json:
Stop overriding ENABLE_TOOLS to OFF for cocoa-embedded.

* Source/WebCore/CMakeLists.txt:
Allow WebKitTestRunnerApp as a client of WebCore. Apply the libwebrtc weak link 
to
WebCoreTestSupport itself, which now has to resolve those symbols as a dylib.

* Source/WebKit/PlatformCocoa.cmake:
Use the shared entitlements and Info.plist helpers. The ExtensionKit appex 
narrows
its TARGETED_DEVICE_FAMILY to the SDK, giving [1,2] rather than [1,2,7] on
iphonesimulator, as Xcode does.

* Source/WebKitLegacy/PlatformCocoa.cmake:
Write Xcode's default UIDeviceFamily, [1], instead of a hardcoded [1,2].

* Source/cmake/OptionsCocoa.cmake:
Build WebCoreTestSupport as a shared library, as Xcode does. This brings the
injected bundle from 3.75 MB down to 668 KB, against Xcode's 908 KB. Use
WEBKIT_SDK_IS_XROS.

* Source/cmake/WebKitEntitlements.cmake:
(WEBKIT_GENERATE_DER_ENTITLEMENTS): Moved from Source/WebKit; use derq.
(WEBKIT_WRITE_SIMULATOR_SIGNING_ENTITLEMENTS): Moved from Source/WebKit.

* Source/cmake/WebKitMacros.cmake:
(WEBKIT_LIBRARY): Sign MODULE libraries too.

* Source/cmake/WebKitXcodeSDK.cmake:
Add WEBKIT_SDK_IS_TVOS and WEBKIT_SDK_IS_WATCHOS.
(_WEBKIT_SDK_DEVICE_FAMILIES): Added.
(WEBKIT_GET_DEVICE_FAMILY): Added. Narrows a TARGETED_DEVICE_FAMILY to the SDK, 
or
returns the SDK's primary family when none is given.
(WEBKIT_ADD_EMBEDDED_BUNDLE_PLIST_KEYS): Added.

* Tools/WebKitTestRunner/CMakeLists.txt:
Drop -undefined dynamic_lookup.

* Tools/WebKitTestRunner/PlatformCocoa.cmake:
Drop -undefined dynamic_lookup from the injected bundle and link the frameworks
from the xcconfigs' OTHER_LDFLAGS instead; CMAKE_SHARED_LINKER_FLAGS never 
reached
a MODULE library. Sign the injected bundle as a bundle. On the iOS family, 
compile
InjectedBundle/mac/TestRunnerMac.mm and AccessibilityNotificationHandler.mm, and
produce WebKitTestRunnerApp.app with its Info.plist and entitlements. Build the
injected bundle into the app's PlugIns directory and compile Launch.storyboard 
in a
file-generating command; the app relinks when either changes. Embed the
entitlements in the binary on the simulator only.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to