Bug 140748 - [iOS] Fix iphoneos SDK builds for ios-ews queue
Summary: [iOS] Fix iphoneos SDK builds for ios-ews queue
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-21 16:22 PST by David Kilzer (:ddkilzer)
Modified: 2015-01-22 11:28 PST (History)
3 users (show)

See Also:


Attachments
Patch v1 (21.30 KB, patch)
2015-01-21 16:41 PST, David Kilzer (:ddkilzer)
dbates: review+
dbates: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2015-01-21 16:22:28 PST
Fix build failures for the iphoneos SDK due to missing private headers to make the ios-ews queue work.
Comment 1 David Kilzer (:ddkilzer) 2015-01-21 16:41:14 PST
Created attachment 245098 [details]
Patch v1
Comment 2 WebKit Commit Bot 2015-01-21 16:43:51 PST
Attachment 245098 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/spi/cocoa/IOTypesSPI.h:36:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOTypesSPI.h:40:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOTypesSPI.h:41:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:42:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:77:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:78:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:79:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:80:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 8 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Daniel Bates 2015-01-21 17:35:07 PST
Comment on attachment 245098 [details]
Patch v1

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

> Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:35
> +#include "IOReturnSPI.h"

Is there value in having the separation between IOSurface SPI (IOSurfaceSPI.h) and IOKit SPI (IOReturnSPI.h) as opposed to grouping this functionality together with the functionality in IOTypesSPI.h into one IOKitSPI.h header? Or would it be too disingenuous to have such functionality in IOKitSPI.h?

> Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:36
> +#include "IOTypesSPI.h"

Is this header necessary? If so, see my remark above.
Comment 4 David Kilzer (:ddkilzer) 2015-01-21 18:57:22 PST
(In reply to comment #3)
> Comment on attachment 245098 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=245098&action=review
> 
> > Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:35
> > +#include "IOReturnSPI.h"
> 
> Is there value in having the separation between IOSurface SPI
> (IOSurfaceSPI.h) and IOKit SPI (IOReturnSPI.h) as opposed to grouping this
> functionality together with the functionality in IOTypesSPI.h into one
> IOKitSPI.h header? Or would it be too disingenuous to have such
> functionality in IOKitSPI.h?

Since <IOSurface/IOSurface.h> is API on macosx, and since IOSurface.framework is a separate framework from IOKit.framework, I would prefer to leave it separate from IOKit itself.

The rule I was using was if the header existed as API in the macosx SDK, then keep it as a separate SPI header when making it work for the iphoneos SDK just in case we need to add more things later.

> > Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:36
> > +#include "IOTypesSPI.h"
> 
> Is this header necessary? If so, see my remark above.

The kIOMapWriteCombineCache constant is used in these source files:

Source/WebCore/platform//graphics/cg/ImageBufferCG.cpp Source/WebCore/platform//graphics/cocoa/IOSurface.mm

Since these source files were previously only including <IOSurface/IOSurface.h> before, they were (likely) getting the IOTypes.h header through that header (although I didn't check explicitly).  It made sense to me to include it through IOSurfaceSPI.h as well rather than include it separately in each source file.
Comment 5 Daniel Bates 2015-01-21 21:02:01 PST
(In reply to comment #4)
> (In reply to comment #3)
> > Comment on attachment 245098 [details]
> > Patch v1
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=245098&action=review
> > 
> > > Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:35
> > > +#include "IOReturnSPI.h"
> > 
> > Is there value in having the separation between IOSurface SPI
> > (IOSurfaceSPI.h) and IOKit SPI (IOReturnSPI.h) as opposed to grouping this
> > functionality together with the functionality in IOTypesSPI.h into one
> > IOKitSPI.h header? Or would it be too disingenuous to have such
> > functionality in IOKitSPI.h?
> 
> Since <IOSurface/IOSurface.h> is API on macosx, and since
> IOSurface.framework is a separate framework from IOKit.framework, I would
> prefer to leave it separate from IOKit itself.
> 
> The rule I was using was if the header existed as API in the macosx SDK,
> then keep it as a separate SPI header when making it work for the iphoneos
> SDK just in case we need to add more things later.
> 

OK

> > > Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:36
> > > +#include "IOTypesSPI.h"
> > 
> > Is this header necessary? If so, see my remark above.
> 
> The kIOMapWriteCombineCache constant is used in these source files:
> 
> Source/WebCore/platform//graphics/cg/ImageBufferCG.cpp
> Source/WebCore/platform//graphics/cocoa/IOSurface.mm
> 
> Since these source files were previously only including
> <IOSurface/IOSurface.h> before, they were (likely) getting the IOTypes.h
> header through that header (although I didn't check explicitly).  It made
> sense to me to include it through IOSurfaceSPI.h as well rather than include
> it separately in each source file.

OK
Comment 6 Daniel Bates 2015-01-21 21:27:41 PST
Comment on attachment 245098 [details]
Patch v1

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

> Source/WebCore/platform/spi/cocoa/IOReturnSPI.h:35
> +typedef kern_return_t IOReturn;

We should include header mach/kern_return.h for the definition of kern_return_t.

Notice that IOPMLibSPI.h also has a typedef for IOReturn. We may want to consider consolidating this typedef into one file, say IOReturnSPI.h.

> Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:82
> +#if USE(APPLE_INTERNAL_SDK)
> +#import <IOSurface/IOSurfacePrivate.h>
> +#else
> +enum {
> +    kIOSurfacePurgeableNonVolatile = 0,
> +    kIOSurfacePurgeableVolatile = 1,
> +    kIOSurfacePurgeableEmpty = 2,
> +    kIOSurfacePurgeableKeepCurrent = 3,
> +};
> +#endif

Nit: The style used for this #if/#else/#endif block differs from the style you used for similar blocks both in this file (above) and in other files with regards to the omission of empty lines after the #if (line 73), before and after the #else (line 75) and before the #endif (line 82). I suggest that we pick a style for writing such blocks and stick with it for consistency.
Comment 7 Daniel Bates 2015-01-21 21:34:54 PST
Comment on attachment 245098 [details]
Patch v1

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

> Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h:59
> +mach_port_t IOSurfaceCreateMachPort(IOSurfaceRef buffer);

Nit: We should include the header for the definition of mach_port_t, mach/mach_port.h.
Comment 8 David Kilzer (:ddkilzer) 2015-01-22 11:28:24 PST
Committed r178927: <http://trac.webkit.org/changeset/178927>