Bug 202384 - Resurrect Mac CMake build
Summary: Resurrect Mac CMake build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-30 17:33 PDT by Alex Christensen
Modified: 2019-10-01 08:43 PDT (History)
17 users (show)

See Also:


Attachments
Patch (42.89 KB, patch)
2019-09-30 17:34 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2019-09-30 17:33:58 PDT
Resurrect Mac CMake build
Comment 1 Alex Christensen 2019-09-30 17:34:36 PDT
Created attachment 379864 [details]
Patch
Comment 2 Don Olmstead 2019-09-30 17:51:18 PDT
Comment on attachment 379864 [details]
Patch

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

> Source/JavaScriptCore/PlatformMac.cmake:26
> +    API/JSCallbackFunction.h
>      API/JSContext.h
> +    API/JSContextPrivate.h
>      API/JSExport.h
>      API/JSManagedValue.h
>      API/JSStringRefCF.h
>      API/JSValue.h
> +    API/JSValuePrivate.h

This shouldn't be in public framework headers. This should just be stuff included by JavaScriptCore.h.

Is there a reason you added these? They should all be in the private headers definition below.

> Source/WebKitLegacy/PlatformMac.cmake:10
>      "${WEBKITLEGACY_DIR}/mac"
> -    "${WEBKITLEGACY_DIR}/mac/Carbon"
> -    "${WEBKITLEGACY_DIR}/mac/DefaultDelegates"
> -    "${WEBKITLEGACY_DIR}/mac/DOM"
> -    "${WEBKITLEGACY_DIR}/mac/History"
> -    "${WEBKITLEGACY_DIR}/mac/icu"
> -    "${WEBKITLEGACY_DIR}/mac/Misc"
> -    "${WEBKITLEGACY_DIR}/mac/Panels"
> -    "${WEBKITLEGACY_DIR}/mac/Plugins"
> -    "${WEBKITLEGACY_DIR}/mac/Plugins/Hosted"
> -    "${WEBKITLEGACY_DIR}/mac/Storage"
> -    "${WEBKITLEGACY_DIR}/mac/WebCoreSupport"
> -    "${WEBKITLEGACY_DIR}/mac/WebInspector"
> -    "${WEBKITLEGACY_DIR}/mac/WebView"
> +    "${DERIVED_SOURCES_DIR}/ForwardingHeaders"
> +    "${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebCore"
> +    "${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy"

This isn't right this should only have additional mac related directories in here which you've deleted.

The root CMakeLists.txt has "${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}". If something is in WebCore and its being included through "Foo.h" rather than <WebCore/Foo.h> that's wrong. The forwarding headers for WebKitLegacy aren't meant to be included either they're just copies for the next project. I think you copying here is why you got this built but you removed the includes for the individual directories above.
Comment 3 Alex Christensen 2019-09-30 22:36:28 PDT
(In reply to Don Olmstead from comment #2)
> Comment on attachment 379864 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=379864&action=review
> 
> > Source/JavaScriptCore/PlatformMac.cmake:26
> > +    API/JSCallbackFunction.h
> >      API/JSContext.h
> > +    API/JSContextPrivate.h
> >      API/JSExport.h
> >      API/JSManagedValue.h
> >      API/JSStringRefCF.h
> >      API/JSValue.h
> > +    API/JSValuePrivate.h
> 
> This shouldn't be in public framework headers. This should just be stuff
> included by JavaScriptCore.h.
This is necessary to get it to build for now.  We can iron out the details once engineers are actually using it.
> 
> Is there a reason you added these? They should all be in the private headers
> definition below.
> 
> > Source/WebKitLegacy/PlatformMac.cmake:10
> >      "${WEBKITLEGACY_DIR}/mac"
> > -    "${WEBKITLEGACY_DIR}/mac/Carbon"
> > -    "${WEBKITLEGACY_DIR}/mac/DefaultDelegates"
> > -    "${WEBKITLEGACY_DIR}/mac/DOM"
> > -    "${WEBKITLEGACY_DIR}/mac/History"
> > -    "${WEBKITLEGACY_DIR}/mac/icu"
> > -    "${WEBKITLEGACY_DIR}/mac/Misc"
> > -    "${WEBKITLEGACY_DIR}/mac/Panels"
> > -    "${WEBKITLEGACY_DIR}/mac/Plugins"
> > -    "${WEBKITLEGACY_DIR}/mac/Plugins/Hosted"
> > -    "${WEBKITLEGACY_DIR}/mac/Storage"
> > -    "${WEBKITLEGACY_DIR}/mac/WebCoreSupport"
> > -    "${WEBKITLEGACY_DIR}/mac/WebInspector"
> > -    "${WEBKITLEGACY_DIR}/mac/WebView"
> > +    "${DERIVED_SOURCES_DIR}/ForwardingHeaders"
> > +    "${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebCore"
> > +    "${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy"
> 
> This isn't right this should only have additional mac related directories in
> here which you've deleted.
> 
> The root CMakeLists.txt has "${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}". If
> something is in WebCore and its being included through "Foo.h" rather than
> <WebCore/Foo.h> that's wrong. The forwarding headers for WebKitLegacy aren't
> meant to be included either they're just copies for the next project. I
> think you copying here is why you got this built but you removed the
> includes for the individual directories above.

This is unfortunately the cleanest way to get WebKitLegacy to build.  It has lots of ObjC headers that are included with #import <WebKitLegacy/Header.h> and #import "Header.h" and it was determined that this was cleaner than making them consistent, which we do not intend to do.
Comment 4 Alex Christensen 2019-09-30 23:30:19 PDT
I confirmed that moving the headers to the list of private headers makes it fail to build jsc.  We'll fix the publicness of headers later.
http://trac.webkit.org/r250550
Comment 5 Radar WebKit Bug Importer 2019-09-30 23:31:19 PDT
<rdar://problem/55868125>
Comment 6 Konstantin Tokarev 2019-10-01 05:55:20 PDT
Will we have buildbot for Mac/cmake? Otherwise it will bitrot quickly
Comment 7 Alex Christensen 2019-10-01 08:43:45 PDT
fixing...