Bug 257560

Summary: [WebKit] Enable InstallAPI for macOS/tvOS/watchOS
Product: WebKit Reporter: Elliott Williams <emw>
Component: WebKit2Assignee: Elliott Williams <emw>
Status: RESOLVED FIXED    
Severity: Normal CC: kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Elliott Williams 2023-05-31 12:50:47 PDT
Most of the work has already been done since iOS supports InstallAPI in WebKit/WebKitLegacy. Now that we have TAPI_USE_SRCROOT, we can enable it further without risking staleness build bugs.
Comment 1 Elliott Williams 2023-05-31 12:51:13 PDT
rdar://103361403
Comment 2 Elliott Williams 2023-06-01 16:37:48 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14608
Comment 3 EWS 2023-06-08 12:31:24 PDT
Committed 264993@main (110ccc3202f3): <https://commits.webkit.org/264993@main>

Reviewed commits have been landed. Closing PR #14608 and removing active labels.
Comment 4 EWS 2023-06-08 19:22:58 PDT
Committed 265005@main (e32ba22bd31f): <https://commits.webkit.org/265005@main>

Reviewed commits have been landed. Closing PR #14801 and removing active labels.
Comment 5 Elliott Williams 2023-06-09 14:45:22 PDT
Re-opening for pull request https://github.com/WebKit/WebKit/pull/14826
Comment 6 EWS 2023-06-12 10:02:09 PDT
Committed 265074@main (5ddcda389f55): <https://commits.webkit.org/265074@main>

Reviewed commits have been landed. Closing PR #14826 and removing active labels.
Comment 7 EWS 2023-06-12 12:09:44 PDT
Committed 265078@main (39ba36f985d0): <https://commits.webkit.org/265078@main>

Reviewed commits have been landed. Closing PR #14874 and removing active labels.
Comment 8 Elliott Williams 2023-06-15 17:20:13 PDT
Re-opening for pull request https://github.com/WebKit/WebKit/pull/15031
Comment 9 Elliott Williams 2023-06-15 17:29:47 PDT
We need to build fix this for Mac Catalyst, due to the way that TAPI handles symbols in reexported frameworks.

In the catalyst build:

- WebCore implements WKRetain/WKRelease as part of the WAK library. The symbols are hidden (but present in the debug build's symbol table).

- WebKit implements its own WKRetain/WKRelease, which is exported. It also reexports WebCore, which it only does on macOS.

- During the InstallAPI verification phase, TAPI ignores any symbols from headers that are implemented from a reexported framework. This means that even though it parses WebKit's WKRetain/WKRelease declarations, it refuses to use them, failing with

    error: no declaration found for exported symbol '_WKRelease' in dynamic library
    error: no declaration found for exported symbol '_WKRetain' in dynamic library

This doesn't happen in production builds, because they stubify WebCore before WebKit begins building, so TAPI only reads re-exported symbols from WebCore.tbd.

Catalyst WebKit re-exporting WebCore, when all other iOS-like platforms do not, is probably an oversight, but it's too risky to fix now. The easiest thing we can do is just rename the hidden symbol.
Comment 10 EWS 2023-06-16 13:50:45 PDT
Committed 265255@main (159993b61597): <https://commits.webkit.org/265255@main>

Reviewed commits have been landed. Closing PR #15031 and removing active labels.