Bug 66521

Summary: TestWebKitAPI has issues due to FastMalloc incompatibility
Product: WebKit Reporter: Dmitry Lomov <dslomov>
Component: Tools / TestsAssignee: Dmitry Lomov <dslomov>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, bfulgham, ddkilzer, fpizlo, levin, mrowe, sam, simon.fraser, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 66607, 75153    
Bug Blocks:    
Attachments:
Description Flags
This patch ensures that gtest uses new and delete operators that are defined in JavaScriptCore.
none
Recovered gtest unit-tests
levin: review-
README fixed up
none
Patch v4
none
Patch v5
none
Patch v6 levin: review+

Description Dmitry Lomov 2011-08-18 19:30:11 PDT
The fix for  https://bugs.webkit.org/show_bug.cgi?id=61812 was incomplete.
Comment 1 Dmitry Lomov 2011-08-18 19:35:34 PDT
Created attachment 104438 [details]
This patch ensures that gtest uses new and delete operators that are defined in JavaScriptCore. 

Also some cleanup of gtest.xcodeproj
Comment 2 David Levin 2011-08-18 19:52:03 PDT
Comment on attachment 104438 [details]
This patch ensures that gtest uses new and delete operators that are defined in JavaScriptCore. 

So your clean up consisted of getting rid of the code which tests gtest itself?

