Bug 80062 - WebKit.gyp:webkit should not depend on test code (!)
Summary: WebKit.gyp:webkit should not depend on test code (!)
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 82948
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-01 15:42 PST by Ami Fischman
Modified: 2015-01-17 20:38 PST (History)
10 users (show)

See Also:


Attachments
Patch (53.79 KB, patch)
2012-03-08 14:38 PST, Ami Fischman
no flags Details | Formatted Diff | Diff
Patch (58.77 KB, patch)
2012-03-08 15:25 PST, Ami Fischman
no flags Details | Formatted Diff | Diff
Patch (59.50 KB, patch)
2012-03-10 18:09 PST, Ami Fischman
no flags Details | Formatted Diff | Diff
Patch (63.59 KB, patch)
2012-03-10 19:26 PST, Ami Fischman
no flags Details | Formatted Diff | Diff
Patch (63.59 KB, patch)
2012-03-11 10:45 PDT, Ami Fischman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ami Fischman 2012-03-01 15:42:21 PST
http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp&exact_package=chromium&q=file:gyp%20file:third_party/webkit%20:gtest&type=cs&l=710 makes the webkit target depend on test code in the shared-library build.

This is terrible for various reasons:
- It violates the ODR by whole-sale linking in static libraries which are also linked into the main binary directly (http://crbug.com/112539)
- It holds non-test code hostage to the standards of test-code (e.g. http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp&exact_package=chromium&q=file:gyp%20file:third_party/webkit%20:gtest&type=cs&l=763)
- It makes the build bigger than it needs to be

The madness must stop.
Comment 1 Ami Fischman 2012-03-08 14:38:09 PST
Created attachment 130908 [details]
Patch
Comment 2 WebKit Review Bot 2012-03-08 14:41:03 PST
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
Comment 3 Darin Fisher (:fishd, Google) 2012-03-08 14:48:38 PST
I think it is great that you are taking this on.  I think it makes good sense to make our build of WebKit.DLL export symbols from WebCore that are used by our unit tests.

I am concerned about using WTF_EXPORT outside of the WTF code base.  I think it would be better to invent a similar define for each module.  So, WebCore should have its own WEBCORE_EXPORT most likely.

This may be something we need to discuss more broadly with the community as other ports use the other way of exporting symbols from WebCore (.def / WebCore.exp).

-Darin
Comment 4 Ami Fischman 2012-03-08 15:25:39 PST
Created attachment 130918 [details]
Patch
Comment 5 Ami Fischman 2012-03-08 15:29:05 PST
(In reply to comment #3)
> I am concerned about using WTF_EXPORT outside of the WTF code base.  I think it would be better to invent a similar define for each module.  So, WebCore should have its own WEBCORE_EXPORT most likely.

In looking for where to put the proposed new WEBCORE_EXPORT I found Source/WebCore/platform/PlatformExportMacros.h which already defines WEBKIT_EXPORTDATA as what I would have put in WEBCORE_EXPORT.  So the second patch updates to use that instead of WTF_EXPORT{,DATA}.
SGTY?

> This may be something we need to discuss more broadly with the community as other ports use the other way of exporting symbols from WebCore (.def / WebCore.exp).

ISTM there's already quite a lot of use of _EXPORT macros (across ports) so not sure if this is needed.
Adam: do you have an opinion on this?
Comment 6 Early Warning System Bot 2012-03-08 16:33:01 PST
Comment on attachment 130918 [details]
Patch

Attachment 130918 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/11906194
Comment 7 Adam Barth 2012-03-08 16:34:08 PST
> Adam: do you have an opinion on this?

I agree with fishd that this is a change we should discuss with the boarder community before making.  Different ports have different needs for exporting symbols from WebCore.  It's not obvious me to what's best.

The simplest solution would be to create a Chromium equivalent to WebCore.exp.in that lists the symbols that Chromium wants to export from WebCore.  However, maintaining that file is a pain and I wouldn't wish to impose the maintenance of another such file on the rest of the community.
Comment 8 Build Bot 2012-03-08 17:52:38 PST
Comment on attachment 130918 [details]
Patch

Attachment 130918 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/11915210
Comment 9 Build Bot 2012-03-08 17:54:57 PST
Comment on attachment 130918 [details]
Patch

Attachment 130918 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/11911212
Comment 10 Ami Fischman 2012-03-08 19:53:21 PST
(In reply to comment #7)
> I agree with fishd that this is a change we should discuss with the boarder community before making.

Sent email to webkit-dev.  Let the opinions flow!
Comment 11 Gustavo Noronha (kov) 2012-03-08 21:30:50 PST
Comment on attachment 130918 [details]
Patch

Attachment 130918 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11903360
Comment 12 Collabora GTK+ EWS bot 2012-03-08 22:35:55 PST
Comment on attachment 130918 [details]
Patch

Attachment 130918 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11894426
Comment 13 Darin Fisher (:fishd, Google) 2012-03-09 14:39:18 PST
Comment on attachment 130918 [details]
Patch

I would probably prefer to introduce a WEBCORE_EXPORT macro, possibly renaming WEBKIT_EXPORTDATA to be that.  That seems clearer to me.

Otherwise, this patch looks to correctly implement the idea of exporting functions from WebCore to support the Chromium port's unit tests.
Comment 14 Ami Fischman 2012-03-09 16:26:11 PST
(In reply to comment #13)
> (From update of attachment 130918 [details])
> I would probably prefer to introduce a WEBCORE_EXPORT macro, possibly renaming WEBKIT_EXPORTDATA to be that.  That seems clearer to me.

Went to see how much work it'd be to do this, and AFAICT *nobody* uses it today.
How worried do I need to be about hidden codebases?  (safari, other ports not part of the third_party/WebKit tree in a chromium checkout)

I'll do the rename as part of this patch if there are really no other use sites.
Comment 15 Adam Barth 2012-03-09 16:27:36 PST
> How worried do I need to be about hidden codebases?

The WebKit project explicitly doesn't care about hidden codebases.  That's the carrot for joining the community.
Comment 16 Ami Fischman 2012-03-10 18:09:47 PST
Created attachment 131197 [details]
Patch
Comment 17 Ami Fischman 2012-03-10 18:10:53 PST
(In reply to comment #16)
> Created an attachment (id=131197) [details]
> Patch

Renamed s/WEBKIT_EXPORTDATA/WEBCORE_EXPORT/g and added an explicit #include to hopefully greenify the red EWS runs from the last patch.
Comment 18 Early Warning System Bot 2012-03-10 18:32:13 PST
Comment on attachment 131197 [details]
Patch

Attachment 131197 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/11937252
Comment 19 Gustavo Noronha (kov) 2012-03-10 19:06:45 PST
Comment on attachment 131197 [details]
Patch

Attachment 131197 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11939261
Comment 20 Ami Fischman 2012-03-10 19:26:23 PST
Created attachment 131200 [details]
Patch

Even more explicit includes of PlatformExportMacros.h
Comment 21 Ami Fischman 2012-03-11 10:45:32 PDT
Created attachment 131245 [details]
Patch

rename WEBCORE_EXPORT to WEBCORE_EXPORT_PRIVATE per morrita@ preference
Comment 22 Adam Barth 2012-05-21 15:20:52 PDT
Comment on attachment 131245 [details]
Patch

I'm clearing the review flag from this patch since it's not clear how we should proceed here.
Comment 23 Ami Fischman 2012-05-21 15:24:35 PDT
Thanks Adam.  FTR, my plan is to wait for bug 82948 to finish getting squashed before re-visiting this.
Comment 24 Adam Barth 2012-05-21 15:34:54 PDT
Makes sense.