Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 36195809a5ca24048b466eed2fde07f3c9bb54f0
https://github.com/WebKit/WebKit/commit/36195809a5ca24048b466eed2fde07f3c9bb54f0
Author: Antti Koivisto <[email protected]>
Date: 2026-08-17 (Mon, 17 Aug 2026)
Changed paths:
M Tools/TestWebKitAPI/PlatformCocoa.cmake
Log Message:
-----------
TestWebKitAPI.wkbundle is unloadable outside the TestWebKitAPI binary in
CMake builds
https://bugs.webkit.org/show_bug.cgi?id=321917
rdar://185091735
Reviewed by Zak Ridouh and Wenson Hsieh.
The CMake TestWebKitAPIWebProcessPlugIn target doesn't build
PlatformUtilitiesCocoa.mm, which defines Util::TestPlugInClassNameParameter.
WebProcessPlugIn.mm reads that bundle parameter to pick the principal test
plug-in class. The target links -undefined,dynamic_lookup, so the missing
definition isn't a link error, just an undefined flat-namespace symbol. It
resolves when the TestWebKitAPI binary is the host, since that binary exports
it. Any other host fails:
dlopen(.../TestWebKitAPI.wkbundle/Contents/MacOS/TestWebKitAPI):
symbol not found in flat namespace
'__ZN13TestWebKitAPI4Util28TestPlugInClassNameParameterE'
InjectedBundle::initialize bails there, so no plug-in callback runs and a
client loading this bundle to get window.internals sees it undefined with no
error. The Xcode WebProcessPlugIn target already lists PlatformUtilitiesCocoa.mm
and UtilitiesCocoa.mm in its Helpers membership exceptions, so only CMake builds
are affected. WebKitTestRunner isn't: it has its own injected bundle and calls
injectInternalsObject() directly, which is why layout tests never caught this.
Build both files into the bundle. PlatformUtilitiesCocoa.mm is listed in
SourcesCocoa.txt, so WEBKIT_COMPUTE_SOURCES marks it HEADER_FILE_ONLY and it has
to come in through an #include shim, the same way this target already builds its
dual-built sources. It also uses the WebKit C API, which config.h only exposes
under BUILDING_TestWebKit, as TestWebKitAPIBase and TestWebKitAPIInjectedBundle
both define.
* Tools/TestWebKitAPI/PlatformCocoa.cmake:
Add PlatformUtilitiesCocoa.mm (via shim) and UtilitiesCocoa.mm to
TestWebKitAPIWebProcessPlugIn, and define BUILDING_TestWebKit so the former
compiles.
Canonical link: https://commits.webkit.org/319345@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications