RESOLVED FIXED 218289
[iOS] Link Contacts.framework during build
https://bugs.webkit.org/show_bug.cgi?id=218289
Summary [iOS] Link Contacts.framework during build
Aditya Keerthi
Reported 2020-10-28 09:16:42 PDT
...
Attachments
Patch (9.44 KB, patch)
2020-10-28 09:18 PDT, Aditya Keerthi
no flags
Patch for landing. (9.75 KB, patch)
2020-10-28 09:52 PDT, Aditya Keerthi
no flags
Patch (7.08 KB, patch)
2020-10-29 17:55 PDT, Aditya Keerthi
aestes: review+
Patch for landing (7.13 KB, patch)
2020-10-30 11:44 PDT, Aditya Keerthi
no flags
Aditya Keerthi
Comment 1 2020-10-28 09:18:21 PDT
Geoffrey Garen
Comment 2 2020-10-28 09:26:48 PDT
Comment on attachment 412533 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=412533&action=review r=me > Source/WebKit/ChangeLog:4 > + [Cocoa] Remove soft linking of Contacts.framework > + https://bugs.webkit.org/show_bug.cgi?id=218289 Nice! > Source/WebKit/ChangeLog:9 > + Since Contacts.framework does not depend on WebKit and soft linking is > + discouraged, WebKit should link Contacts.framework normally. This is a complex topic that few people understand, so I think a slightly more detailed rationale is warranted in this ChangeLog. Soft linking has a performance cost because it uses a function call (dlopen) at runtime, and that requires running the linker at runtime, and running the linker has a cost. Weak linking avoids this performance cost because weak linking declares your linkage at build time, which enables running the linker at build time or update time or install time, avoiding the runtime cost.
Aditya Keerthi
Comment 3 2020-10-28 09:52:22 PDT
Created attachment 412538 [details] Patch for landing.
Aditya Keerthi
Comment 4 2020-10-28 09:54:07 PDT
(In reply to Geoffrey Garen from comment #2) > Comment on attachment 412533 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=412533&action=review > > r=me Thank you for the review! > > Source/WebKit/ChangeLog:4 > > + [Cocoa] Remove soft linking of Contacts.framework > > + https://bugs.webkit.org/show_bug.cgi?id=218289 > > Nice! > > > Source/WebKit/ChangeLog:9 > > + Since Contacts.framework does not depend on WebKit and soft linking is > > + discouraged, WebKit should link Contacts.framework normally. > > This is a complex topic that few people understand, so I think a slightly > more detailed rationale is warranted in this ChangeLog. > > Soft linking has a performance cost because it uses a function call (dlopen) > at runtime, and that requires running the linker at runtime, and running the > linker has a cost. > > Weak linking avoids this performance cost because weak linking declares your > linkage at build time, which enables running the linker at build time or > update time or install time, avoiding the runtime cost. I've added a similar description to the new Changelog :)
EWS
Comment 5 2020-10-28 10:41:17 PDT
Committed r269109: <https://trac.webkit.org/changeset/269109> All reviewed patches have been landed. Closing bug and clearing flags on attachment 412538 [details].
Radar WebKit Bug Importer
Comment 6 2020-10-28 10:42:20 PDT
Geoffrey Garen
Comment 7 2020-10-28 11:17:13 PDT
Comment on attachment 412538 [details] Patch for landing. View in context: https://bugs.webkit.org/attachment.cgi?id=412538&action=review > Source/WebKit/ChangeLog:19 > + Since Contacts.framework does not depend on WebKit and soft linking is > + discouraged, WebKit should link Contacts.framework normally. > + > + Soft linking requires running the linker at runtime, leading to an > + unwanted performance cost. By normally linking (on iOS) and weak linking > + (on macOS), the linkage is declared at build time, which enables running > + the linker at build/update/install time and avoiding the runtime cost. > + > + * Configurations/WebKit.xcconfig: > + > + On macOS, weak link the framework since Contacts.framework is not > + available on the Base System. Perfect!
Truitt Savell
Comment 8 2020-10-28 16:25:14 PDT
It looks like the changes in https://trac.webkit.org/changeset/269109/webkit broke TestWebKitAPI.ContentFiltering.LazilyLoadPlatformFrameworks History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.ContentFiltering.LazilyLoadPlatformFrameworks diff: Failed TestWebKitAPI.ContentFiltering.LazilyLoadPlatformFrameworks /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:374 Expected equality of these values: static_cast<bool>(networkExtensionShouldBeLoaded) Which is: false static_cast<bool>(networkExtensionLoaded) Which is: true /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:374 Expected equality of these values: static_cast<bool>(networkExtensionShouldBeLoaded) Which is: false static_cast<bool>(networkExtensionLoaded) Which is: true /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:374 Expected equality of these values: static_cast<bool>(networkExtensionShouldBeLoaded) Which is: false static_cast<bool>(networkExtensionLoaded) Which is: true /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:374 Expected equality of these values: static_cast<bool>(networkExtensionShouldBeLoaded) Which is: false static_cast<bool>(networkExtensionLoaded) Which is: true /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:374 Expected equality of these values: static_cast<bool>(networkExtensionShouldBeLoaded) Which is: false static_cast<bool>(networkExtensionLoaded) Which is: true
Tim Horton
Comment 9 2020-10-28 17:10:23 PDT
(In reply to Truitt Savell from comment #8) > It looks like the changes in https://trac.webkit.org/changeset/269109/webkit > > broke TestWebKitAPI.ContentFiltering.LazilyLoadPlatformFrameworks > > History: > https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI. > ContentFiltering.LazilyLoadPlatformFrameworks > > diff: > Failed > > TestWebKitAPI.ContentFiltering.LazilyLoadPlatformFrameworks > > > /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/ > WebKitCocoa/ContentFiltering.mm:374 > Expected equality of these values: > static_cast<bool>(networkExtensionShouldBeLoaded) > Which is: false > static_cast<bool>(networkExtensionLoaded) > Which is: true > > > > /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/ > WebKitCocoa/ContentFiltering.mm:374 > Expected equality of these values: > static_cast<bool>(networkExtensionShouldBeLoaded) > Which is: false > static_cast<bool>(networkExtensionLoaded) > Which is: true > > > > /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/ > WebKitCocoa/ContentFiltering.mm:374 > Expected equality of these values: > static_cast<bool>(networkExtensionShouldBeLoaded) > Which is: false > static_cast<bool>(networkExtensionLoaded) > Which is: true > > > > /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/ > WebKitCocoa/ContentFiltering.mm:374 > Expected equality of these values: > static_cast<bool>(networkExtensionShouldBeLoaded) > Which is: false > static_cast<bool>(networkExtensionLoaded) > Which is: true > > > > /Volumes/Data/slave/catalina-release/build/Tools/TestWebKitAPI/Tests/ > WebKitCocoa/ContentFiltering.mm:374 > Expected equality of these values: > static_cast<bool>(networkExtensionShouldBeLoaded) > Which is: false > static_cast<bool>(networkExtensionLoaded) > Which is: true Heh, that's kind of a silly test. Contacts must be dragging in NE, but that's OK.
Ryan Haddad
Comment 10 2020-10-29 10:47:34 PDT
Reverted r269109 for reason: Introduced dependency cycle Committed r269154: <https://trac.webkit.org/changeset/269154>
Aditya Keerthi
Comment 11 2020-10-29 17:55:36 PDT
Andy Estes
Comment 12 2020-10-30 10:38:21 PDT
Comment on attachment 412700 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=412700&action=review > Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm:42 > +// on macOS, or when Contacts can be upward linked. Are there radars that track either of these changes? We should link to them here so we know when it's safe to stop soft-linking on macOS.
Aditya Keerthi
Comment 13 2020-10-30 11:44:39 PDT
Created attachment 412781 [details] Patch for landing
Aditya Keerthi
Comment 14 2020-10-30 11:45:07 PDT
Comment on attachment 412781 [details] Patch for landing Added links to radars.
EWS
Comment 15 2020-11-02 11:46:32 PST
Committed r269263: <https://trac.webkit.org/changeset/269263> All reviewed patches have been landed. Closing bug and clearing flags on attachment 412781 [details].
Note You need to log in before you can comment on or make changes to this bug.