RESOLVED FIXED Bug 187653
libwebrtc.dylib Objective-C classes conflict with third-party frameworks
https://bugs.webkit.org/show_bug.cgi?id=187653
Summary libwebrtc.dylib Objective-C classes conflict with third-party frameworks
David Kilzer (:ddkilzer)
Reported 2018-07-13 12:12:11 PDT
libwebrtc.dylib Objective-C classes conflict with third-party frameworks that build using the same source base. <rdar://problem/41896685>
Attachments
Patch v1 (122.57 KB, patch)
2018-07-13 12:32 PDT, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2018-07-13 12:16:00 PDT
Here are the commands I used to add the attributes: $ perl -pi -e 's/^(\@interface (RTC[^\s<;:]*)[^\(\)]*)$/__attribute__((objc_runtime_name("WK_$2")))\n$1/mg' `egrep -l -r '^@interface RTC' Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v UnitTests` $ perl -pi -e 's/^\@protocol (RTC[^\s<;:]*)/__attribute__((objc_runtime_name("WK_$1")))\n\@protocol $1/mg' `egrep -l -r '^@protocol RTC' Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v UnitTests` Note that the easiest way (when merging upstream changes) to update this is probably to remove these attributes, merge the update, then rerun the commands above. We may also want to consider upstreaming a change that lets anyone define their own prefix for Objective-C classes and protocols to make this easier. For now, we're doing the simplest thing possible by using the attributes directly (as I didn't want to introduce a header file that must be included in many other header files).
David Kilzer (:ddkilzer)
Comment 2 2018-07-13 12:32:31 PDT
Created attachment 344967 [details] Patch v1
David Kilzer (:ddkilzer)
Comment 3 2018-07-13 12:33:29 PDT
(In reply to David Kilzer (:ddkilzer) from comment #1) > Here are the commands I used to add the attributes: > > $ perl -pi -e 's/^(\@interface > (RTC[^\s<;:]*)[^\(\)]*)$/__attribute__((objc_runtime_name("WK_$2")))\n$1/mg' > `egrep -l -r '^@interface RTC' > Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v > UnitTests` > > $ perl -pi -e 's/^\@protocol > (RTC[^\s<;:]*)/__attribute__((objc_runtime_name("WK_$1")))\n\@protocol > $1/mg' `egrep -l -r '^@protocol RTC' > Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v > UnitTests` I should note that this is the only source file that's NOT covered by the commands above: Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm
WebKit Commit Bot
Comment 4 2018-07-13 13:08:45 PDT
Comment on attachment 344967 [details] Patch v1 Clearing flags on attachment: 344967 Committed r233812: <https://trac.webkit.org/changeset/233812>
WebKit Commit Bot
Comment 5 2018-07-13 13:08:47 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.