Bug 44692

Summary: [Qt] Auto-generate WebKit2 forwarding headers
Product: WebKit Reporter: Andras Becsi <abecsi>
Component: WebKit2Assignee: Andras Becsi <abecsi>
Status: RESOLVED FIXED    
Severity: Normal CC: christian.webkit, darin, hausmann, kbalazs, ossy, vestbo, webkit.review.bot
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
proposed patch
abecsi: commit-queue-
proposed patch v2
none
proposed patch v3 none

Description Andras Becsi 2010-08-26 09:26:31 PDT
https://bugs.webkit.org/show_bug.cgi?id=44336 introduced a new method of creating the forwarding headers.
Push this approach one step further by auto-generating the headers using a perl script to make it possible that the Mac and Windows ports of WebKit2 also use this way to generate forwarding headers.
Comment 1 Andras Becsi 2010-08-26 09:31:29 PDT
Created attachment 65576 [details]
proposed patch
Comment 2 Andras Becsi 2010-08-26 11:04:20 PDT
Comment on attachment 65576 [details]
proposed patch

The patch needs a typo fix in the ChangeLog and a comment fix in the script, so setting cq-.
Nonetheless comments are appreciated.
Comment 3 Mark Rowe (bdash) 2010-08-26 15:40:16 PDT
How is this platform-independent?  It seems to be completely missing the point of the forwarding headers, and in fact is not useful on Mac and Windows for precisely the reason that forwarding headers are currently used.   If it were possible to invoke a script located in WebKitTools/Scripts that walks over the source trees of every project then it would be possible to directly include headers from the other projects and there would be no reason to even use forwarding headers on Mac and Windows.
Comment 4 Balazs Kelemen 2010-08-26 17:30:22 PDT
Seems like Andras has somewhat misinterpreted why do we need forwarding headers on Mac but this is a step forward anyway. It would not be hard to extend the script with a switch that means it should copy the needed headers instead of generating a forwarding header for them. Then we would have the headers in one directory for each framework and use them as now we use *framework*/ForwardingHeaders (packaging with the libraries as I can imagine). The essence is that we can save the trouble of maintaining the forwarding headers manually (for building and packaging as well).
Comment 5 Andras Becsi 2010-08-27 01:02:14 PDT
(In reply to comment #3)
> How is this platform-independent?  It seems to be completely missing the point of the forwarding headers, and in fact is not useful on Mac and Windows for precisely the reason that forwarding headers are currently used.   If it were possible to invoke a script located in WebKitTools/Scripts that walks over the source trees of every project then it would be possible to directly include headers from the other projects and there would be no reason to even use forwarding headers on Mac and Windows.

Now I see that my first comment did underexplain my intention with this patch. In the current form the script truly seems missing the point on Mac and Windows, and I shouldn't have set the blocker (sorry for the confusion), but as Balazs points out it is not hard to extend it with a switch, so it copies every header instead of crawling the sources and creating forwarding headers, so it can also mimic the current behaviour of the Mac and Windows WebKit2 builds.

I also see that the main cause we need these headers on Qt is because the build systems of Mac and Windows force a clumsy way of using framework style includes on other ports. This issue should be addressed in the first place by fixing the build systems and directly include headers and if the Mac and Windows build systems need framework style headers, then they should generate or copy them themselves, so this script would be useless in the current form. Since this way of fixing the problem seems to stall for almost two months now, and this issue is blocking us from being able to properly focus on on the implementation of WebKit2, I think this could be a (hopefully) temporary way of auto-generating the headers.
Comment 6 Balazs Kelemen 2010-08-29 09:33:50 PDT
Andras, you should read this bug: https://bugs.webkit.org/show_bug.cgi?id=44802. At least I have realized that the mac production builds for a particular framework should not have dependencies from any other directory.
Comment 7 Andras Becsi 2010-08-30 07:40:13 PDT
Created attachment 65913 [details]
proposed patch v2

Moved the script to the WebKit2 directory so there is no build time dependency to WebKitTools/Scripts, and generate forwarding headers with paths relative to the given framework directories since these are already added to the include paths.
Comment 8 WebKit Review Bot 2010-08-30 07:45:06 PDT
Attachment 65913 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebKitTools/MiniBrowser/qt/BrowserWindow.h:33:  Alphabetical sorting problem.  [build/include_order] [4]
WebKitTools/MiniBrowser/qt/BrowserWindow.h:34:  Alphabetical sorting problem.  [build/include_order] [4]
WebKitTools/MiniBrowser/qt/BrowserWindow.h:37:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Andras Becsi 2010-08-30 08:07:59 PDT
Created attachment 65914 [details]
proposed patch v3

Rearranged headers to comply to the style guide.
Comment 10 Andras Becsi 2010-09-01 03:56:03 PDT
Committed r66592: <http://trac.webkit.org/changeset/66592>
Comment 11 Andras Becsi 2010-09-01 06:51:02 PDT
Comment on attachment 65914 [details]
proposed patch v3

Clearing flags.