| Summary: | Cocoa availability macros are not working for non-WebKit sources on buildbots | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kimmo Kinnunen <kkinnunen> |
| Component: | Tools / Tests | Assignee: | Kimmo Kinnunen <kkinnunen> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | ap, jbedard, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Pull request: https://github.com/WebKit/WebKit/pull/9869 |
Cocoa availability macros are not working for non-WebKit sources on buildbots After running configure-xcode-for-embedded-development, the Cocoa WebKit OpenSource SDK is left in following state: - Correct code does not build with the WebKit OpenSource SDK - Incorrect code builds with the SDK, but does not build on real, unmodified SDK This is because WebKit erases the availability macros from the SDK. Consider case: enum A { CommonOption, MacOSOption API_UNAVAILABLE(ios) }; bool correctFunc(A a) { switch (a) { case CommonOption: return true; #if defined(TARGET_OS_MAC) case MacOSOption: return false; #endif } } bool incorrectFunc(A a) { switch (a) { case CommonOption: return true; case MacOSOption: return false; } } bool incorrectAndConfusingButCompilingFunc(A a) { switch (a) { case CommonOption: return true; #if defined(TARGET_OS_MAC) case MacOSOption: return false; #endif default: UNREACHABLE(); return false; } } - correctFunc does not compile on WebKit SDK. This the bug we want to fix. - WebKit code needs to use incorrectFunc. This is the bug we want to fix. - incorrectFunc does not compile on unmodified SDK. This is the feature we want to preserve. This becomes a problem when contributing to ANGLE: - If we contribute incorrect code to ANGLE, it doesn't compile for the rest of the world. - If we contribute correct code to ANGLE, it doesn't compile for WebKit. - Currently we have to use the workaround incorrectAndConfusingButCompilingFunc