Bug 137371

Summary: [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit2Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, benjamin, bjonesbe, cmarcelo, commit-queue, ddkilzer, eric.carlson, eugenebut, glenn, jer.noble, philipj, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 136487, 138928, 138930, 140235    
Bug Blocks:    
Attachments:
Description Flags
Work-in-progress patch
none
Patch
none
Patch
none
Patch 1 of 4: Add new files
ddkilzer: review+
Patch 2 of 4: WebCore and WebKit2 Xcode changes
ddkilzer: review+
Patch 3 of 4: DumpRenderTree changes
ddkilzer: review+
Patch 4 of 4: Substitute SPI wrapper headers for actual headers; add WTF EXTERN_C_{BEGIN, END} ddkilzer: review+

Description Daniel Bates 2014-10-02 16:46:33 PDT
We should make WebKit2 build with the public iOS SDK.
Comment 1 Daniel Bates 2014-10-02 16:48:50 PDT
Created attachment 239156 [details]
Work-in-progress patch
Comment 2 Daniel Bates 2014-12-22 17:09:34 PST
Created attachment 243652 [details]
Patch
Comment 3 WebKit Commit Bot 2014-12-22 17:11:48 PST
Attachment 243652 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:37:  name_t is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 64 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Daniel Bates 2014-12-23 10:44:49 PST
Created attachment 243679 [details]
Patch
Comment 5 WebKit Commit Bot 2014-12-23 10:47:41 PST
Attachment 243679 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:37:  name_t is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:43:  bootstrap_look_up is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:44:  bootstrap_register2 is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 64 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Sam Weinig 2014-12-27 14:12:24 PST
Comment on attachment 243679 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243679&action=review

> Source/WebCore/platform/spi/cocoa/ServersSPI.h:33
> +#include <servers/bootstrap.h>

Is this really SPI everywhere? I think at least on OS X, this file is API.

> Source/WebCore/platform/spi/cocoa/ServersSPI.h:44
> +kern_return_t bootstrap_register2(mach_port_t, name_t, mach_port_t, uint64_t);

I don't think you are including a header for this. It is defined in bootstrap_priv.h,

> Source/WebCore/platform/spi/ios/UIKitSPI.h:28
> +// FIXME: Move this header to the WebKit2 framework once we remove DumpRenderTree's
> +// dependence on it. It is a layering violation to include this header or any UIKit
> +// headers in a WebCore or WebKitLegacy file as UIKit depends on WebKitLegacy.

Why not just make DumpRenderTree get it from WebKit2?
Comment 7 Daniel Bates 2015-01-07 12:29:40 PST
(In reply to comment #6)
> Comment on attachment 243679 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=243679&action=review
> 
> > Source/WebCore/platform/spi/cocoa/ServersSPI.h:33
> > +#include <servers/bootstrap.h>
> 
> Is this really SPI everywhere? I think at least on OS X, this file is API.
> 

You're right! Will fix as this is API on OS X.

> > Source/WebCore/platform/spi/cocoa/ServersSPI.h:44
> > +kern_return_t bootstrap_register2(mach_port_t, name_t, mach_port_t, uint64_t);
> 
> I don't think you are including a header for this. It is defined in
> bootstrap_priv.h,
> 

Will include header bootstrap_priv.h when building with the Apple Internal SDK.

> > Source/WebCore/platform/spi/ios/UIKitSPI.h:28
> > +// FIXME: Move this header to the WebKit2 framework once we remove DumpRenderTree's
> > +// dependence on it. It is a layering violation to include this header or any UIKit
> > +// headers in a WebCore or WebKitLegacy file as UIKit depends on WebKitLegacy.
> 
> Why not just make DumpRenderTree get it from WebKit2?

I can do this. When I wrote the patch I thought it would be considered bad form to have a WebKit1-based application, DumpRenderTree, depend on a WebKit2 header and I did not want to add to the bad practices used by DumpRenderTree (including referencing headers from WebCore).
Comment 8 Daniel Bates 2015-01-07 13:56:40 PST
Created attachment 244190 [details]
Patch 1 of 4: Add new files

Adds SPI wrapper headers and consolidates the content of header _UIHighlightViewSPI.h into the newly added header UIKitSPI.h.
Comment 9 Daniel Bates 2015-01-07 13:57:39 PST
Created attachment 244192 [details]
Patch 2 of 4: WebCore and WebKit2 Xcode changes
Comment 10 WebKit Commit Bot 2015-01-07 13:58:31 PST
Attachment 244190 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:37:  name_t is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:49:  bootstrap_look_up is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/platform/spi/cocoa/ServersSPI.h:50:  bootstrap_register2 is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Daniel Bates 2015-01-07 13:58:49 PST
Created attachment 244193 [details]
Patch 3 of 4: DumpRenderTree changes
Comment 12 Daniel Bates 2015-01-07 13:59:22 PST
Created attachment 244194 [details]
Patch 4 of 4: Substitute SPI wrapper headers for actual headers; add WTF EXTERN_C_{BEGIN, END}
Comment 13 WebKit Commit Bot 2015-01-07 14:01:09 PST
Attachment 244194 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm:43:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 45 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 David Kilzer (:ddkilzer) 2015-01-07 15:38:53 PST
Comment on attachment 244190 [details]
Patch 1 of 4: Add new files

rs=me
Comment 15 David Kilzer (:ddkilzer) 2015-01-07 15:40:53 PST
Comment on attachment 244192 [details]
Patch 2 of 4: WebCore and WebKit2 Xcode changes

r=me
Comment 16 David Kilzer (:ddkilzer) 2015-01-07 15:47:07 PST
Comment on attachment 244193 [details]
Patch 3 of 4: DumpRenderTree changes

View in context: https://bugs.webkit.org/attachment.cgi?id=244193&action=review

r=me

> Tools/ChangeLog:3
> +        [iOS] Make WebKit2 build with public iOS SDK

I know this is the title of the bug, but the patch actually makes DumpRenderTree build.  Maybe better to change "WebKit2" to "DumpRenderTree"?
Comment 17 David Kilzer (:ddkilzer) 2015-01-07 15:55:13 PST
Comment on attachment 244194 [details]
Patch 4 of 4: Substitute SPI wrapper headers for actual headers; add WTF EXTERN_C_{BEGIN, END}

View in context: https://bugs.webkit.org/attachment.cgi?id=244194&action=review

r=me

> Source/WTF/wtf/Compiler.h:179
>  #ifdef __cplusplus
> +#define EXTERN_C_BEGIN extern "C" {
> +#define EXTERN_C_END }
> +#else
> +#define EXTERN_C_BEGIN
> +#define EXTERN_C_END
> +#endif

Not to be pedantic, but do these need to be named WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END so we don't conflict with someone else's headers?

> Source/WebKit2/ChangeLog:10
> +        * Configurations/BaseTarget.xcconfig: Append directory $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks to
> +        the list of directories to search for frameworks so that we the linker can find and link against iOS private
> +        frameworks (e.g. AssertionServices).

This was moved to a different patch, I think.
Comment 18 Daniel Bates 2015-01-07 16:02:22 PST
(In reply to comment #16)
> Comment on attachment 244193 [details]
> Patch 3 of 4: DumpRenderTree changes
> > Tools/ChangeLog:3
> > +        [iOS] Make WebKit2 build with public iOS SDK
> 
> I know this is the title of the bug, but the patch actually makes
> DumpRenderTree build.  Maybe better to change "WebKit2" to "DumpRenderTree"?

No, more build fixes are needed to make DumpRenderTree build with the public SDK.
Comment 19 Daniel Bates 2015-01-07 16:09:01 PST
(In reply to comment #17)
> > Source/WTF/wtf/Compiler.h:179
> >  #ifdef __cplusplus
> > +#define EXTERN_C_BEGIN extern "C" {
> > +#define EXTERN_C_END }
> > +#else
> > +#define EXTERN_C_BEGIN
> > +#define EXTERN_C_END
> > +#endif
> 
> Not to be pedantic, but do these need to be named WTF_EXTERN_C_BEGIN and
> WTF_EXTERN_C_END so we don't conflict with someone else's headers?
> 

Will rename EXTERN_C_BEGIN and EXTERN_C_END to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively.

> > Source/WebKit2/ChangeLog:10
> > +        * Configurations/BaseTarget.xcconfig: Append directory $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks to
> > +        the list of directories to search for frameworks so that we the linker can find and link against iOS private
> > +        frameworks (e.g. AssertionServices).
> 
> This was moved to a different patch, I think.

This change is in "Patch 2 of 4: WebCore and WebKit2 Xcode changes" (attachment 244192 [details]).
Comment 20 Daniel Bates 2015-01-07 16:36:01 PST
Committed r178068: <http://trac.webkit.org/changeset/178068>
Comment 21 WebKit Commit Bot 2015-01-07 17:59:28 PST
Re-opened since this is blocked by bug 140235
Comment 22 Tim Horton 2015-01-07 18:49:56 PST
Comment on attachment 244194 [details]
Patch 4 of 4: Substitute SPI wrapper headers for actual headers; add WTF EXTERN_C_{BEGIN, END}

View in context: https://bugs.webkit.org/attachment.cgi?id=244194&action=review

> Source/WTF/wtf/Compiler.h:181
> +// FIXME: Remove this once we have transitioned to EXTERN_C_BEGIN/EXTERN_C_END.

This file *has* to use /* */ style comments because it gets included in the sandbox profile and the sandbox profile compiler doesn't understand // comments.
Comment 23 Daniel Bates 2015-01-07 20:17:04 PST
Committed r178080: <http://trac.webkit.org/changeset/178080>
Comment 24 Daniel Bates 2015-01-07 22:07:59 PST
(In reply to comment #22)
> Comment on attachment 244194 [details]
> Patch 4 of 4: Substitute SPI wrapper headers for actual headers; add WTF
> EXTERN_C_{BEGIN, END}
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=244194&action=review
> 
> > Source/WTF/wtf/Compiler.h:181
> > +// FIXME: Remove this once we have transitioned to EXTERN_C_BEGIN/EXTERN_C_END.
> 
> This file *has* to use /* */ style comments because it gets included in the
> sandbox profile and the sandbox profile compiler doesn't understand //
> comments.

Fixed in <http://trac.webkit.org/changeset/178104>.