It seems like it would be good to keep this running in case anyone does local changes to gtest, they can still be verified.
Comment 3 Dmitry Lomov 2011-08-18 22:16:32 PDT
(In reply to comment #2)
> (From update of attachment 104438 [details])
> So your clean up consisted of getting rid of the code which tests gtest itself?
> 
> It seems like it would be good to keep this running in case anyone does local changes to gtest, they can still be verified.

Yes, good point.
Comment 4 Dmitry Lomov 2011-08-19 11:25:33 PDT
Created attachment 104531 [details]
Recovered gtest unit-tests
Comment 5 David Levin 2011-08-19 11:29:04 PDT
Comment on attachment 104531 [details]
Recovered gtest unit-tests

Seems fine except it would be good to modify the readme (http://trac.webkit.org/browser/trunk/Source/ThirdParty/gtest/README.WebKit) to keep track of the local changes done. It would be good to include info about the last changes as well.

The purpose is so that when someone wants to pull down a new version of gtest they can modify it in the same way that we have done locally.
Comment 6 Dmitry Lomov 2011-08-19 11:52:05 PDT
Created attachment 104540 [details]
README fixed up
Comment 7 Dmitry Lomov 2011-08-19 12:08:59 PDT
Landed in http://trac.webkit.org/changeset/93426. Closing bug.
Comment 8 Dmitry Lomov 2011-08-19 16:29:35 PDT
Some patches collided in mid-air causing MacOS build of TestWebKitAPI to fail.
Comment 9 David Kilzer (:ddkilzer) 2011-12-21 09:13:38 PST
(In reply to comment #7)
> Landed in http://trac.webkit.org/changeset/93426. Closing bug.

This was rolled out in r93451 by Bug 66607.  <http://trac.webkit.org/changeset/93451>
Comment 10 David Kilzer (:ddkilzer) 2011-12-21 10:24:50 PST
Comment on attachment 104540 [details]
README fixed up

Obsoleting this attachment since it was rolled out in r93451.
Comment 11 David Kilzer (:ddkilzer) 2011-12-21 11:19:09 PST
*** Bug 69942 has been marked as a duplicate of this bug. ***
Comment 12 David Kilzer (:ddkilzer) 2011-12-21 11:36:11 PST
<rdar://problem/10607911>
Comment 13 David Kilzer (:ddkilzer) 2011-12-21 12:07:34 PST
Created attachment 120211 [details]
Patch v4
Comment 14 David Kilzer (:ddkilzer) 2011-12-22 09:04:50 PST
Comment on attachment 120211 [details]
Patch v4

I am rebasing this patch to a more recent trunk.  The changes in Tools/TestWebKitAPI/config.h have been replaced by some new headers in JavaScriptCore, and I need to make similar changes to gtest-port.h.
Comment 15 David Kilzer (:ddkilzer) 2011-12-22 13:35:27 PST
Created attachment 120373 [details]
Patch v5
Comment 16 David Kilzer (:ddkilzer) 2011-12-22 13:37:41 PST
(In reply to comment #15)
> Created an attachment (id=120373) [details]
> Patch v5

Changes since Patch v4:
- Removed Tools/TestWebKitAPI/config.h changes as they were no longer needed.
- Replaced various macro definitions in gtest-port.h with wtf headers (much cleaner).
Comment 17 WebKit Review Bot 2011-12-22 14:41:23 PST
Attachment 120373 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/ThirdParty/ChangeLog', u'Source/Thi..." exit_code: 1

Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h:181:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Dmitry Lomov 2011-12-22 15:32:12 PST
Comment on attachment 120373 [details]
Patch v5

The patch looks good to me, other than style issue.
I confirmed it builds and runs on Windows.
Comment 19 David Kilzer (:ddkilzer) 2011-12-22 15:50:50 PST
(In reply to comment #17)
> Attachment 120373 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/ThirdParty/ChangeLog', u'Source/Thi..." exit_code: 1
> 
> Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h:181:  Alphabetical sorting problem.  [build/include_order] [4]
> Total errors found: 1 in 6 files

1. gtest-port.h is ThirdParty source.  I don't think we apply webkit style rules to third-party source, do we?  (Running check-webkit-style with no arguments shows gtest-port.h has 420 style violations.)

2. It's complaining that <wtf/Platform.h> appears before <wtf/ExportMacros.h>, but <wtf/Platform.h> must appear first in that list.

I think this style warning is a non-issue for this patch.
Comment 20 Dmitry Lomov 2011-12-22 15:54:25 PST
(In reply to comment #19)
> (In reply to comment #17)
> > Attachment 120373 [details] [details] did not pass style-queue:
> > 
> > Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/ThirdParty/ChangeLog', u'Source/Thi..." exit_code: 1
> > 
> > Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h:181:  Alphabetical sorting problem.  [build/include_order] [4]
> > Total errors found: 1 in 6 files
> 
> 1. gtest-port.h is ThirdParty source.  I don't think we apply webkit style rules to third-party source, do we?  (Running check-webkit-style with no arguments shows gtest-port.h has 420 style violations.)
> 
> 2. It's complaining that <wtf/Platform.h> appears before <wtf/ExportMacros.h>, but <wtf/Platform.h> must appear first in that list.
> 
> I think this style warning is a non-issue for this patch.

Yes - ok looked though this - I think it is ok too.
Comment 21 David Kilzer (:ddkilzer) 2011-12-22 16:41:56 PST
Comment on attachment 120373 [details]
Patch v5

Clearing the review flag.

The way that the WebCore headers are referenced will cause Apple internal builds to fail because WebCore.framework won't be at $(BUILT_PRODUCTS_DIR).  We need to add a Production target to gtest to make it work, then redefine the variable where the WebCore headers are searched for in that configuration.

I will do this for the next patch.
Comment 22 David Kilzer (:ddkilzer) 2011-12-22 16:47:02 PST
(In reply to comment #21)
> (From update of attachment 120373 [details])
> Clearing the review flag.
> 
> The way that the WebCore headers are referenced will cause Apple internal builds to fail because WebCore.framework won't be at $(BUILT_PRODUCTS_DIR).  We need to add a Production target to gtest to make it work, then redefine the variable where the WebCore headers are searched for in that configuration.
> 
> I will do this for the next patch.

Actually, I should add the Production configuration in a separate patch first.  See Bug 75153.
Comment 23 David Kilzer (:ddkilzer) 2012-01-04 15:04:49 PST
Created attachment 121167 [details]
Patch v6
Comment 24 WebKit Review Bot 2012-01-04 15:18:36 PST
Attachment 121167 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/ThirdParty/ChangeLog', u'Source/Thi..." exit_code: 1

Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h:181:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 25 David Kilzer (:ddkilzer) 2012-01-04 15:41:15 PST
(In reply to comment #24)
> Attachment 121167 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/ThirdParty/ChangeLog', u'Source/Thi..." exit_code: 1
> 
> Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h:181:  Alphabetical sorting problem.  [build/include_order] [4]
> Total errors found: 1 in 9 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

See Comment #17, Comment #19, Comment #20.  The headers must be in this order.
Comment 26 David Kilzer (:ddkilzer) 2012-01-04 15:44:06 PST
(In reply to comment #23)
> Created an attachment (id=121167) [details]
> Patch v6

Changes since v5:
- Defined HEADER_SEARCH_PATHS in terms of WEBCORE_PRIVATE_HEADERS_DIR.
- Added WEBCORE_PRIVATE_HEADERS_DIR variable to [Debug|Release|Production]Project.xcconfig so that the correct path would be used on Production builds.

I verified that Release (-) versus Production (+) builds set the correct HEADER_SEARCH_PATHS and WEBCORE_PRIVATE_HEADERS_DIR paths:

-    setenv HEADER_SEARCH_PATHS "/Volumes/Data/Build/Release/WebCore.framework/PrivateHeaders/ForwardingHeaders ../ ../include/"
+    setenv HEADER_SEARCH_PATHS "/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/PrivateHeaders/ForwardingHeaders ../ ../include/"

-    setenv WEBCORE_PRIVATE_HEADERS_DIR /Volumes/Data/Build/Release/WebCore.framework/PrivateHeaders
+    setenv WEBCORE_PRIVATE_HEADERS_DIR /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/PrivateHeaders
Comment 27 David Kilzer (:ddkilzer) 2012-01-04 16:17:06 PST
Committed r104091: <http://trac.webkit.org/changeset/104091>
Comment 28 Dmitry Lomov 2012-01-04 16:17:51 PST
(In reply to comment #27)
> Committed r104091: <http://trac.webkit.org/changeset/104091>

Horray!
Comment 29 David Kilzer (:ddkilzer) 2012-01-04 23:13:19 PST
(In reply to comment #27)
> Committed r104091: <http://trac.webkit.org/changeset/104091>

Follow-up build fix for internal Safari builds:

Committed r104118: <http://trac.webkit.org/changeset/104118>
Comment 30 David Kilzer (:ddkilzer) 2012-01-12 08:43:16 PST
*** Bug 74127 has been marked as a duplicate of this bug. ***