Bug 104136

Summary: WebKit2.def seems not regenerated when WebKit2.def.in is changed
Product: WebKit Reporter: Xianzhu Wang <wangxianzhu>
Component: WebKit2Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, roger_fong, thorton, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Xianzhu Wang
Reported 2012-12-05 10:18:01 PST
My patch in bug 102543 added a method called from Internals to WebCore. I added the symbol in WebKit2.def.in but the build still reported unresolved external of the symbol on ews-win. So I guessed that WebKit2.def is not regenerated from changed WebKit2.def.in. To prove that, I created a experimental patch https://bugs.webkit.org/attachment.cgi?id=177603 in which I removed some other symbols like Page::scrollingTreeStateAstext() etc. to see if ews-win would report unresolved externals for these symbols. ews-win still only reported one unresolved external of my added symbol (http://queues.webkit.org/results/15147552). So it seems to me that WebKit2.def is not regenerated. I also can't find anything about WebKit2ExportGenerator or "Generating export definitions" in the log. Please verify if it is a bug, or I did sth wrong adding the symbol. Thanks.
Attachments
Patch (16.71 KB, patch)
2012-12-05 14:51 PST, Brent Fulgham
no flags
Patch (16.19 KB, patch)
2012-12-05 14:53 PST, Brent Fulgham
no flags
Roger Fong
Comment 1 2012-12-05 10:39:44 PST
I think this could be related to that caching issue where VS likes to keep its old version of the export definitions somewhere. A clean rebuild will always properly sync up the new export file but it seems an incremental build will not.
Brent Fulgham
Comment 2 2012-12-05 10:52:27 PST
This is happening because the WebKit2ExportGenerator does not automatically rebuild itself when the WebKit2.def.in file changes. I'm working on a change to correct that oversight. As Roger points out, clearing the build directory will resolve the problem because that forces the generator to be rebuild, at which point it will reflect the new definitions.
Brent Fulgham
Comment 3 2012-12-05 14:50:57 PST
Sorry this took so long, I was a little swamped today.
Brent Fulgham
Comment 4 2012-12-05 14:51:11 PST
Brent Fulgham
Comment 5 2012-12-05 14:53:31 PST
Tim Horton
Comment 6 2012-12-05 16:16:24 PST
Comment on attachment 177835 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=177835&action=review > Source/WebKit2/win/WebKit2ExportGenerator.vcproj:396 > + CommandLine="REM Do not edit from the Visual Studio IDE! Customize via a $(ProjectName)BuildCmd.cmd file.&#x0D;&#x0A;if not exist &quot;$(ProjectDir)$(ProjectName)BuildCmd.cmd&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;set CONFIGURATIONBUILDDIR=$(ConfigurationBuildDir)&#x0D;&#x0A;set CONFIGURATIONNAME=$(ConfigurationName)&#x0D;&#x0A;set INPUTDIR=$(InputDir)&#x0D;&#x0A;set INPUTFILENAME=$(InputFileName)&#x0D;&#x0A;set INPUTPATH=$(InputPath)&#x0D;&#x0A;set INTDIR=$(IntDir)&#x0D;&#x0A;set LIBRARYCONFIGSUFFIX=$(LibraryConfigSuffix)&#x0D;&#x0A;set OUTDIR=$(OutDir)&#x0D;&#x0A;set PLATFORMNAME=$(PlatformName)&#x0D;&#x0A;set PROJECTDIR=$(ProjectDir)&#x0D;&#x0A;set PROJECTFILENAME=$(ProjectFileName)&#x0D;&#x0A;set PROJECTNAME=$(ProjectName)&#x0D;&#x0A;set PROJECTPATH=$(ProjectPath)&#x0D;&#x0A;set SOLUTIONDIR=$(SolutionDir)&#x0D;&#x0A;set SOLUTIONFILENAME=$(SolutionFileName)&#x0D;&#x0A;set SOLUTIONNAME=$(SolutionName)&#x0D;&#x0A;set SOLUTIONPATH=$(SolutionPath)&#x0D;&#x0A;set TARGETDIR=$(TargetDir)&#x0D;&#x0A;set TARGETEXT=$(TargetExt)&#x0D;&#x0A;set TARGETFILENAME=$(TargetFileName)&#x0D;&#x0A;set TARGETPATH=$(TargetPath)&#x0D;&#x0A;set WEBKITCONFIGSUFFIX=$(WebKitConfigSuffix)&#x0D;&#x0A;set WEBKITDLLCONFIGSUFFIX=$(WebKitDLLConfigSuffix)&#x0D;&#x0A;&#x0D;&#x0A;REM If any of the above variables didn&apos;t exist previously and&#x0D;&#x0A;REM were set to an empty string, set will set the errorlevel to 1,&#x0D;&#x0A;REM which will cause the project-specific script to think the build&#x0D;&#x0A;REM has failed. This cmd /c call will clear the errorlevel.&#x0D;&#x0A;cmd /c&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(ProjectDir)$(ProjectName)BuildCmd.cmd&quot;&#x0D;&#x0A;" What's going on here?
Roger Fong
Comment 7 2012-12-05 17:27:35 PST
Trying to understand the patch. Where's the part where you add WebKit2.def.in into the sources in the WebkitExportGenerator vcproj file?
Brent Fulgham
Comment 8 2012-12-05 19:37:34 PST
Comment on attachment 177835 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=177835&action=review >> Source/WebKit2/win/WebKit2ExportGenerator.vcproj:396 >> + CommandLine="REM Do not edit from the Visual Studio IDE! Customize via a $(ProjectName)BuildCmd.cmd file.&#x0D;&#x0A;if not exist &quot;$(ProjectDir)$(ProjectName)BuildCmd.cmd&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;set CONFIGURATIONBUILDDIR=$(ConfigurationBuildDir)&#x0D;&#x0A;set CONFIGURATIONNAME=$(ConfigurationName)&#x0D;&#x0A;set INPUTDIR=$(InputDir)&#x0D;&#x0A;set INPUTFILENAME=$(InputFileName)&#x0D;&#x0A;set INPUTPATH=$(InputPath)&#x0D;&#x0A;set INTDIR=$(IntDir)&#x0D;&#x0A;set LIBRARYCONFIGSUFFIX=$(LibraryConfigSuffix)&#x0D;&#x0A;set OUTDIR=$(OutDir)&#x0D;&#x0A;set PLATFORMNAME=$(PlatformName)&#x0D;&#x0A;set PROJECTDIR=$(ProjectDir)&#x0D;&#x0A;set PROJECTFILENAME=$(ProjectFileName)&#x0D;&#x0A;set PROJECTNAME=$(ProjectName)&#x0D;&#x0A;set PROJECTPATH=$(ProjectPath)&#x0D;&#x0A;set SOLUTIONDIR=$(SolutionDir)&#x0D;&#x0A;set SOLUTIONFILENAME=$(SolutionFileName)&#x0D;&#x0A;set SOLUTIONNAME=$(SolutionName)&#x0D;&#x0A;set SOLUTIONPATH=$(SolutionPath)&#x0D;&#x0A;set TARGETDIR=$(TargetDir)&#x0D;&#x0A;set TARGETEXT=$(TargetExt)&#x0D;&#x0A;set TARGETFILENAME=$(TargetFileName)&#x0D;&#x0A;set TARGETPATH=$(TargetPath)&#x0D;&#x0A;set WEBKITCONFIGSUFFIX=$(WebKitConfigSuffix)&#x0D;&#x0A;set WEBKITDLLCONFIGSUFFIX=$(WebKitDLLConfigSuffix)&#x0D;&#x0A;&#x0D;&#x0A;REM If any of the above variables didn&apos;t exist previously and&#x0D;&#x0A;REM were set to an empty string, set will set the errorlevel to 1,&#x0D;&#x0A;REM which will cause the project-specific script to think the build&#x0D;&#x0A;REM has failed. This cmd /c call will clear the errorlevel.&#x0D;&#x0A;cmd /c&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(ProjectDir)$(ProjectName)BuildCmd.cmd&quot;&#x0D;&#x0A;" > > What's going on here? That's the same block of code we use for the Pre/Pre-link/Post-build steps. It sets up various environment variables before calling an external shell script. Here, I'm changing the WebKit2.def.in file from being excluded from the build to having a build rule that regenerates the WebKit2ExportGenerator.cpp file.
Brent Fulgham
Comment 9 2012-12-05 19:44:04 PST
(In reply to comment #7) > Trying to understand the patch. > Where's the part where you add WebKit2.def.in into the sources in the WebkitExportGenerator vcproj file? It's that big block of junk that looks like a hex-encoded binary (see Tim's review question). Previously, the WebKit2.def.in file was marked as "excluded from build", since the pre-build step was responsible for generating the source file. As Xianzhu pointed out, however, this prevented Visual Studio from recognizing changes to the WebKit2.def.in file from triggering a rebuild of the generator (and therefore the output to the definition file).
WebKit Review Bot
Comment 10 2012-12-05 19:45:03 PST
Comment on attachment 177835 [details] Patch Clearing flags on attachment: 177835 Committed r136792: <http://trac.webkit.org/changeset/136792>
WebKit Review Bot
Comment 11 2012-12-05 19:45:06 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.