WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
313900
[WebKitLegacy] Eliminate WK_BUILD_FOR_TESTING by refactoring to Objective-C class method SPI
https://bugs.webkit.org/show_bug.cgi?id=313900
Summary
[WebKitLegacy] Eliminate WK_BUILD_FOR_TESTING by refactoring to Objective-C c...
David Kilzer (:ddkilzer)
Reported
2026-05-02 07:55:18 PDT
WebKitLegacy.framework uses the `WK_BUILD_FOR_TESTING` mechanism to conditionally export `TestWebPreferencesCacheModelForMainBundle()` for TestWebKitAPI. This is the only testing symbol exported from WebKitLegacy, and its sole consumer is the `WebKitLegacy.CacheModelForMainBundle` API test. The mechanism prevents TestWebKitAPI from linking to WebKitLegacy.framework in Production builds because the testing symbol is not exported in the Production configuration. It is also overly complex for one symbol, involving six coordinated pieces: the `WK_BUILD_FOR_TESTING` xcconfig variable, the `-DENABLE_BUILD_FOR_TESTING` compiler flag, the `#if ENABLE(BUILD_FOR_TESTING)` guard in `WebPreferences.mm`, the `-extra-private-header TestingFunctions.h` TAPI flag, the `WebKit.Testing.exp` export symbol list, and a conditional block in the "Generate Export Files" build phase script.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-05-02 07:55:26 PDT
<
rdar://problem/176091724
>
David Kilzer (:ddkilzer)
Comment 2
2026-05-02 08:01:09 PDT
***
Bug 313841
has been marked as a duplicate of this bug. ***
David Kilzer (:ddkilzer)
Comment 3
2026-05-02 08:03:39 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/64106
EWS
Comment 4
2026-05-04 13:55:24 PDT
Committed
312551@main
(029c5391653d): <
https://commits.webkit.org/312551@main
> Reviewed commits have been landed. Closing PR #64106 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug