<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>the Void</title> <link>http://blog.ashodnakashian.com</link> <description>Thoughts of an Earthling</description> <lastBuildDate>Mon, 16 Apr 2012 14:07:50 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ashodnakashian/zpMw" /><feedburner:info uri="ashodnakashian/zpmw" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ashodnakashian/zpMw</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Building WebKit on Windows 7 with VS2010</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/1osrgXtjWA0/</link> <comments>http://blog.ashodnakashian.com/2012/01/building-webkit-on-windows-7-with-vs2010/#comments</comments> <pubDate>Sun, 29 Jan 2012 11:20:46 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Guides]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Build]]></category> <category><![CDATA[SDK]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[WebKit]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1801</guid> <description><![CDATA[In a previous post I outlined a detailed description of how to build WebKit on Windows XP. My aim was to share with everyone the long and rather tricky process of building the beast that WebKit is. There are many pitfalls, gotchas and critical requirements to get from code to binary to execution. I also did <a
href='http://blog.ashodnakashian.com/2012/01/building-webkit-on-windows-7-with-vs2010/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>In a <a
href="http://blog.ashodnakashian.com/2011/09/building-webkit-on-windows/">previous post</a> I outlined a detailed description of how to build WebKit on Windows XP. My aim was to share with everyone the long and rather tricky process of building the beast that WebKit is. There are many pitfalls, gotchas and critical requirements to get from code to binary to execution. I also did away with the standard and default requirement of VS2005 and opted to go with the newer and less-buggy VS2008. Besides the improvements in this newer version, there was only 1 update to install (SP1) as opposed to the 5 or so that VS2005 required (in addition to QuickTime SDK, Windows 2003 SDK and DirectX SDK), it had a better compiler and, in my experience, caused much less problems (consider for example that newer DirectX SDK doesn&#8217;t support VS2005) to build WebKit than VS2005 did.</p><p><a
href="http://www.webkit.org/"><img
class="alignright size-full wp-image-1605" title="WebKit Logo" src="http://blog.ashodnakashian.com/wp-content/uploads/2011/09/webkit-logo.png" alt="" width="211" height="168" /></a></p><p>But that was VS2008 and Windows XP. Now, we&#8217;ll attempt to build WebKit with VS2010 and on Windows 7. This adds two groups of issues to the mix: One on the compiler/environment level and the other on the OS level. Regarding the issues that Windows 7 brings to the table, see the previous post and <a
href="http://www.webkit.org/building/tools.html">here</a>. As before, I&#8217;ll build only WinCairo, but you should be well-advised to try the default &#8211; CoreGraphics.</p><p><strong>Note: While this walk-through should be complete, obviously there are many concepts specific to WebKit and/or the tools, these I won&#8217;t repeat here. You don&#8217;t need to read the previous post, but if you find some reference that isn&#8217;t clear, search for the keyword in question in the previous post. If that doesn&#8217;t help, don&#8217;t shy from asking in the comments; I&#8217;ll get back to you.</strong></p><h2>Summary (TL;DR)</h2><p>This is a detailed walk-through of getting WebKit built on Windows 7 with VS2010. For the bottom-line and an automated patch just skip the details and <a
href="#one-command-build">jump here</a>. There is a very easy, virtually flawless, two-step, five-click procedure to get from code to binary.</p><h2>Motivation</h2><p>This project took my spare time during a whole week and almost two weekends. That&#8217;s an estimated 20 hours. So why do it? VS2005, which is the officially supported version, is outdated, has a painfully large number of updates and the end-user must install all its updated/patched runtime libraries and is notorious in losing/reseting the Include and Library paths. On top of that, it&#8217;s not supported on Windows 7. Since I upgraded my workstation to Win7 I couldn&#8217;t and didn&#8217;t want to install VS2005 (nor VS2008 for that matter). I could either build WebKit in a VM on WinXP (actually my old system is now turned into a cosy VM, so I could use that,) but then WebKit is too huge for a VM. The adventure of attempting a build on VS2010 was intimidating enough, considering that a single unsupported/incompatible issue could mushroom into 100s of thousands of errors that might actually require a sizable code change, which would be far more than what I bid for. To top it, I knew that Windows 7 had its own set of issues related to UAC and Cygwin&#8217;s Fork implementation, which conflicted with Windows&#8217; randomized image mapping and other security features.</p><p>Ultimately, I wanted a clean build with the latest tools on the latest Windows incarnation. WebKit.org might not be tempted to force its development team to shell out for VS2010 or Windows 7, not to mention spend all that time to upgrade both their machines and code, but, eventually, they will. So, here it is. A complete walkthrough documenting every step of the way, from code download to environment setup to successful build. In addition, all changes to fix errors are automated with just two scripts&#8230; read on.</p><h2>Environment</h2><p>WebKit has a lot of dependencies and requirements. So first we need to setup everything that is expected by the code before we even try to build.</p><h3>Getting the Code</h3><p>As with the tip from the previous post, I avoided the Trunk and used the prepackaged sources of <a
href="http://builds.nightly.webkit.org/files/trunk/src/WebKit-r106194.tar.bz2">r106194</a> (but relatively <a
href="http://nightly.webkit.org/">recent packages</a> should also work). While the trunk may often be broken, the nightly build isn&#8217;t guaranteed to build. To increase your odds, pick a revision of the sources that has a Mac or Windows nightly build as well. From the 7 nightly builds I picked (r105569-r106194) 2 were broken. A considerable time is wasted figuring out whether or not the errors are our fault or the source code&#8217;s.</p><h3>Cygwin</h3><p>The first hurdle was to setup Cygwin. Get the download instructions from the <a
href="http://blog.ashodnakashian.com/2011/09/building-webkit-on-windows/">previous post</a>. (Read and use the Cygwin downloader from <a
href="http://www.webkit.org/building/tools.html">here</a> is the gist of it.) Since WebKit expects the sources to be within the user&#8217;s home directory of Cygwin, I decided to avoid placing the 100s of thousands of files and the gigabytes that a single source working-copy is within Cygwin. Instead, I can have WebKit sources anywhere and Cygwin elsewhere and get them both together using <a
href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365680(v=vs.85).aspx">symbolic links</a>.</p><p>My Cygwin installation is in my Tools folder, which hosts a rather large number of portable programs and scripts, including MinGW. Tools is in the root of my system drive. To make things easy for me, I&#8217;d like to have Cygwin in the system drive as well (it&#8217;s a fast drive). So the first thing is to setup symbolic links where from the original folders to where we&#8217;d like to see our environment setup. This is done using the <code>mklink</code> command, but before executing it we delete any directories in that path, so make sure your target path is safe!</p><h3>Visual Studio 2010</h3><p>With VS2005 and VS2008 the Express editions worked fine. Since I don&#8217;t have VS2010 Express, I can&#8217;t vouch the same guarantee. Regardless, it&#8217;s probably reasonable to expect it to work. At any rate, we need to install a functional version. We also need to install SP1 and Windows SDK. Microsoft deserves some scolding for releasing Windows SDK that reverts Visual Studio updates for yet another time. So, to avoid stepping on your own feet, <a
href="http://blogs.msdn.com/b/heaths/archive/2011/04/01/visual-c-2010-sp1-compiler-update-for-the-windows-sdk-7-1.aspx">here is how you need to proceed with the VS2010 and WinSDK installations</a>:</p><ol><li>Visual Studio 2010.</li><li><a
href="http://www.microsoft.com/download/en/details.aspx?id=8442">Windows SDK 7.1</a>.</li><li><a
href="http://www.microsoft.com/download/en/details.aspx?id=23691">Visual Studio 2010 SP1</a>.</li><li><a
href="http://go.microsoft.com/fwlink/?LinkID=212355">Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1</a>.</li></ol><p>Interestingly, I didn&#8217;t change the toolchain from VC100 to Windows SDK 7.1. I also didn&#8217;t install QuickTime or DirectX SDKs. It seems that the Windows and DirectX headers that come with VS2010 were enough that I didn&#8217;t have to go through any settings as I had to with VS2005. However, QuickTime&#8217;s missing SDK, while didn&#8217;t break the build, might mean that there wouldn&#8217;t be full media support in the resulting build. Actually, I suspect QuickTime SDK is needed for the CoreGraphics build. Nevertheless, that&#8217;s a minor issue that can be remedied later.</p><h3>Environment Variables</h3><p>Next we need to setup the <code>WEBKITLIBRARIESDIR</code> and <code>WEBKITOUTPUTDIR</code> environment variables, add scripts folder on the path and setup VS2010. WebKit build scripts expect <code>VSINSTALLDIR</code> environment variable, which, it seems, VS2010 installation isn&#8217;t creating. I found only <code>VS100COMNTOOLS</code> on my system, so I added a make-shift <code>VSINSTALLDIR</code> to my build environment setup script. Once that is done, we need to ask VS to setup its own environment variables and fire-up Cygwin.</p><p>I want to automate as much as possible, including the ability to run the same boiler-plate setup script for any revision of WebKit. The script is designed to be thrown into the source code folder of WebKit and run as administrator. The only missing thing is your Cygwin installation folder. But don&#8217;t worry, if you don&#8217;t provide this folder (or is invalid,) of you don&#8217;t run as admin, the script will warn you and stop.</p><p>Here is the cmd script I use to do the magic of setting up the build environment:</p><p><strong>vs2010-build-env.cmd</strong>:</p><pre class="brush:plain">@rem Setup the Cygwin environment to build WebKit.
@rem Copyright 2012 Ashod Nakashian
@rem Your are free to use this however you see fit,
@rem provided you give credit where credit is due.

@rem Comment to debug and see what is being set exactly.
@echo off
@echo.

echo Setting up Cygwin directory...
@rem Change CYGWIN_SOURCE_DIR to where Cygwin is installed.
set CYGWIN_SOURCE_DIR=C:\Tools\cygwin
set CYGWIN_DIR=C:\Cygwin
if not exist "%CYGWIN_SOURCE_DIR%" (@echo Error: Please specify the correct Cygwin installation folder in '%0' @ CYGWIN_SOURCE_DIR.
goto exit)
if exist "%CYGWIN_DIR%" rmdir "%CYGWIN_DIR%"
mklink /D "%CYGWIN_DIR%" "%CYGWIN_SOURCE_DIR%"
if not %ERRORLEVEL%==0 (@echo Error: Please run this script as administrator.
goto exit)

echo Setting up WebKit directory...
set WEBKIT_SOURCE_DIR=%~dp0%
set CURRENT_DIR=%WEBKIT_SOURCE_DIR%
if "%CURRENT_DIR:~-1%"=="\" set CURRENT_DIR=%CURRENT_DIR:~0,-1%
for /R "delims=\" %%a in (%CURRENT_DIR%) do set WEBKIT_DIR_NAME=%%~nxa
set WEBKIT_DIR=%CYGWIN_DIR%\home\%username%\%WEBKIT_DIR_NAME%
if exist "%WEBKIT_DIR%" rmdir "%WEBKIT_DIR%"
mklink /D "%WEBKIT_DIR%" "%WEBKIT_SOURCE_DIR%"

echo Exporting environment varibles...
set WEBKITOUTPUTDIR=%WEBKIT_DIR%\WebKitBuild
set WEBKITLIBRARIESDIR=%WEBKIT_DIR%\WebKitLibraries\win
set VSINSTALLDIR=%VS100COMNTOOLS%..\..
set PATH=%WEBKIT_DIR%\Tools\Scripts;%PATH%
set PATH=%CYGWIN_DIR%\bin;%PATH%

@rem Uncomment if you want to execute VC tools from the shell.
@rem call "%VSINSTALLDIR%\VC\vcvarsall.bat" x86

echo Note: Remember to set devenv.exe to run as administrator!

echo Running Cygwin...
call "%CYGWIN_DIR%\Cygwin.bat"

:exit</pre><p>This should be straight forward. All we do is setup the Cygwin and source-code folders and the environment variables. Take your time to read it and don&#8217;t forget to set your Cygwin installation folder to CYGWIN_SOURCE_DIR.</p><h2>Building</h2><p>First, <a
href="http://nightly.webkit.org/">download the source code</a> and extract it in any folder you like. Next, place this script in the extracted folder. What you need to edit are: CYGWIN_SOURCE_DIR to point to your cygwin folder. The other settings should be automatically set. <strong>Note: You must run this script as Administrator!</strong></p><p>Here is a sample of the output you should expect:</p><pre class="brush:plain">Setting up Cygwin directory...
symbolic link created for C:\Cygwin &lt;&gt; C:\Tools\cygwin
Setting up WebKit directory...
symbolic link created for C:\Cygwin\home\Ash\WebKit-r105582 &lt;&gt; C:\prj\WebKit\WebKit\WebKit-r105582\
Exporting environment varibles...
Running Cygwin...

Ash@Bull ~
#</pre><p>If you get the prompt as I did above, then you&#8217;re good to go. But before we try to build, we need to let the build scripts know about VS2010, which isn&#8217;t really supported. Go to <code>Tools\Scripts</code> within the source folder and open the <code>pdevenv</code> file for editing. On the 18th line you should add a case for <code>VS100COMNTOOLS</code> and make it the first, next <code>VS90COMNTOOLS</code> followed by <code>VS80COMNTOOLS</code>. This way VS2010 will be preferred, followed by VS2008 then by 2005 if neither is found. Here is how lines 17-31 should look:</p><pre class="brush:perl">my $vsToolsVar;
if ($ENV{'VS100COMNTOOLS'}) {
    $vsToolsVar = "VS100COMNTOOLS";
} elsif ($ENV{'VS90COMNTOOLS'}) {
    $vsToolsVar = "VS90COMNTOOLS";
} elsif ($ENV{'VS80COMNTOOLS'}) {
    $vsToolsVar = "VS80COMNTOOLS";
} else {
    print "*************************************************************\n";
    print "Cannot find Visual Studio tools dir.\n";
    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
    print "is set to a valid location.\n";
    print "*************************************************************\n";
    die;
}</pre><p>Let&#8217;s do an initial run of the build script so it&#8217;d download the WinCairo files and install them (no change is done outside the WebKit source folder).</p><p>Here is an initial run&#8230;</p><pre class="brush:plain"># build-webkit --wincairo
Checking Last-Modified date of WinCairoRequirements.zip...
Downloading WinCairoRequirements.zip...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   320k      0  0:00:44  0:00:44 --:--:--  480k

Installing WinCairoRequirements...
The WinCairoRequirements has been sucessfully installed in
 /cygdrive/c/Cygwin/home/Ash/WebKit-r105582/WebKitLibraries/win
Building results into: /cygdrive/c/Cygwin/home/Ash/WebKit-r105582/WebKitBuild
WEBKITOUTPUTDIR is set to: C:\prj\WebKit\WebKit\WebKit-r105582\WebKitBuild
WEBKITLIBRARIESDIR is set to: C:\Cygwin\home\Ash\WebKit-r105582\WebKitLibraries\win
/cygdrive/c/Cygwin/home/Ash/WebKit-r105582/Tools/Scripts/pdevenv win\WebKit.vcproj\WebKit.sln /build Release_Cairo_CFLite
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.

Solution file 'C:\prj\WebKit\WebKit\WebKit-r105582\Source\WebKit\win\WebKit.vcproj\WebKit.sln' is from a previous version of this application and must be converted in order to build in this version of the application. To convert the solution, open the solution in this version of the application.

===== BUILD FAILED ======

Please ensure you have run ../../../../Cygwin/home/Ash/WebKit-r105582/Tools/Scripts/update-webkit to install dependencies.

You can view build errors by checking the BuildLog.htm files located at:
/cygdrive/c/Cygwin/home/Ash/WebKit-r105582/WebKitBuild/obj//.

Ash@Bull ~
#</pre><p>Great! So far so good. We downloaded and installed WinCairoRequirements (to redownload, just delete <code>WebKitLibraries\win\WinCairoRequirements.headers</code>) and we got VS2010 to run and try to load (and complain of) the solution file. Let&#8217;s upgrade it.</p><p>Open the solution file located at <code>Source\WebKit\win\WebKit.vcproj\WebKit.sln</code> in VS2010. (The easiest way to run VS2010 is to simply run <code>pdevenv</code> from the shell.) You&#8217;ll be prompted to convert the solution and all 40 projects. Now we should save the solution and close VS. (Alternatively you can use the <a
href="http://msdn.microsoft.com/en-us/library/w15a82ay.aspx">/upgrade command</a>.) Let&#8217;s go back and try to build again. Run <code>build-webkit --wincairo</code> from the shell. You should see the projects getting built and fail with more errors than you can count. Let&#8217;s Fix the errors.</p><h3>Windows 7 UAC</h3><p>Here is a generic error that&#8217;s omnipresent:</p><pre class="brush:plain">Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1&gt;------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(153,5): error MSB6006: "CL.exe" exited with code -1073741819.</pre><p>The above error actually means &#8220;CL.exe&#8221; failed to execute. It&#8217;s a general failure. The culprit here is UAC of Windows 7. To fix this issue, navigate to the <code>VSINSTALLDIR</code> folder, in Common7\IDE\ there should be devenv.exe (<em>not devenv.com</em>). Select the file, open properties then Compatibility tab. At the bottom under &#8220;Privilege Level&#8221; check &#8220;Run this program as an administrator&#8221;. Now VS2010 should run with full privileges and executing CL.exe (the C++ compiler) should work.</p><h3></h3><pre class="brush:plain">Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1&gt;------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
1&gt;EXEC : cygwin warning :
2&gt;------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;LINK : fatal error LNK1181: cannot open input file 'C:\Cygwin\home\Ash\WebKit-r105582\WebKitBuild\Release_Cairo_CFLite\obj\WTF\MainThreadWin.obj'</pre><p>This time the Linker is complaining of not finding an OBJ file. Here we notice a couple of things. First, since CL no longer complains, it&#8217;s safe to assume our UAC fix worked and CL ran. Second, and more importantly, we see no CPP file compilation output before the linker error. Checking the output folder clearly shows no OBJ files. May be the output folder is different, so we need to see more details. Changing the log-level from Visual Studio (Tools &gt; Options &gt; Projects and Solutions &gt; Build and Run. Change &#8220;MSBuild project build output verbosity&#8221; from &#8220;Quiet&#8221; to &#8220;Detailed&#8221; or higher) shows that CL is not compiling anything at all! After some investigation, it turns out the culprit is the <code>parallelcl</code> script (in Tools/Scripts). This middleware gets called from Tools/vcbin/cl.exe, which is what is actually called by VS2010 since it&#8217;s found first on the path. The purpose of this script is to parallelize the build by executing multiple concurrent instances of the compiler.</p><p>The older Visual Studio versions used to dump all command-line parameters passed to CL in a <a
href="http://msdn.microsoft.com/en-us/library/3te4xt0y(v=vs.80).aspx">compiler response file</a>. VS2010 isn&#8217;t using response files and is passing the params in the classical way. This behavior may be specific to Windows 7 as its shell supports a larger command-line param buffer than previous versions, but I haven&#8217;t checked either way. Bottom line is that <code>parallelcl</code> needs to accomodate this fact because as-is it&#8217;s simply failing to pass anything to CL, which is why nothing is actually getting compiled.</p><p>We can of course bypass this script altogether. Unfortunately, this will cost us much in terms of build time (which is significant to start with) because VS2010 (and 2008 as well) support only project-level parallelization, which isn&#8217;t much help for WebKit. The fix is to directly call the real CL. We may later try to do a better fix and support compiler-level parallelization, which is what this script was actually doing. To disable this custom script all we have to do is simply rename the CL.exe in Tools\vcbin\cl.exe.</p><pre>mv Tools/vcbin/cl.exe Tools/vcbin/cl-.exe</pre><h3>Warnings (as Error)</h3><p>Building again we see source files getting compiled. This time the errors come from the warnings. We resolved this issue by removing the &#8220;warnings as errors&#8221; options. <del
datetime="2012-01-21T22:52:08+00:00">Fire up VS2010 (which can be done by running <code>pdevenv</code> from the shell) then load the WebKit solution. Select every C++ solution (either one at a time, or all together) and open their properties. From the <code>C/C++ &gt; General</code> node, change &#8220;Treat Warnings As Errors&#8221; to &#8220;No (/WX-)&#8221;. You probably want to do this for &#8220;All Configurations&#8221;. Save the solution and lets build again from the shell.</del> To change settings, we&#8217;ll use <a
href="http://msdn.microsoft.com/en-us/library/a4xbdz1e.aspx">property sheets</a> (quick into <a
href="http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/862b20c7-f732-4929-a84e-7577451e5a30">here</a> and <a
href="http://blog.gockelhut.com/2009/11/visual-studio-2010-property-sheets-and.html">here</a>, more details <a
href="http://blogs.msdn.com/b/visualstudio/archive/2010/05/14/a-guide-to-vcxproj-and-props-file-structure.aspx">here</a>) which not only is the correct way to share common settings between large number of projects and configurations, but also WebKit heavily utilizes anyway.</p><p>Output showing &#8220;warning as error&#8221; and some superfluous warnings:</p><pre class="brush:plain">Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1&gt;------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;c:\prj\webkit\webkit\webkit-r105582\source\javascriptcore\wtf\PassRefPtr.h(86): error C2220: warning treated as error - no 'object' file generated
2&gt;c:\prj\webkit\webkit\webkit-r105582\source\javascriptcore\wtf\PassRefPtr.h(86): warning C4396: 'WTF::adoptRef' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
2&gt;C:\prj\WebKit\WebKit\WebKit-r105582\Source\JavaScriptCore\wtf/HashSet.h(96): warning C4396: 'WTF::deleteAllValues' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template</pre><p>The property sheet file format was changed in VS2010. As with the C++ project file names, which changed from <code>vcproj</code> to <code>vcxproj</code>, the property sheet file names have also changed from <code>vsprops</code> to <code>props</code>. The reason for this is because <a
href="http://msdn.microsoft.com/en-us/library/ee862524.aspx">now C++ projects are now built using MSBuild and not VCBuild</a>. Old <code>vcproj</code> files, for example, contained file filters (which defined the folder structure shown in Visual Studio) as well as build instructions. New <code>vcxproj</code> files now contain only build instructions and filters are now in <code>vcxproj.filters</code>. Since property sheets contain compiler switches and flags, the format must also comform to the MSBuild format. The same is true for <code>vcxproj</code> files.</p><p>To disable &#8220;warnings as errors&#8221; open <code>WebKitLibraries\win\tools\vsprops\common.props</code> and change the code <code>TreatWarningAsError</code> from <code>true</code> to <code>false</code>. We also see a lot of <a
href="http://msdn.microsoft.com/en-us/library/bb384968(v=vs.90).aspx">compiler warning C4396</a> and <a
href="http://blogs.msdn.com/b/vcblog/archive/2009/07/21/linker-warning-lnk4221-and-some-tips-to-avoid-it.aspx">linker warning LNK4221</a>, so let&#8217;s disable them as well.</p><p>Lines 13-23 of common.props:</p><pre class="brush:xml">&lt;ClCompile&gt;
&lt;AdditionalOptions&gt;/bigobj /GS %(AdditionalOptions)&lt;/AdditionalOptions&gt;
&lt;PreprocessorDefinitions&gt;WIN32;_WINDOWS;WINVER=0x502;_WIN32_WINNT=0x502;_WIN32_IE=0x603;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_HAS_EXCEPTIONS=0;BUILDING_$(ProjectName);%(PreprocessorDefinitions)&lt;/PreprocessorDefinitions&gt;
&lt;ExceptionHandling&gt;
&lt;/ExceptionHandling&gt;
&lt;RuntimeTypeInfo&gt;false&lt;/RuntimeTypeInfo&gt;
&lt;WarningLevel&gt;Level4&lt;/WarningLevel&gt;
&lt;TreatWarningAsError&gt;false&lt;/TreatWarningAsError&gt;
&lt;DebugInformationFormat&gt;ProgramDatabase&lt;/DebugInformationFormat&gt;
&lt;DisableSpecificWarnings&gt;4396;4018;4068;4099;4100;4127;4138;4180;4189;4201;4244;4251;4275;4288;4291;4305;4344;4355;4389;4481;4503;4505;4510;4512;4610;4706;4800;4951;4952;4996;6011;6031;6211;6246;6255;6387;%(DisableSpecificWarnings)&lt;/DisableSpecificWarnings&gt;
&lt;/ClCompile&gt;</pre><h3>Fixing Errors</h3><h4>nullptr</h4><p>VS2010&#8242;s C++ compiler supports the new nullptr keyword. This was previously simulated in WTF\NullPtr.cpp/h as class std::nullptr_t; which isn&#8217;t simulated for VS2010 and newer (WTF\Compiler.h disables nullptr simulation for _MSC_VER &gt;= 1600). Unfortunately, the simulated class, unlike a native one, needs to be exported so that it may be consumed by other projects. JavaScriptCore exports it, and since it&#8217;s not simulated, it can&#8217;t be found. From Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def we need to remove &#8220;?nullptr@@3Vnullptr_t@std@@A&#8221;.</p><h4>MIDL</h4><p>Like CL, there is a MIDL wrapper in Tools/vcbin. The purpose of this wrapper is to wrap command-line parameters in double-quotes. What it does wrong is that it, like the CL wrapper, assumes that the only parameter is a response file. Unfortunately, VS2010 doesn&#8217;t feel obliged to pass a response file in every case, so the wrapper ends up double-quotting every parameter and thus ends up passing invalid parameters to the real MIDL. Two solutions: we can temporarily rename the wrapper file to by-pass it (it works for me) or we can improve the MIDL wrapper to support both cases. For now, let&#8217;s simply rename the wrapper to bypass it.</p><pre>mv Tools/vcbin/midl.exe Tools/vcbin/midl-.exe</pre><h4>Link Errors</h4><p>If you got thus far, then you compiled everything until WebKit proper. Your biggest milestones were JavaScriptCore, Interfaces and WebCore. WebCore, however, seems to be missing a dozen or so definitions. Turns out that during the project conversion VS2010 set the Item Type (under General settings) to &#8220;Custom Build Tool&#8221; instead of &#8220;C/C++ compiler&#8221; thereby getting ignored by the C++ compiler. The culprit here is the VS2005 project file, which has incorrect Item Type for these files, one the original project file is fixed, the conversion should produce valid output. These files are:</p><p>Source\WebCore\platform\network\curl\CookieJarCurl.cpp<br
/> Source\WebCore\platform\image-decoders\ImageDecoder.cpp</p><p>Just change their Item Type to &#8220;C/C++ compiler&#8221; from their properties and rebuild. If all goes well, you should get no error and everything should build successfully.</p><h2>Wrapping up</h2><h3>Summary</h3><p>Here is what we did so far:</p><ol><li>Install Cygwin.</li><li>Installed VS2010 Sp1 (and Windows SDK 7.1).</li><li>Set WEBKITLIBRARIESDIR and WEBKITOUTPUTDIR environment variables.</li><li>Make devenv.exe run as administrator.</li><li>Change Tools\Scripts\pdevenv to recognize VS100COMNTOOLS.</li><li>Remove the nullptr_t export from Source\JavaScriptCore\JavaScriptCore.vcproj\JavaScriptCore\JavaScriptCore.def.</li><li>Disable CL and MIDL wrappers (the files may be renamed or their folder removed from the path).</li><li>Disable Warning as Error from WebKitLibraries\win\tools\vsprops\common.props (optionally disable warning C4396 and enable MultiProcessor Compilation).</li><li>Change the Item Type of Source\WebCore\platform\network\curl\CookieJarCurl.cpp and Source\WebCore\platform\image-decoders\ImageDecoder.cpp to C/C++ compiler.</li></ol><p>Of course it would be great if one didn&#8217;t have to make all the code changes every time they updated the source code. Also, VS2010 project and props files have a different extension and format than the older ones. This means that any changes done to these files won&#8217;t get reflected in our converted files. The fix to that is to delete the converted Solution file and VS2010 will convert the files again. But even the conversion is a manual process. Let&#8217;s automate these changes&#8230;</p><h3>Automating</h3><p>Every modification we make to the source code, is a departure from the mainline and therefore a pain in maintaining it. I wanted somethin maintainable. This meant minimal change. I didn&#8217;t want to add new scripts, if any at all. Not only that, but I also wanted to support VS2005/VS2008 builds as well. That is, I plan to send this patch to become part of the mainline codebase. Turns out, we only need to modify one script in the WebKit proper source code: <code>pdevenv</code>.</p><p>We must modify <code>pdevenv</code> anyway to add support for VS2010 toolchain, no escape to that. So, here is what we can also do. First, add the VS100COMNTOOLS check, then, we need to convert the project, edit JavaScriptCore.def to remove the nullptr_t reference. We don&#8217;t need to rename the CL and MIDL wrappers; it&#8217;s enough to remove their folder from the path. Next, we need to edit common.props to disable warning as error, disable warning C4396 (which is optional) and enable MultiProcessor Compilation (again optional). Finally, we need to find all <code>.cpp</code> files and change their type to ClCompiler.</p><p>All of the editing tasks can be done using perlre (Perl Regex). In fact, they are simple one-line scripts. The tricky part was to generate Windows Batch file with the perl calls from <code>pdevenv</code>, which is a perl script itself. The reason for this is because that&#8217;s how Visual Studio is called; it&#8217;s a separate CMD shell. As you can see, the regex code is pretty twisted. Here is the updated <code>pdevenv</code> script:</p><pre class="brush:perl">
#!/usr/bin/perl -w

use strict;
use warnings;

use File::Temp qw/tempfile/;
use File::Copy;
use FindBin;

use lib $FindBin::Bin;
use webkitdirs;

my ($fh, $path) = tempfile(UNLINK =&gt; 0, SUFFIX =&gt; '.cmd') or die;

chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`);
chomp(my $scriptsPath = `cygpath -w "$FindBin::Bin"`);

my $command = join(" ", @ARGV);
my $vsToolsVar;
if ($ENV{'VS100COMNTOOLS'}) {
    $vsToolsVar = "VS100COMNTOOLS";
    $vcBin = ''; # We no longer need cl and midl wrappers.
	print $fh "\@echo Using VS2010 toolchain.\r\n";
	# If there is no vs2010 solution, upgrade.
	my $solution = $ARGV[0];
	$solution =~ s/WebKit.sln/WebKit-vs2010.sln/g;
	print $fh "\@echo off\r\n";
	print $fh "if not exist ..\\..\\WebKitLibraries ( \@echo This is not a WebKit directory! Stopping.\n goto exit )\r\n";
	print $fh "if not exist " . $solution . " (\r\n";
	print $fh "copy " . $ARGV[0] . " " . $solution . "\r\n";
	print $fh ")\r\n"; # If no vs2010 solution.
	print $fh "\@echo Upgrading solution file @ " . $solution . ". Build will resume when done. Please be patient.\r\n";
	print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\r\n";
	print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv /upgrade " . join(" ", $solution) . ") ELSE ";
	print $fh "VCExpress.exe /useenv /upgrade " . join(" ", $solution) . "\r\n";

	# Correct the solution file name.
	$command = '';
    foreach my $arg (@ARGV) {
		$arg =~ s/WebKit.sln/WebKit-vs2010.sln/g;
        $command = $command . ' ' . $arg;
    }

	print $fh "\@echo Patching common.props...\r\n";
	my $props_filename = "..\\..\\WebKitLibraries\\win\\tools\\vsprops\\common.props";
	chomp($props_filename = `cygpath -w '$props_filename'`);
	print $fh "\@echo  Disabling warning as error.\r\n";
	my $replace_string = "s/\\true\\/\\false\\/g";
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n";
	print $fh "\@echo  Disabling warning C4396.\r\n";
	$replace_string = "s/\\4396;/\\/g"; # Delete disabled warning 4396.
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n";
	$replace_string = "s/\\/\\4396;/g";
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n"; # Disable warning 4396.
	print $fh "\@echo  Enabling multiprocess compile.\r\n";
	$replace_string = "s/\\(.*?)\\//g"; # Delete MP compilation.
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n";
	$replace_string = "s/\\/\\\\n      \\true\\/g";
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n"; # Enable MP compilation.

	my $jsdef_filename = "..\\..\\Source\\JavaScriptCore\\JavaScriptCore.vcproj\\JavaScriptCore\\JavaScriptCore.def";
	chomp($jsdef_filename = `cygpath -w '$jsdef_filename'`);
	print $fh "if not exist \"" . $jsdef_filename . ".orig\" (\r\n";
	print $fh "\@echo Patching JavaScriptCore.def...\r\n";
	print $fh "move \"" . $jsdef_filename . "\" \"" . $jsdef_filename . ".orig\" \r\n";
	print $fh "findstr /V ?nullptr\@\@3Vnullptr_t\@std\@\@A \"" . $jsdef_filename . ".orig\" &gt; \"" . $jsdef_filename . "\"\r\n";
	print $fh ")\r\n"; # If no JavaScriptCore.def.orig.

	my $webcore_filename = "..\\..\\Source\\WebCore\\WebCore.vcproj\\WebCore.vcxproj";
	chomp($webcore_filename = `cygpath -w '$webcore_filename'`);
	print $fh "\@echo Correcting WebCore.vcxproj...\r\n";
	$replace_string = "undef \$/; s/\\/\\/msgi";
	print $fh "perl -0pi -e \"" . $replace_string . "\" \"" . $webcore_filename . "\"\r\n";
} elsif ($ENV{'VS90COMNTOOLS'}) {
    $vsToolsVar = "VS90COMNTOOLS";
} elsif ($ENV{'VS80COMNTOOLS'}) {
    $vsToolsVar = "VS80COMNTOOLS";
} else {
    print "*************************************************************\n";
    print "Cannot find Visual Studio tools dir.\n";
    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
    print "is set to a valid location.\n";
    print "*************************************************************\n";
    die;
}

print $fh "\@echo off\r\n";
print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\r\n";
print $fh "set PATH=$vcBin;$scriptsPath;\%PATH\%\r\n";

print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", $command) . ") ELSE ";
print $fh "VCExpress.exe /useenv " . join(" ", $command) . "\r\n";
print $fh ":exit\n";

close $fh;
chmod 0755, $path;
chomp($path = `cygpath -w -s '$path'`);

exec("cmd /c \"call $path\"");</pre><h3>One-Command Build</h3><p>Having installed Cygwin and Visual Studio, we need to change <code>devenv.exe</code> to run as administrator. Beyond that, just download the source code and the patch. Extract the source code anywhere you like, then extract the patch in the same folder. You should get a new <code>vs2010-build-env.cmd</code> file in the root of that folder and replace <code>pdevenv</code> in the Tools/Scripts folder.</p><p>Right-click <code>vs2010-build-env.cmd</code> and Run as Administrator. In the shell, simply execute <code>build-webkit --wincairo</code> and go read something, exercise or eat some healthy meal&#8230; Be back in an hour or so. Your station won&#8217;t be much usable during the build anyway.</p><p>Complete run of a patched nightly build for reference and completeness:</p><pre class="brush:plain">
Setting up Cygwin directory...
symbolic link created for C:\Cygwin &lt;&gt; C:\Tools\cygwin
Setting up WebKit directory...
symbolic link created for C:\Cygwin\home\Ash\WebKit-r106194 &lt;&gt; C:\prj\WebKit\WebKit-r106194\
Exporting environment varibles...
Note: Remember to set devenv.exe to run as administrator!
Running Cygwin...

Ash@Bull ~
$ build-webkit --wincairo
Checking Last-Modified date of WinCairoRequirements.zip...
Downloading WinCairoRequirements.zip...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   400k      0  0:00:35  0:00:35 --:--:--  407k

Installing WinCairoRequirements...
The WinCairoRequirements has been sucessfully installed in
 /cygdrive/c/Cygwin/home/Ash/WebKit-r106194/WebKitLibraries/win
Building results into: /cygdrive/c/Cygwin/home/Ash/WebKit-r106194/WebKitBuild
WEBKITOUTPUTDIR is set to: C:\prj\WebKit\WebKit-r106194\WebKitBuild
WEBKITLIBRARIESDIR is set to: C:\Cygwin\home\Ash\WebKit-r106194\WebKitLibraries\win
/cygdrive/c/Cygwin/home/Ash/WebKit-r106194/Tools/Scripts/pdevenv win\WebKit.vcproj\WebKit.sln /build Release_Cairo_CFLite
Using VS2010 toolchain.
        1 file(s) copied.
Upgrading solution file @ win\WebKit.vcproj\WebKit-vs2010.sln. Build will resume when done. Please be patient.
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.

Upgrade completed successfully. Results can be seen in the
upgrade report:
C:\prj\WebKit\WebKit-r106194\Source\WebKit\win\WebKit.vcproj\UpgradeLog.XML
Patching common.props...
 Disabling warning as error.
 Disabling warning C4396.
 Enabling multiprocess compile.
Patching JavaScriptCore.def...
        1 file(s) moved.
Correcting WebCore.vcxproj...
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1&gt;------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2&gt;StringExtras.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2&gt;SizeLimits.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2&gt;NullPtr.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2&gt;HashTable.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2&gt;DynamicAnnotations.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2&gt;BinarySemaphore.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
3&gt;------ Build started: Project: JavaScriptCore, Configuration: Release_Cairo_CFLite Win32 ------
3&gt;JSGlobalObject.obj : warning LNK4197: export '?s_globalObjectMethodTable@JSGlobalObject@JSC@@1UGlobalObjectMethodTable@2@B' specified multiple times; using first specification
3&gt;PropertyDescriptor.obj : warning LNK4197: export '?defaultAttributes@PropertyDescriptor@JSC@@0IA' specified multiple times; using first specification
3&gt;MachineStackMarker.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;Heap.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSValueRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific* WTF::WTFThreadData::staticData) imported
3&gt;JSWeakObjectMapRefPrivate.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;BytecodeGenerator.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;Parser.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSCallbackObject.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSClassRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific* WTF::WTFThreadData::staticData) imported
3&gt;JSContextRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSObjectRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSGlobalData.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSBase.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSCallbackConstructor.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3&gt;JSCallbackFunction.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
4&gt;------ Build started: Project: WebCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
4&gt;C:\prj\WebKit\WebKit-r106194\Source\WebCore\WebCore.vcproj\WebCoreGeneratedCairo.props(4,5): warning MSB4011: "C:\prj\WebKit\WebKit-r106194\WebKitLibraries\win\tools\vsprops\common.props" cannot be imported again. It was already imported at "C:\prj\WebKit\WebKit-r106194\Source\WebCore\WebCore.vcproj\WebCoreGeneratedCommon.props (4,5)". This is most likely a build authoring error. This subsequent import wi
ll be ignored. [C:\prj\WebKit\WebKit-r106194\Source\WebCore\WebCore.vcproj\WebCoreGenerated.vcxproj]
5&gt;------ Skipped Build: Project: QTMovieWin, Configuration: Release_Cairo_CFLite Win32 ------
5&gt;Project not selected to build for this solution configuration
6&gt;------ Build started: Project: WebCore, Configuration: Release_Cairo_CFLite Win32 ------
6&gt;..\platform\graphics\cairo\DrawErrorUnderline.h(24): warning C4067: unexpected tokens following preprocessor directive - expected a newline
6&gt;..\platform\graphics\cairo\DrawErrorUnderline.h(24): warning C4067: unexpected tokens following preprocessor directive - expected a newline
6&gt;InspectorIndexedDBAgent.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;InspectorFileSystemAgent.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;StorageInfo.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBTransaction.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBRequest.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBObjectStoreBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBObjectStore.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBKeyRange.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBKey.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBIndexBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBIndex.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBFactoryBackendInterface.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBFactoryBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBFactory.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBDatabaseBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBDatabase.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBCursorBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBCursor.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;IDBAny.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PluginDebug.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileReaderCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSEntrySyncCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSEntryCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSDirectoryEntrySyncCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSDirectoryEntryCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;ProgressShadowElement.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaControls.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaControlRootElement.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaControlElements.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;WeekInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;TimeInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;OperationNotAllowedException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MonthInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MicroDataItemValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaFragmentURIParser.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaDocument.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;LocalFileSystem.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;HTMLPropertiesCollection.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;HTMLParserErrorCodes.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileWriterSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileWriterBase.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileWriter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileThread.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileSystemCallbacks.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileStreamProxy.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileReaderLoader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileReader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileEntry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;EntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;EntryArraySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;EntryArray.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;Entry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DOMURL.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DOMFileSystemSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DOMFileSystemBase.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DOMFileSystem.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DOMFilePath.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DirectoryReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DirectoryReader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DirectoryEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DirectoryEntry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DateTimeLocalInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DateTimeInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DateInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;ColorInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;NotificationCenter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;Notification.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;ScriptedAnimationController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;StyleCachedShader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;RenderLayerBacking.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;RenderFullScreen.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;WebKitCSSShaderValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;WebKitCSSFilterValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;SpeechInputClientMock.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;LoaderRunLoopCF.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;BlobResourceHandle.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;BlobRegistryImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaPlayerPrivateAVFoundationCF.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaPlayerPrivateAVFoundation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;WKCACFViewLayerTreeHost.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PlatformCALayerWinInternal.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PlatformCALayerWin.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PlatformCAAnimationWin.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;LegacyCACFLayerTreeHost.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;TransformationMatrixCA.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;GraphicsLayerCA.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FilterOperations.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FilterOperation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FELightingNEON.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FEGaussianBlurNEON.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FECustomFilter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FECompositeArithmeticNEON.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;CustomFilterShader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;CustomFilterProgram.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;CustomFilterOperation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;CustomFilterMesh.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FullScreenController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MediaPlayer.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;GraphicsLayer.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;WebCorePrefix.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;ScrollbarThemeSafari.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;GDIObjectCounter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;ScrollAnimatorWin.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PlatformEvent.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;FileStream.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;CalculationValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;AsyncFileSystem.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;CachedShader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MHTMLParser.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;MHTMLArchive.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;SpeechInput.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PerformanceTiming.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PerformanceNavigation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;Performance.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;PageVisibilityState.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSStorageInfoUsageCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSStorageInfoQuotaCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSStorageInfoErrorCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSStorageInfo.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSOperationNotAllowedException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileWriterCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileEntry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSFileCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSEntryArraySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSDOMFileSystemSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSDirectoryReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;JSDirectoryEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6&gt;DerivedSources.obj : warning LNK4006: "protected: void __thiscall WebCore::JSWebKitCSSRegionRule::finishCreation(class JSC::JSGlobalData &amp;)" (?finishCreation@JSWebKitCSSRegionRule@WebCore@@IAEXAAVJSGlobalData@JSC@@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "private: __thiscall WebCore::JSWebKitCSSRegionRuleConstructor::JSWebKitCSSRegionRuleConstructor(class JSC::Structure *,class WebCore::JSDOMGlobalObject *)" (??0JSWebKitCSSRegionRuleConstructor@WebCore@@AAE@PAVStructure@JSC@@PAVJSDOMGlobalObject@1@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRuleConstructor::getOwnPropertyDescriptor(class JSC::JSObject *,class JSC::ExecState *,class JSC::Identifier const &amp;,class JSC::PropertyDescriptor &amp;)" (?getOwnPropertyDescriptor@JSWebKitCSSRegionRuleConstructor@WebCore@@SA_NPAVJSObject@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertyDescriptor@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "protected: __thiscall WebCore::JSWebKitCSSRegionRule::JSWebKitCSSRegionRule(class JSC::Structure *,class WebCore::JSDOMGlobalObject *,class WTF::PassRefPtr)" (??0JSWebKitCSSRegionRule@WebCore@@IAE@PAVStructure@JSC@@PAVJSDOMGlobalObject@1@V?$PassRefPtr@VWebKitCSSRegionRule@WebCore@@@WTF@@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRuleConstructor::getOwnPropertySlot(class JSC::JSCell *,class JSC::ExecState *,class JSC::Identifier const &amp;,class JSC::PropertySlot &amp;)" (?getOwnPropertySlot@JSWebKitCSSRegionRuleConstructor@WebCore@@SA_NPAVJSCell@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertySlot@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRule::getOwnPropertyDescriptor(class JSC::JSObject *,class JSC::ExecState *,class JSC::Identifier const &amp;,class JSC::PropertyDescriptor &amp;)" (?getOwnPropertyDescriptor@JSWebKitCSSRegionRule@WebCore@@SA_NPAVJSObject@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertyDescriptor@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRule::getOwnPropertySlot(class JSC::JSCell *,class JSC::ExecState *,class JSC::Identifier const &amp;,class JSC::PropertySlot &amp;)" (?getOwnPropertySlot@JSWebKitCSSRegionRule@WebCore@@SA_NPAVJSCell@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertySlot@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static class JSC::JSObject * __cdecl WebCore::JSWebKitCSSRegionRule::createPrototype(class JSC::ExecState *,class JSC::JSGlobalObject *)" (?createPrototype@JSWebKitCSSRegionRule@WebCore@@SAPAVJSObject@JSC@@PAVExecState@4@PAVJSGlobalObject@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static class JSC::JSObject * __cdecl WebCore::JSWebKitCSSRegionRulePrototype::self(class JSC::ExecState *,class JSC::JSGlobalObject *)" (?self@JSWebKitCSSRegionRulePrototype@WebCore@@SAPAVJSObject@JSC@@PAVExecState@4@PAVJSGlobalObject@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "private: void __thiscall WebCore::JSWebKitCSSRegionRuleConstructor::finishCreation(class JSC::ExecState *,class WebCore::JSDOMGlobalObject *)" (?finishCreation@JSWebKitCSSRegionRuleConstructor@WebCore@@AAEXPAVExecState@JSC@@PAVJSDOMGlobalObject@2@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static class JSC::JSValue __cdecl WebCore::JSWebKitCSSRegionRule::getConstructor(class JSC::ExecState *,class JSC::JSGlobalObject *)" (?getConstructor@JSWebKitCSSRegionRule@WebCore@@SA?AVJSValue@JSC@@PAVExecState@4@PAVJSGlobalObject@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "class JSC::JSValue __cdecl WebCore::jsWebKitCSSRegionRuleCssRules(class JSC::ExecState *,class JSC::JSValue,class JSC::Identifier const &amp;)" (?jsWebKitCSSRegionRuleCssRules@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@V23@ABVIdentifier@3@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "class JSC::JSValue __cdecl WebCore::jsWebKitCSSRegionRuleConstructor(class JSC::ExecState *,class JSC::JSValue,class JSC::Identifier const &amp;)" (?jsWebKitCSSRegionRuleConstructor@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@V23@ABVIdentifier@3@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static struct JSC::ClassInfo const WebCore::JSWebKitCSSRegionRuleConstructor::s_info" (?s_info@JSWebKitCSSRegionRuleConstructor@WebCore@@2UClassInfo@JSC@@B) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static struct JSC::ClassInfo const WebCore::JSWebKitCSSRegionRulePrototype::s_info" (?s_info@JSWebKitCSSRegionRulePrototype@WebCore@@2UClassInfo@JSC@@B) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6&gt;DerivedSources.obj : warning LNK4006: "public: static struct JSC::ClassInfo const WebCore::JSWebKitCSSRegionRule::s_info" (?s_info@JSWebKitCSSRegionRule@WebCore@@2UClassInfo@JSC@@B) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
7&gt;------ Build started: Project: Interfaces, Configuration: Release_Cairo_CFLite Win32 ------
8&gt;------ Build started: Project: WebKitGUID, Configuration: Release_Cairo_CFLite Win32 ------
9&gt;------ Build started: Project: WebKitLib, Configuration: Release_Cairo_CFLite Win32 ------
9&gt;WebDesktopNotificationsDelegate.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
9&gt;FullscreenVideoController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
10&gt;------ Build started: Project: WebKit2Generated, Configuration: Release_Cairo_CFLite Win32 ------
11&gt;------ Build started: Project: WebKit, Configuration: Release_Cairo_CFLite Win32 ------
11&gt;libjpeg.lib(jdapimin.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdapimin.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdapistd.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdapistd.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdmarker.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmarker.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jerror.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jerror.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdmaster.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmaster.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jcomapi.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jcomapi.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdinput.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdinput.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jmemmgr.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jmemmgr.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jutils.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jutils.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdhuff.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdhuff.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jquant1.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jquant1.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jddctmgr.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jddctmgr.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdsample.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdsample.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdarith.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdarith.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdcolor.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdcolor.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdcoefct.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdcoefct.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jquant2.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jquant2.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdmerge.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmerge.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdmainct.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmainct.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jdpostct.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdpostct.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jmemnobs.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jmemnobs.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jidctint.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jidctint.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jidctflt.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jidctflt.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jidctfst.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jidctfst.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libjpeg.lib(jaricom.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jaricom.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngerror.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngerror.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngread.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngread.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngpread.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngpread.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngget.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngget.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngtrans.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngtrans.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngrtran.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngrtran.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngset.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngset.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(png.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(png.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngrio.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngrio.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngrutil.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngrutil.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11&gt;libpng.lib(pngmem.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngmem.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
12&gt;------ Build started: Project: WebKit2WebProcess, Configuration: Release_Cairo_CFLite Win32 ------
13&gt;------ Build started: Project: testapi, Configuration: Release_Cairo_CFLite Win32 ------
14&gt;------ Build started: Project: jsc, Configuration: Release_Cairo_CFLite Win32 ------
15&gt;------ Build started: Project: testRegExp, Configuration: Release_Cairo_CFLite Win32 ------
16&gt;------ Build started: Project: WinLauncher, Configuration: Release_Cairo_CFLite Win32 ------
17&gt;------ Build started: Project: WinLauncherLauncher, Configuration: Release_Cairo_CFLite Win32 ------
17&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WinLauncherLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WinLauncher.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(WinLauncherLauncher) does not match the Linker's OutputFile property value (WinLauncher). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
18&gt;------ Build started: Project: TestNetscapePlugin, Configuration: Release_Cairo_CFLite Win32 ------
18&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\TestNetscapePlugin.dll) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\TestNetscapePlugin\npTestNetscapePlugin.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
18&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(TestNetscapePlugin) does not match the Linker's OutputFile property value (npTestNetscapePlugin). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
19&gt;------ Build started: Project: ImageDiff, Configuration: Release_Cairo_CFLite Win32 ------
19&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiff.dll) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiff.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
19&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile property value (.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
20&gt;------ Build started: Project: ImageDiffLauncher, Configuration: Release_Cairo_CFLite Win32 ------
20&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiffLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiff.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
20&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(ImageDiffLauncher) does not match the Linker's OutputFile property value (ImageDiff). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
21&gt;------ Build started: Project: WebCoreTestSupport, Configuration: Release_Cairo_CFLite Win32 ------
22&gt;------ Build started: Project: DumpRenderTree, Configuration: Release_Cairo_CFLite Win32 ------
23&gt;------ Build started: Project: DumpRenderTreeLauncher, Configuration: Release_Cairo_CFLite Win32 ------
23&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\DumpRenderTreeLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\DumpRenderTree.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
23&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(DumpRenderTreeLauncher) does not match the Linker's OutputFile property value (DumpRenderTree). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
24&gt;------ Build started: Project: WebKitLauncherWin, Configuration: Release_Cairo_CFLite Win32 ------
24&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKitLauncherWin.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKit.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
24&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(WebKitLauncherWin) does not match the Linker's OutputFile property value (WebKit). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
25&gt;------ Build started: Project: record-memory-win, Configuration: Release_Cairo_CFLite Win32 ------
26&gt;------ Build started: Project: InjectedBundleGenerated, Configuration: Release_Cairo_CFLite Win32 ------
27&gt;------ Build started: Project: InjectedBundle, Configuration: Release_Cairo_CFLite Win32 ------
28&gt;------ Build started: Project: WebKitTestRunner, Configuration: Release_Cairo_CFLite Win32 ------
29&gt;------ Build started: Project: WebKitTestRunnerLauncher, Configuration: Release_Cairo_CFLite Win32 ------
29&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKitTestRunnerLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKitTestRunner.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
29&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(WebKitTestRunnerLauncher) does not match the Linker's OutputFile property value (WebKitTestRunner). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)
.
30&gt;------ Build started: Project: gtest-md, Configuration: Release_Cairo_CFLite Win32 ------
30&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\lib\gtest-md.lib) does not match the Library's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\lib\gtest.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
30&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1153,5): warning MSB8012: TargetName(gtest-md) does not match the Library's OutputFile property value (gtest). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
31&gt;------ Build started: Project: TestWebKitAPIGenerated, Configuration: Release_Cairo_CFLite Win32 ------
32&gt;------ Build started: Project: TestWebKitAPI, Configuration: Release_Cairo_CFLite Win32 ------
33&gt;------ Build started: Project: TestWebKitAPIInjectedBundle, Configuration: Release_Cairo_CFLite Win32 ------
34&gt;------ Build started: Project: MiniBrowser, Configuration: Release_Cairo_CFLite Win32 ------
35&gt;------ Build started: Project: MiniBrowserLauncher, Configuration: Release_Cairo_CFLite Win32 ------
35&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\MiniBrowserLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\MiniBrowser.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
35&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(MiniBrowserLauncher) does not match the Linker's OutputFile property value (MiniBrowser). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
========== Build: 34 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========

===========================================================
 WebKit is now built (49m:07s).
 To run Safari with this newly-built code, use the
 "../../../Cygwin/home/Ash/WebKit-r106194/Tools/Scripts/run-safari" script.
===========================================================

Ash@Bull ~
$</pre><h2>The Patch</h2><p><a
href="http://blog.ashodnakashian.com/wp-content/uploads/2012/01/WebKit-vs2010-Patch.zip">The Patch: WebKit-vs2010-Patch.zip</a><br
/> Good luck and happy hacking.</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2012%2F01%2Fbuilding-webkit-on-windows-7-with-vs2010%2F&amp;title=Building%20WebKit%20on%20Windows%207%20with%20VS2010" id="wpa2a_2"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=1osrgXtjWA0:Ld2XM4rJoqk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=1osrgXtjWA0:Ld2XM4rJoqk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=1osrgXtjWA0:Ld2XM4rJoqk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=1osrgXtjWA0:Ld2XM4rJoqk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/1osrgXtjWA0" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2012/01/building-webkit-on-windows-7-with-vs2010/feed/</wfw:commentRss> <slash:comments>20</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2012/01/building-webkit-on-windows-7-with-vs2010/</feedburner:origLink></item> <item><title>Goodbye Go Daddy!</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/zdTvSc3rpoM/</link> <comments>http://blog.ashodnakashian.com/2012/01/goodbye-go-daddy/#comments</comments> <pubDate>Thu, 05 Jan 2012 11:03:14 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Opinion]]></category> <category><![CDATA[Politics]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[SOPA]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1775</guid> <description><![CDATA[Go Daddy is one of the largest, if not the largest, domain registrar. So it is that much unfortunate that they also support SOPA. The &#8220;carpet bombing&#8221; attack on piracy dubbed SOPA will most certainly wipe-out many legitimate businesses and gratis sites, not least freedom of speech and news organizations, including human, animal and consumer <a
href='http://blog.ashodnakashian.com/2012/01/goodbye-go-daddy/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>Go Daddy is one of the largest, if not <em>the</em> largest, domain registrar. So it is that much unfortunate that they also support <a
href="http://en.wikipedia.org/wiki/Stop_Online_Piracy_Act">SOPA</a>. The &#8220;carpet bombing&#8221; attack on piracy dubbed SOPA will most certainly wipe-out many legitimate businesses and gratis sites, not least freedom of speech and news organizations, including human, animal and consumer rights organizations that are sure to step on the toes of some giant corporations in due process. This is sure to put open-source software at risk as well. The broad brush that SOPA is will not hinder any party from unfairly claiming copyright infringement, promptly shutting down a competitor or whistle blower at an opportune time to protect their interests, leaving the receiving party scrambling in the legal-equivalent to quick sand.</p><p>I&#8217;m joining tens of thousands in <a
href="http://www.reddit.com/r/technology/comments/nvayu/move_your_domain_from_godaddy_day_cheapest/">boycotting Go Daddy</a> and moving this domain to another, more freedom-loving, technology and internet friendly and, ultimately, sane registrar, at least as far as the future of the internet is concerned. I&#8217;ve already started transferring my domain to <a
href="http://www.namecheap.com?aff=27082">Namecheap.com</a> (affiliate link).</p><p>If they don&#8217;t see that SOPA will slowly, but surely, stagnate the internet, then may be the boycott will make them. If the <a
href="http://saypeople.com/2011/12/25/21000-domains-migrated-from-godaddy-because-of-sopa-support/">numbers</a> are to be believed upwards of 35,000 domains have already transferred. At a nominal $7 annual fee, that&#8217;s already a significant chunk of cash lost annually. I expect many have dozens of domains and use some of the more advanced features such as SSL certificates, which is more revenue lost by the transfers. This move could easily cost companies supporting SOPA millions of dollars in potentially long-term, recurring money.</p><p>This isn&#8217;t an emotional reaction in the name of freedom and human rights, not just. Go Daddy is known to engage in dubious activities and it might be said that they had it coming. One of the more annoying of said activities is giving customers the impression that their domain is about to expire if not immediately renewed. The spam mails start hitting the mailbox 90 days before the expiry. While the warning is fair and welcome, 90 days isn&#8217;t exactly imminent in any sense. Of course once renewed, the remaining weeks or months to the actual deadline are lost, thereby shortening the effective period for which one pays. This kind of tactics don&#8217;t make the already high prices any more appealing. To add insult to injury, they have an almost weekly promotional spam that dilutes the expiry warning&#8217;s effectiveness. I for one learnt to ignore their mail, while having a mental note of when to renew my domain.</p><p><a
href="http://m.zdnet.com/blog/networking/go-daddy-really-and-truly-opposes-sopa-now/1813">According to ZDNet</a>, Go Daddy has reversed its support of SOPA. But as the ZDNet reporter put it &#8220;we now know that what really mattered in Go Daddy’s shift in policy wasn’t the legal or ethical issues; it was the old bottom line.&#8221;</p><p><strong>Well, Go Daddy no more; welcome Namecheap!</strong></p><p><em>(This site might go dark for a few hours during the transfer process which I hope to complete sometime before the 10th of January. I&#8217;m working hard to minimize the outage. Apologies for any unavailability or inconvenience.)</em></p><p><em><strong>Update: </strong> Just found out that <a
href="http://en.wikipedia.org/wiki/Bob_Parsons">Bob Parsons</a>, the CEO of Go Daddy group, happens to enjoy <a
class="highslide img_2" href="http://the-best-web-hosting-service.com/blog/wp-content/uploads/2011/04/godaddy-killer.jpg" onclick="return hs.expand(this)">elephant hunting</a>! He released a <a
href="http://www.huffingtonpost.com/2011/03/31/bob-parsons-godaddy-ceo-elephant-hunt_n_843121.html">video</a> showing and justifying the barbaric act of shooting and killing a defenseless animal.</em></p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2012%2F01%2Fgoodbye-go-daddy%2F&amp;title=Goodbye%20Go%20Daddy%21" id="wpa2a_4"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=zdTvSc3rpoM:VBqfnY5sD0E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=zdTvSc3rpoM:VBqfnY5sD0E:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=zdTvSc3rpoM:VBqfnY5sD0E:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=zdTvSc3rpoM:VBqfnY5sD0E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/zdTvSc3rpoM" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2012/01/goodbye-go-daddy/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2012/01/goodbye-go-daddy/</feedburner:origLink></item> <item><title>Now Reading Redux 6.5 Released</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/yhiFwEtZIGI/</link> <comments>http://blog.ashodnakashian.com/2012/01/now-reading-redux-6-5-released/#comments</comments> <pubDate>Sun, 01 Jan 2012 14:14:33 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Literature]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Now Reading Redux]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1765</guid> <description><![CDATA[The latest version of WordPress plugin Now Reading Redux was released on New Year&#8217;s eve. It has many awaited features that should prove very useful. The main focus of this release has been, by and large, to refurbish the plugin and make it more flexible and usable. To that end there were two main types <a
href='http://blog.ashodnakashian.com/2012/01/now-reading-redux-6-5-released/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>The latest version of WordPress plugin <a
href="http://blog.ashodnakashian.com/projects/now-reading-redux/">Now Reading Redux</a> was released on New Year&#8217;s eve. It has many awaited features that should prove very useful.</p><p>The main focus of this release has been, by and large, to refurbish the plugin and make it more flexible and usable. To that end there were two main types of changes. First, a new set of options were introduced to make the main templates vastly more customizable and thereby reduce the need to make manual changes to the template files themselves. Second, a number of internal cleanups were performed to make the plugin code more up-to-date with WordPress. In that vein, the minimum WP required version was bumped from 2.8.0 to 2.9.0.</p><p>These changes, which are both user-visible and internal, are by all measures the biggest done in the Redux incarnation. As versions 6.2 and 6.3 were internal, 6.4 was skipped and 6.5 was chosen to mark the significance of this release.</p><p>There is a lot more work and a longish todo list waiting for realization. My main goals are to make NRR as flexible and as usable to as wide an audience as possible and to make the plugin more active and interactive. As it is, the plugin just passively shows off the owner&#8217;s library of books. This is less than satisfactory in an age of interactive networking. Without going into much details, what I&#8217;d love to see in this plugin is the ability to share, exchange and even interact with anyone&#8217;s library. Much like we did when we visited a friend and went through their albums, commenting, comparing, borrowing and trading.</p><p>I&#8217;d also like to see more people using the plugin and upgrading from the older versions that are out there in the thousands. So I ask the users of NRR to <a
href="http://wordpress.org/extend/plugins/now-reading-redux/">rate it on WordPress</a>, add their feedback on the <a
href="http://blog.ashodnakashian.com/projects/now-reading-redux/">plugin&#8217;s homepage</a>, <a
href="https://github.com/Ashod/Now-Reading-Redux">report bugs and issues on git</a> (or on the homepage,) and to make suggestions for improvements and feature requests. To help promote the plugin, I&#8217;ve added a link from the widget to the homepage that is hidden only to become visible on mouse hover.</p><p>I hope this plugin encourages people to read more and talk about books and the ideas contained therein more than ever. I hope it&#8217;s a good aid to those who have a reading list but procrastinate or can&#8217;t get organized to create the time necessary to finish a book before dust collects and it becomes a reminder of unfinished business.</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2012%2F01%2Fnow-reading-redux-6-5-released%2F&amp;title=Now%20Reading%20Redux%206.5%20Released" id="wpa2a_6"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=yhiFwEtZIGI:rB-9VpRPq0o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=yhiFwEtZIGI:rB-9VpRPq0o:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=yhiFwEtZIGI:rB-9VpRPq0o:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=yhiFwEtZIGI:rB-9VpRPq0o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/yhiFwEtZIGI" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2012/01/now-reading-redux-6-5-released/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2012/01/now-reading-redux-6-5-released/</feedburner:origLink></item> <item><title>Online Classes: A Revolution in Education</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/PkUR0cp8MVE/</link> <comments>http://blog.ashodnakashian.com/2011/11/online-classes-a-revolution-in-education/#comments</comments> <pubDate>Fri, 18 Nov 2011 16:04:38 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Lectures]]></category> <category><![CDATA[Sophia]]></category> <category><![CDATA[eLearning]]></category> <category><![CDATA[Online Courseware]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1707</guid> <description><![CDATA[A while back I wrote about Stanford&#8217;s online DB course. Many of my friends who expressed interest unfortunately couldn&#8217;t afford the time to invest in an online course. Luckily, that wasn&#8217;t their last chance. But before I get to the upcoming courses, let me reflect on online courses in general and why Stanford, deservedly, got <a
href='http://blog.ashodnakashian.com/2011/11/online-classes-a-revolution-in-education/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>A while back I <a
href="http://blog.ashodnakashian.com/2011/10/intro-to-databases-online-video-course/">wrote</a> about Stanford&#8217;s online <a
href="http://www.db-class.org">DB course</a>. Many of my friends who expressed interest unfortunately couldn&#8217;t afford the time to invest in an online course. Luckily, that wasn&#8217;t their last chance. But before I get to the upcoming courses, let me reflect on online courses in general and why Stanford, deservedly, got a wide coverage and following.<br
/></p><h2>Online Lectures</h2><p>I&#8217;ve been watching (and listening) to university lectures since circa 2004. Back then there weren&#8217;t too many available. In 2005 I discovered UC Berkeley&#8217;s <a
href="http://webcast.berkeley.edu/">WebCasts</a>. These were RealVideo lectures from early 2000s on many hard sciences and some humanities. The quality of the courses were as expected high. The main issues were that RealVideo only allowed streaming, so there was no way of downloading. Besides that, the video was in rather low-resolution, low-quality and recorded from a single angle and reading the blackboard was unnecessary strain on the eye. Back in 2006 I wrote a python script using MPlayer to parse the pages, play the video with MPlayer and dump the resultant stream to files. The main issue with this was that a single hiccup and the lecture had to be downloaded from start again. Using this slow and painful method I downloaded dozens of courses and filled about 250GB worth of media and shared to colleagues and friends. Berkeley improved this by introducing Mp4 downloadable links in higher resolution starting in 2009 (I think) and now moved completely to iTunes and YouTube as platforms.</p><p>During that time I discovered <a
href="http://ocw.mit.edu">MIT</a> and <a
href="http://oyc.yale.edu/">Yale</a> but neither could equal Berkeley in the number of courses or the topics. Berkeley&#8217;s <a
href="http://www.youtube.com/playlist?list=PL095393D5B42B2266">Physics for Future Presidents</a> is perhaps the best example that I can think of to show off what Berkeley had to offer. In 2008/2009 Stanford&#8217;s Leonard Susskind&#8217;s <a
href="http://www.youtube.com/watch?v=hbmf0bB38h0&#038;feature=list_related&#038;playnext=1&#038;list=SP6C8BDEEBA6BDC78D">Modern Physics</a> was available online, which is another top-notch lecture series.</p><p>As MIT, Yale, Harvard and Princeton made available more courses, I discovered <a
href="http://academicearth.org/">Academic Earth</a>, which I think at this point is perhaps the single best site for high-quality, diverse and highly usable video lectures.</p><h2>Why University Lectures?</h2><p>The process of learning isn&#8217;t linear nor comes in one flavor. Different people have different preferences on how they rather best learn or study something. Indeed, different topics might be best learnt in dissimilar methods. From books, tutorials, hands-on examples to demonstrations, labs and homework assignments. But university lectures place one&#8217;s mind into the classroom state. With all the students, rigor in subject treatment, questions from students, they all contribute to the state of mind that is very important in taking the information seriously. The lectures are also divided in such a manner that&#8217;s expected to be reasonably-paced. There are also review sessions and sometimes quizzes.</p><p>At this time I&#8217;m enjoying <a
href="http://www.academicearth.org/lectures/morality-of-muder-and-cannibalism">Justice</a> on political philosophy and morality (by <a
href="http://www.justiceharvard.org/">Michael Sandel</a> of Harvard) and <a
href="http://www.academicearth.org/lectures/measurements-space-and-time">Physics I: Classical Mechanics</a> (by Walter Lewin of MIT) on Academic Earth, besides Stanford&#8217;s <a
href="http://db-class.org">DB</a>, <a
href="http://ml-class.org">ML</a> and <a
href="http://ai-class.com">AI</a> courses, of course.</p><p>With tutorials, books and other forms of teaching most of the above is lost. Not to mention the caliber of the teachers in these universities are expectedly quite high.</p><h2>The Stanford Model</h2><p>Stanford introduced 3 &#8220;experimental&#8221; online courses in <a
href="http://db-class.org">Database</a>, <a
href="http://ml-class.org">Machine Learning</a> and <a
href="http://ai-class.com">Artificial Intelligence</a> in the Fall of 2011 (it&#8217;s mid-term exam week as I write this). Besides the fact that these courses are highly sought-after, the Artificial Intelligence course is taught by Google rock-star Sebastian Thrun who&#8217;s behind the <a
href="http://en.wikipedia.org/wiki/Google_driverless_car">Driverless Google car</a> (<a
href="http://www.youtube.com/watch?v=X0I5DHOETFE">video</a> featuring Prof. Thrun).</p><p>Unlike all other online courses, Stanford&#8217;s approach was more course-like and less of a video recording of a lecture, as all others are. MIT might offer notes, slides and transcripts, but Stanford&#8217;s courses have forums where TA&#8217;s and teachers participate, sidecasts where teachers do online video chat with students, online and interactive quizzes that pop-up during the lectures, assignments and exams with automated grading. In addition, at the end of a course, the teacher will give a signed statement of accomplishment to the students who participated. This is in addition to prerequisite and preparatory lectures, external resource links, books and reading materials, transcripts and translations, downloadable video and lecture slides.</p><p>So there is not only much more interactivity with thousands of other students with study groups gathering in person and online, but also there is interactivity with the teachers and with online tests with immediate feed-back. These features make the courses much more than the sum of its parts. They exploit the internet and multimedia to their true potential and deliver a remarkable package for a globally available learning experience.</p><p>For those who can&#8217;t, or don&#8217;t want to, take up the assignments and exams, they can choose the Basic track. The course material is promised to be available to all during and after the end of the courses.</p><h2>More Courses!</h2><p>With the success that the DB, ML and AI classes saw, with well over 300,000 students enrolled in total, it&#8217;s no surprise that they are expanding this to other subjects as well.</p><ul><li><a
href="http://www.cs101-class.org"><strong>CS 101</strong></a> by Nick Parlante.</li><li><a
href="http://www.nlp-class.org"><strong>Natural Language Processing</strong></a> by Dan Jurafsky and Chris Manning.</li><li><a
href="http://www.saas-class.org"><strong>Software Engineering for SAAS</strong></a> by Armando Fox and David Patterson.</li><li><a
href="http://www.hci-class.org"><strong>Human-Computer Interfaces</strong></a> by Scott Klemmer.</li><li><a
href="http://www.game-theory-class.org"><strong>Game Theory</strong></a> by Matthew Jackson and Yoav Shoham.</li><li><a
href="http://www.pgm-class.org"><strong>Probabilistic Graphical Models</strong></a> by Daphne Koller.</li><li><a
href="http://www.jan2012.ml-class.org"><strong>Machine Learning</strong></a> by Andrew Ng.</li><li><a
href="http://launchpad-class.org"><strong>The Lean Launchpad</strong></a> by Steve Blank.</li><li><a
href="http://entrepreneur-class.org"><strong>Technology Entrepreneurship</strong></a> by Chuck Eesley.</li><li><a
href="http://www.algo-class.org/"><strong>Design and Analysis of Algorithms</strong></a> I by Tim Roughgarden.</li><li><a
href="http://crypto-class.org/"><strong>Cryptography</strong></a> by Dan Boneh.</li></ul><p>These courses will start in January or February 2012. I expect they will announce others, most probably <del
datetime="2011-11-20T06:31:22+00:00">Database and</del> (prof. Widom announced that the course will be available next fall) Artificial Intelligence, or so I hope.</p><h2>Final Thoughts</h2><p>Needless to say, Stanford&#8217;s online courses is a very welcome project and one that will change the face of education, e-learning and especially distance learning and autodidactism by raising the bar and setting new standards. US universities aren&#8217;t the only player here. Perhaps the best example is India&#8217;s <a
href="http://nptel.iitm.ac.in/">National Programme on Technology Enhanced Learning</a> (NPTEL) which already has hundreds of courses and plans to expand to over a thousand. Their <a
href="http://nptel.iitm.ac.in/video.php?subjectId=106105079">Artificial Intelligence</a> course, by prof. P. Dasgupta, is highly acclaimed. From the other end of the spectrum there is <a
href="http://www.khanacademy.org/">Khan Academy</a>, which is a not-for-profit educational organization led by a very enthusiastic and charismatic figure, <a
href="http://www.ted.com/talks/salman_khan_let_s_use_video_to_reinvent_education.html">Salman Khan</a>, who&#8217;s behind the 2700+ videos on most all topics. Khan Academy also has practice problems with scoring method and graphs tracking progress over time and in each subject.</p><p>Education and learning in general has never been this accessible before. With the internet, Wikipedia, free books and video tutorials and university lectures available to anyone with an internet connection. We no longer have an excuse for ignorance but our lack of will. Not looking up things we don&#8217;t know, suspect to know correctly or completely or want to learn more about, is practically inexcusable. Of course with all that information and availability also comes a sizable amount of chaff that one must weed-out from wheat. The signal-to-noise ration can be quite disappointing on some topics. But at least that can be done faster and much easier than it was only a decade or two ago, and not searching for criticism or opponents to get a more balanced picture is as inexcusable as not looking up in the first place. At least now one can also reach experts and hear what they have to say. We can even attend the best universities from the comfort of our armchairs.</p><p>I can&#8217;t help but wonder if the next generation will look at physically attending lectures as this generation does to putting pen to paper.</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F11%2Fonline-classes-a-revolution-in-education%2F&amp;title=Online%20Classes%3A%20A%20Revolution%20in%20Education" id="wpa2a_8"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=PkUR0cp8MVE:T6uBlhkllcs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=PkUR0cp8MVE:T6uBlhkllcs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=PkUR0cp8MVE:T6uBlhkllcs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=PkUR0cp8MVE:T6uBlhkllcs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/PkUR0cp8MVE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/11/online-classes-a-revolution-in-education/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/11/online-classes-a-revolution-in-education/</feedburner:origLink></item> <item><title>Understanding MS SQL Transactions and Error Handling</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/J3qM3nuols8/</link> <comments>http://blog.ashodnakashian.com/2011/11/understanding-ms-sql-transactions-and-error-handling/#comments</comments> <pubDate>Wed, 16 Nov 2011 07:36:22 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Code Snippet]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Error Handling]]></category> <category><![CDATA[SQL]]></category> <category><![CDATA[Transactions]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1369</guid> <description><![CDATA[Transactions are the seat-belts of SQL servers. They protect our data by promising &#8220;all or nothing&#8221;. Data consistency on any level couldn&#8217;t be guaranteed without it. In a sense transactions work because they guarantee atomicity. They work because they allow you to abandon your changes and walk away at will, completely secure in the knowledge <a
href='http://blog.ashodnakashian.com/2011/11/understanding-ms-sql-transactions-and-error-handling/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>Transactions are the seat-belts of SQL servers. They protect our data by promising &#8220;all or nothing&#8221;. Data consistency on any level couldn&#8217;t be guaranteed without it. In a sense transactions work because they guarantee atomicity. They work because they allow you to abandon your changes and walk away at will, completely secure in the knowledge that not only your changes thus far aren&#8217;t visible to anyone, but also that your changes didn&#8217;t go anywhere near your valuable data.</p><p>Any reasonably-sized database code, therefore, is bound to have transactions peppered all about. Yet having a flawed implementation could be as worse as not having any at all. Perhaps even worse, given the false confidence. To my shock and horror, we just discovered a similar situation in one of our products. The opportunity to get to the bottom of transactions was pretty much forced, but it was a welcome opportunity nonetheless.</p><p>Here I&#8217;ll limit this investigation to MS SQL (2005 and 2008 used for testing).</p><p>Here is what we&#8217;re trying to achieve:</p><ol><li>Understand how MS SQL transactions work.</li><li>Transactions must support nesting and rollback should abort all.</li><li>Develop a template that use transactions correctly with error handling.</li></ol><h2>Test Bed</h2><p>Let&#8217;s start by a boilerplate database as a test-bed.</p><pre class="brush:sql">
-- Create an uncreatively named database.
CREATE DATABASE DeeBee
GO
USE DeeBee
GO

-- Create a table to use for data modification.
CREATE TABLE Tee(
	-- We'll generate overflow exception at will using this field.
	Num TINYINT
)
GO
</pre><p>Now let&#8217;s see what happens if we do multiple inserts and one fails&#8230;</p><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
CREATE PROCEDURE [Multi_Insert]
AS
	-- Normal case
	INSERT INTO Tee VALUES(1);
	-- Overflow case
	INSERT INTO Tee VALUES(2000);
	-- Normal case again
	INSERT INTO Tee VALUES(3);
GO
</pre><p>To execute the above sproc, run the following (repeat after each change to the sproc above):</p><pre class="brush:sql">
-- Clean slate.
DELETE FROM Tee
GO

-- Execute complex statements.
EXEC Multi_Insert;
GO

-- Check the results
SELECT * FROM Tee
GO
</pre><p>Results (for the exec alone):</p><pre class='brush: plain'>
(1 row(s) affected)
Msg 220, Level 16, State 2, Procedure Multi_Insert, Line 8
Arithmetic overflow error for data type tinyint, value = 2000.
The statement has been terminated.

(1 row(s) affected)
</pre><p>Two things to observe here: First, unsurprisingly the first insert went as planned as can be seen in the first &#8220;1 row(s) affected&#8221; message, followed by the overflow error. Second, which is important here, is that this didn&#8217;t abort or change the flow of the sproc, rather, the 3rd insert was executed as well.</p><p>Selecting everything in the Tee gives us:</p><pre>
1
3
</pre><h2>Error Handling</h2><p>In many cases we wouldn&#8217;t want to resume with our operations when one fails. A quick solution might look something like this:</p><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
ALTER PROCEDURE [Multi_Insert]
AS
	-- Normal case
	INSERT INTO Tee VALUES(1);
	if @@ERROR <> 0
		RETURN

	-- Overflow case
	INSERT INTO Tee VALUES(2000);
	if @@ERROR <> 0
		RETURN

	-- Normal case again
	INSERT INTO Tee VALUES(3);
GO
</pre><p>This would work, but it only prevents further operations after the initial error, it doesn&#8217;t undo previous changes. In addition, it&#8217;s very tedious, especially with complex sprocs and looks ugly. Let&#8217;s see what we can do with exception handling&#8230;</p><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
ALTER PROCEDURE [Multi_Insert]
AS
BEGIN TRY
	-- Normal case
	INSERT INTO Tee VALUES(1);
	-- Overflow case
	INSERT INTO Tee VALUES(2000);
	-- Normal case again
	INSERT INTO Tee VALUES(3);
END TRY
BEGIN CATCH
	PRINT ERROR_MESSAGE();
END CATCH
GO
</pre><p>This is functionally equivalent to the previous version, however here we have a clean control-flow and no longer do we need to taint our code with error checking. The print statement isn&#8217;t necessary, I just added it to show that the same error occurs. The result of this sproc is a single insert into Tee with the value 1.</p><h2>Transactions</h2><p>Let&#8217;s do the same, this time using transactions only.</p><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
ALTER PROCEDURE [Multi_Insert]
AS
BEGIN
	BEGIN TRANSACTION
		-- Normal case
		INSERT INTO Tee VALUES(1);
		-- Overflow case
		INSERT INTO Tee VALUES(2000);
		-- Normal case again
		INSERT INTO Tee VALUES(3);
	COMMIT TRANSACTION
END
GO
</pre><p>The above sproc will result in the following, familiar, output:</p><pre class='brush: plain'>
(1 row(s) affected)
Msg 220, Level 16, State 2, Procedure Multi_Insert, Line 9
Arithmetic overflow error for data type tinyint, value = 2000.
The statement has been terminated.

(1 row(s) affected)
</pre><p>This is the exact same behavior as without the transactions! This means transactions don&#8217;t automatically add protection, recovery and undo. Not only didn&#8217;t we revert the first insert after the error, but we went on to execute the remainder of the transaction. The only way to fix this is to actually issue a <code>ROLLBACK TRANSACTION</code> statement. Of course we must do this by first detecting that something went wrong. Since we already know that we must do this manually, we should either check for errors or wrap the code in TRY/CATCH clauses.</p><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
ALTER PROCEDURE [Multi_Insert]
AS
BEGIN TRY
	BEGIN TRANSACTION
		-- Normal case
		INSERT INTO Tee VALUES(1);
		-- Overflow case
		INSERT INTO Tee VALUES(2000);
		-- Normal case again
		INSERT INTO Tee VALUES(3);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	ROLLBACK TRANSACTION
	PRINT ERROR_MESSAGE();
END CATCH
GO
</pre><p>Results:</p><pre class='brush: plain'>
(1 row(s) affected)

(0 row(s) affected)
Arithmetic overflow error for data type tinyint, value = 2000.
</pre><p>Finally, modifications are rolled back and the table is back to a clean slate, as it was before executing the sproc.</p><h2>Nested Transactions</h2><p>Now that we have a working transaction with correct exception handling, let&#8217;s try to develop a version that is symmetric and can be nested. We could use the above try/transaction/catch/rollback pattern, except, it&#8217;s not robust. To see why that is so, let&#8217;s take a little bit more complex case. Suppose you used this pattern in the sprocs that do modification, and in one case you called one sproc from another.</p><pre class="brush:sql">
-- Sproc that does complex operations.
CREATE PROCEDURE [SP_Complex]
AS
BEGIN TRY
	BEGIN TRANSACTION

		-- Normal case
		INSERT INTO Tee VALUES(0);

		-- Execute a bad sproc.
		EXEC Multi_Insert;

		-- Normal case again
		INSERT INTO Tee VALUES(5);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	ROLLBACK TRANSACTION
	PRINT ERROR_MESSAGE();
END CATCH
GO
</pre><p>The above sproc is written using the same pattern we used in <code>Multi_Insert</code>. We know the inner <code>Multi_Insert</code> will have an exception, it&#8217;ll rollback the transaction and return. But what about the outer transaction in <code>SP_Complex</code>? Would the first insert be rolled back? Will the last insert get executed?</p><p>Results:</p><pre class='brush: plain'>
(1 row(s) affected)

(1 row(s) affected)

(0 row(s) affected)
Arithmetic overflow error for data type tinyint, value = 2000.
Msg 3903, Level 16, State 1, Procedure SP_Complex, Line 19
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0.
</pre><p>Things didn&#8217;t go as planned. Checking for modifications in the <code>Tee</code> table shows that indeed the transaction worked as expected and <em>all</em> changes were rolled back. We still got an error though! To understand what&#8217;s going on, let&#8217;s see what the error was about.</p><p>First, notice that there were two inserts, one happened in the outer transaction and the second from the inner one, yet both were rolled back (the table should be empty). Then we print the overflow error, which indicates that the second insert in <code>Multi_Insert</code> threw. So far, so good. Then we hit an unanticipated error message. The clue to what happened is in &#8220;Transaction count after EXECUTE [...]&#8220;. It seems that SQL engine is checking for transaction count after <code>EXEC</code> statements. Since we called ROLLBACK in <code>Multi_Insert</code> it seems that this has rolled back not only the inner transaction, but also the outer. This is confirmed by two facts. First, the table hasn&#8217;t been changed and all our inserts have been undone. Second, the inner <code>ROLLBACK</code> does match the <code>BEGIN TRANSACTION</code> in <code>Multi_Insert</code> and so does the pair in <code>SP_Complex</code>. So the only way we could get a mismatch error is if something in <code>Multi_Insert</code> had an effect larger than its scope. (Also, what&#8217;s with &#8220;Transaction count&#8221; references?)</p><p>To see what actually happened, let&#8217;s trace the execution path:</p><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
ALTER PROCEDURE [Multi_Insert]
AS
BEGIN TRY
	BEGIN TRANSACTION
		PRINT 'IN [Multi_Insert]. Transactions: ' + Convert(varchar, @@TRANCOUNT);
		-- Normal case
		INSERT INTO Tee VALUES(1);
		-- Overflow case
		INSERT INTO Tee VALUES(2000);
		-- Normal case again
		INSERT INTO Tee VALUES(3);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	PRINT 'ERR [Multi_Insert]: ' + ERROR_MESSAGE();
	ROLLBACK TRANSACTION
	PRINT 'Rolled back. Transactions: ' + Convert(varchar, @@TRANCOUNT);
END CATCH
GO

-- Sproc that does complex operations.
ALTER PROCEDURE [SP_Complex]
AS
BEGIN TRY
	BEGIN TRANSACTION
		PRINT 'IN [SP_Complex]. Transactions: ' + Convert(varchar,@@TRANCOUNT);

		-- Normal case
		INSERT INTO Tee VALUES(0);

		-- Execute a bad sproc.
		EXEC Multi_Insert;

		-- Normal case again
		INSERT INTO Tee VALUES(5);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	PRINT 'ERR [SP_Complex]: ' + ERROR_MESSAGE();
	ROLLBACK TRANSACTION
	PRINT 'Rolled back. Transactions: ' + Convert(varchar, @@TRANCOUNT);
END CATCH
GO
</pre><p>Results:</p><pre class='brush: plain'>
IN [SP_Complex]. Transactions: 1

(1 row(s) affected)
IN [Multi_Insert]. Transactions: 2

(1 row(s) affected)

(0 row(s) affected)
ERR [Multi_Insert]: Arithmetic overflow error for data type tinyint, value = 2000.
Rolled back. Transactions: 0
ERR [SP_Complex]: Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0.
Msg 3903, Level 16, State 1, Procedure SP_Complex, Line 21
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
Rolled back. Transactions: 0
</pre><p>To get the transaction count we use <code>@@TRANCOUNT</code>. Now if we look at the output from the trace, we&#8217;ll see the exact same thing, except now it&#8217;s obvious that the transaction count is at 2 within the inner transaction, yet after catching the overflow exception and rolling back, the transaction count has dropped to 0! This confirms it. <code>ROLLBACK</code> works not only on the <em>current</em> transaction, but escalates all the way to the top-most transaction. The references to the  &#8220;Previous count = 1, current count = 0.&#8221; is regarding the transaction count before the <code>EXEC</code> statement and after it. The <code>ROLLBACK</code> in <code>Multi_Insert</code> made both the COMMIT and ROLLBACK statements in <code>SP_Complex</code> obsolete, or rather invalid.</p><h3>Correct Nesting</h3><pre class="brush:sql">
-- Sproc to do multiple inserts with failure.
ALTER PROCEDURE [Multi_Insert]
AS
BEGIN TRY
	BEGIN TRANSACTION
		PRINT 'IN [Multi_Insert]. Transactions: ' + Convert(varchar, @@TRANCOUNT);
		-- Normal case
		INSERT INTO Tee VALUES(1);
		-- Overflow case
		INSERT INTO Tee VALUES(2000);
		-- Normal case again
		INSERT INTO Tee VALUES(3);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	PRINT 'ERR [Multi_Insert]: ' + ERROR_MESSAGE();
	IF (@@TRANCOUNT > 0)
		ROLLBACK TRANSACTION
	PRINT 'Rolled back. Transactions: ' + Convert(varchar, @@TRANCOUNT);
END CATCH
GO

-- Sproc that does complex operations.
ALTER PROCEDURE [SP_Complex]
AS
BEGIN TRY
	BEGIN TRANSACTION
		PRINT 'IN [SP_Complex]. Transactions: ' + Convert(varchar, @@TRANCOUNT);

		-- Normal case
		INSERT INTO Tee VALUES(0);

		-- Execute a bad sproc.
		EXEC Multi_Insert;

		-- Normal case again
		INSERT INTO Tee VALUES(5);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	PRINT 'ERR [SP_Complex]: ' + ERROR_MESSAGE();
	IF (@@TRANCOUNT > 0)
		ROLLBACK TRANSACTION
	PRINT 'Rolled back. Transactions: ' + Convert(varchar, @@TRANCOUNT);
END CATCH
GO
</pre><p>By checking whether or not an inner transaction has rolled back already we avoid any mismatches. This works because using try/catch errors always execute the catch clauses, preventing any statements after the error to execute. If our transactions catch an exception, yet the <code>@@TRANCOUNT</code> is 0, then we must conclude that an inner sproc has made more commits than the transactions it created, or it rolled back the transaction(s). In both cases we must <em>not</em> <code>ROLLBACK</code> unless we have a valid transaction, and we must <em>always</em> <code>ROLLBACK</code> if we&#8217;re in a <code>CATCH</code> clause if we have a valid transaction. Notice that we don&#8217;t check for <code>@@TRANCOUNT</code> to <code>COMMIT TRANSACTION</code>. The reason is because the only case where we could get to it is when the execution of the previous statements are successful. True that if somewhere a mismatched <code>COMMIT</code> is done, we&#8217;ll get a mismatch, but that&#8217;s a programmer error and must not be suppressed. That is, by suppressing that case, our code will not work as expected (in a transaction) because all subsequent statements will execute <em>outside</em> transactions, and therefore can&#8217;t be rolled back. So we let that mismatch blow up.</p><h2>The Template</h2><p>So, now that we have a good understanding of how transactions and error handling works, we can finally create a template that we can reuse, safe in the knowledge that it&#8217;s nestable and will behave as expected in all cases.</p><pre class="brush:sql">
BEGIN TRY
	BEGIN TRANSACTION

	--
	-- YOUR CODE HERE
	--

	-- Don't check for mismatching. Such an error is fatal.
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	-- An inner sproc might have rolled-back already.
	IF (@@TRANCOUNT > 0)
		ROLLBACK TRANSACTION
END CATCH
</pre><p>Full test-bed for reference:</p><pre class="brush:sql">
IF EXISTS(SELECT * FROM sys.sysdatabases where name='DeeBee')
DROP DATABASE DeeBee
GO

-- Create an uncreatively named database.
CREATE DATABASE DeeBee
GO
USE DeeBee
GO

-- Create a table to use for data modification.
CREATE TABLE Tee(
	-- We'll generate overflow exception at will using this field.
	Num TINYINT
)
GO

-- Sproc to do multiple inserts with failure.
CREATE PROCEDURE [Multi_Insert]
AS
BEGIN TRY
	BEGIN TRANSACTION
		PRINT 'IN [Multi_Insert]. Transactions: ' + Convert(varchar, @@TRANCOUNT);
		-- Normal case
		INSERT INTO Tee VALUES(1);
		-- Overflow case
		INSERT INTO Tee VALUES(2000);
		-- Normal case again
		INSERT INTO Tee VALUES(3);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	PRINT 'ERR [Multi_Insert]: ' + ERROR_MESSAGE();
	IF (@@TRANCOUNT > 0)
		ROLLBACK TRANSACTION
	PRINT 'Rolled back. Transactions: ' + Convert(varchar, @@TRANCOUNT);
END CATCH
GO

-- Sproc that does complex operations.
CREATE PROCEDURE [SP_Complex]
AS
BEGIN TRY
	BEGIN TRANSACTION
		PRINT 'IN [SP_Complex]. Transactions: ' + Convert(varchar, @@TRANCOUNT);

		-- Normal case
		INSERT INTO Tee VALUES(0);

		-- Execute a bad sproc.
		EXEC Multi_Insert;

		-- Normal case again
		INSERT INTO Tee VALUES(5);
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	PRINT 'ERR [SP_Complex]: ' + ERROR_MESSAGE();
	IF (@@TRANCOUNT > 0)
		ROLLBACK TRANSACTION
	PRINT 'Rolled back. Transactions: ' + Convert(varchar, @@TRANCOUNT);
END CATCH
GO

-- Clean slate.
DELETE FROM Tee
GO

-- Execute complex statements.
--EXEC Multi_Insert;
EXEC SP_Complex;
GO

-- Check the results
SELECT * FROM Tee
GO
</pre><h2>Conclusion</h2><p>Error handling is often tricky and full of gotcha&#8217;s. We should be careful not to make any unwarranted assumptions, especially when working cross-languages. The error handling, and more importantly transactions, in SQL don&#8217;t necessarily behave like your favorite programming language. By carefully reading documentation, experimenting and adding traces we can get insight and develop robust solutions.</p><p>However the above isn&#8217;t the last word on error handling or transactions. Your needs might be different and your use-cases might dictate other priorities. Perhaps my approach misses some subtle case that you can&#8217;t afford to ignore. Or may be this is good enough for a boilerplate template. Either way, comments, corrections and suggestions are more than welcome.</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F11%2Funderstanding-ms-sql-transactions-and-error-handling%2F&amp;title=Understanding%20MS%20SQL%20Transactions%20and%20Error%20Handling" id="wpa2a_10"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=J3qM3nuols8:KDb6b9obyys:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=J3qM3nuols8:KDb6b9obyys:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=J3qM3nuols8:KDb6b9obyys:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=J3qM3nuols8:KDb6b9obyys:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/J3qM3nuols8" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/11/understanding-ms-sql-transactions-and-error-handling/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/11/understanding-ms-sql-transactions-and-error-handling/</feedburner:origLink></item> <item><title>IDA Pro Video Tutorials</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/4ViYYIMeHaY/</link> <comments>http://blog.ashodnakashian.com/2011/11/ida-pro-video-tutorials/#comments</comments> <pubDate>Sat, 12 Nov 2011 07:52:43 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Guides]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Tools]]></category> <category><![CDATA[Debugger]]></category> <category><![CDATA[Disassembler]]></category> <category><![CDATA[IDA Pro]]></category> <category><![CDATA[Tutorials]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1680</guid> <description><![CDATA[Just discovered a set of IDA Pro video/flash tutorials called TiGa&#8217;s Video Tutorial Series on IDA Pro. For anyone who ever needed to go knee-deep in the native assembly, IDA Pro is an indispensable tool. The only other tool that I&#8217;d put on that same list is WinDbg, of course. IDA Pro not only disassembles <a
href='http://blog.ashodnakashian.com/2011/11/ida-pro-video-tutorials/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>Just discovered a set of <a
href="http://www.hex-rays.com/">IDA Pro</a> video/flash tutorials called <a
href="http://woodmann.com/TiGa/idaseries.html">TiGa&#8217;s Video Tutorial Series on IDA Pro</a>. For anyone who ever needed to go knee-deep in the native assembly, IDA Pro is an indispensable tool. The only other tool that I&#8217;d put on that same list is WinDbg, of course.</p><p>IDA Pro not only disassembles for a multitude of processors/architectures, but it also allows for editing, renaming, commenting the disassembly. On top of all that, it&#8217;s a debugger! With an add-on decompiler, one can even generate C/C++ code from the disassembly for much better and faster insight into the code.</p><p>The thing about these tutorials is that they don&#8217;t have a large audience, so there aren&#8217;t too many of them and the ones that are around are typically old and outdated. At any rate, I was happy to find these, especially that the applications used for the tutorials are made-up and available for download.</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F11%2Fida-pro-video-tutorials%2F&amp;title=IDA%20Pro%20Video%20Tutorials" id="wpa2a_12"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=4ViYYIMeHaY:f0V_YPPoWuI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=4ViYYIMeHaY:f0V_YPPoWuI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=4ViYYIMeHaY:f0V_YPPoWuI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=4ViYYIMeHaY:f0V_YPPoWuI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/4ViYYIMeHaY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/11/ida-pro-video-tutorials/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/11/ida-pro-video-tutorials/</feedburner:origLink></item> <item><title>Intro to Databases Online Video Course</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/sHMnmKuYMdg/</link> <comments>http://blog.ashodnakashian.com/2011/10/intro-to-databases-online-video-course/#comments</comments> <pubDate>Tue, 04 Oct 2011 05:17:11 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Lectures]]></category> <category><![CDATA[Sophia]]></category> <category><![CDATA[eLearning]]></category> <category><![CDATA[Online Courseware]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1646</guid> <description><![CDATA[Stanford is giving the world an opportunity to participate in an Introduction to Databases course. There are many online courses, from MIT to UCBerkeley to Yale and Harvard, but this one a bit different. For a start it&#8217;s going to be live and not a podcast. Participants will get assignments, quizes and, yes, exams! All <a
href='http://blog.ashodnakashian.com/2011/10/intro-to-databases-online-video-course/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>Stanford is giving the world an opportunity to participate in an <a
href="http://www.db-class.org">Introduction to Databases course</a>. There are many online courses, from <a
href="http://ocw.mit.edu/">MIT</a> to <a
href="http://webcast.berkeley.edu/">UCBerkeley</a> to <a
href="http://oyc.yale.edu/">Yale</a> and <a
href="http://www.extension.harvard.edu/distance-education">Harvard</a>, but this one a bit different. For a start it&#8217;s going to be live and not a podcast. Participants will get assignments, quizes and, yes, exams! All of which will be evaluated. There is even a forum and the staff/TAs will participate and the highest voted questions will get responded to by the teacher.</p><p>There are no credits or diplomas, but at the end of the course a statement of accomplishment and a grade relative to others will be given. The website is very usable and the videos even have 1.2x and 1.5x versions for the impatient or busy.</p><p>The courses start on <strong>October 10</strong> through <strong>December 12</strong>. There are already preview videos that one can wet their appetite with. Enrollment is ongoing and as of October 3rd there are over 42,000 students enrolled. According to an introduce-yourself forum thread, there is a 15 year old and a 71 year old!</p><p>If you&#8217;ve always wanted to get some solid introduction to databases but didn&#8217;t have a chance, Professor Jennifer Widom has just given you <a
href="http://www.db-class.org">one</a>.</p><p><strong>Update:</strong> <a
href="http://www.ml-class.org">Machine Learning</a> and <a
href="http://www.ai-class.com">Artificial Intelligence</a> courses are also available simultaneously.</p><p>(If you know of similar live courses, please share them in the comments.)</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F10%2Fintro-to-databases-online-video-course%2F&amp;title=Intro%20to%20Databases%20Online%20Video%20Course" id="wpa2a_14"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=sHMnmKuYMdg:XKLHxaSPj0A:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=sHMnmKuYMdg:XKLHxaSPj0A:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=sHMnmKuYMdg:XKLHxaSPj0A:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sHMnmKuYMdg:XKLHxaSPj0A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/sHMnmKuYMdg" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/10/intro-to-databases-online-video-course/feed/</wfw:commentRss> <slash:comments>3</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/10/intro-to-databases-online-video-course/</feedburner:origLink></item> <item><title>Now Reading Redux 6.1 Released</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/QK8sIuo7YU4/</link> <comments>http://blog.ashodnakashian.com/2011/10/now-reading-redux-6-1-released/#comments</comments> <pubDate>Sun, 02 Oct 2011 11:58:24 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[NRR]]></category> <category><![CDATA[Release]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1639</guid> <description><![CDATA[I&#8217;ve just released Now Reading Redux 6.1 to the general public. NRR is a WordPress plugin for those who read and like to keep their libraries organized. The plugin tracks each book&#8217;s status as read, currently reading or yet to read. Books may be put on hold to be returned to later. Books may be <a
href='http://blog.ashodnakashian.com/2011/10/now-reading-redux-6-1-released/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve just released Now Reading Redux 6.1 to the general public. NRR is a WordPress plugin for those who read and like to keep their libraries organized. The plugin tracks each book&#8217;s status as read, currently reading or yet to read. Books may be put on hold to be returned to later. Books may be reviewed and rated.</p><p>For those who don&#8217;t like sharing all their books with everyone, books may be private only and not public. Private books don&#8217;t show on the public pages and only show when the reader is logged in.</p><p>In this release a new graph is displayed in the Library page to show the books read by month for the past year. For a working example please see <a
href="/library">my library</a>.</p><p>Get it from <a
href="http://wordpress.org/extend/plugins/now-reading-redux/">here</a>. For issues and feature requests please go <a
href="https://github.com/Ashod/Now-Reading-Redux/issues">here</a>.</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F10%2Fnow-reading-redux-6-1-released%2F&amp;title=Now%20Reading%20Redux%206.1%20Released" id="wpa2a_16"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=QK8sIuo7YU4:l2MN1HGHG3I:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=QK8sIuo7YU4:l2MN1HGHG3I:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=QK8sIuo7YU4:l2MN1HGHG3I:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=QK8sIuo7YU4:l2MN1HGHG3I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/QK8sIuo7YU4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/10/now-reading-redux-6-1-released/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/10/now-reading-redux-6-1-released/</feedburner:origLink></item> <item><title>On the Virtues of Solving Unsolvable Problems</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/F8YqbrKBtNo/</link> <comments>http://blog.ashodnakashian.com/2011/09/on-the-virtues-of-solving-unsolvable-problems/#comments</comments> <pubDate>Tue, 27 Sep 2011 05:48:19 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Opinion]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Complexity]]></category> <category><![CDATA[Education]]></category> <category><![CDATA[Optimization]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1610</guid> <description><![CDATA[Haven&#8217;t we all written Fibonacci sequence generators, sorting and searching algorithms and a handful of data-structures while learning to program? What&#8217;s common in these problems is their simplicity. I almost said triviality, but there are nuances that the beginner will stumble in and, hopefully, learn from. (And isn&#8217;t that the whole point of the exercise <a
href='http://blog.ashodnakashian.com/2011/09/on-the-virtues-of-solving-unsolvable-problems/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>Haven&#8217;t we all written <a
class="zem_slink" title="Fibonacci number" href="http://en.wikipedia.org/wiki/Fibonacci_number" rel="wikipedia">Fibonacci sequence</a> generators, sorting and searching algorithms and a handful of data-structures while learning to program? What&#8217;s common in these problems is their simplicity. I almost said triviality, but there are nuances that the beginner will stumble in and, hopefully, learn from. (And isn&#8217;t that the whole point of the exercise anyway?)</p><p>Fibonacci is a great introduction to recursion. Sorting teaches us the fundamentals of algorithms, complexity and of course data-structures and searching. We learn that not all ways of organizing data are born equal. Linked lists have a leg over arrays some of the time, but their ranks are reversed at other times.</p><p>This is how we learn about our tools and how to use them and when. It&#8217;s the equivalent of <a
href="http://www.youtube.com/watch?v=R37pbIySnjg">painting fences</a>. Without these mental gymnastics we&#8217;d have to open up textbooks and look up for &#8220;how to find duplicates in two sets&#8221; or wonder why the data is sometimes shuffled around, but not always (hint: dictionaries typically don&#8217;t preserve order, unless you use one that explicitly guarantees order).</p><p><strong>The answer to &#8220;why is our product all of a sudden too slow and customers are complaining now when it was lightning fast for years?&#8221; isn&#8217;t in any textbook.</strong> However, if one assumes the customer data might have doubled, a seasoned programmer would first check for a quadratic algorithm (or worse) somewhere in the code-path.</p><p>While there is no doubt, at least in my mind, that it&#8217;s absolutely necessary to work out all these contrived problems, from writing a 4-operation calculator with an expression parser to solving <a
href="http://en.wikipedia.org/wiki/Tic-tac-toe">wick wack woe</a>, I think we should include a whole other genre of problems in our training kits.</p><h2>The Unsolvables</h2><p>There is a group of problems that, as far as we know, have no solutions. That is, the solution is known to be found only by brute force or an approximation exists using heuristics (basically trial-and-error or some form of genetic algorithm.) There is the obvious usual-suspects, the <a
class="zem_slink" title="NP-complete" href="http://en.wikipedia.org/wiki/NP-complete" rel="wikipedia">NP-Complete</a> folk. But not only. There are algorithms that run in quadratic and polynomial time that aren&#8217;t practical beyond some size.</p><p><em>There is no better way to get a very real feel of what it means for an algorithm to run in quadratic time than to actually write the code and see how you age as your machine churns away hopelessly, all the while another algorithm with a lower complexity has just finished.</em></p><p>Take Quick sort for example. Implementing the textbook algorithm will work swiftly, that is, until you feed it sorted data. <a
href="http://en.wikipedia.org/wiki/Multiplication_algorithm">Multiplication</a> using the school-method is simple and elegant, until you apply it to large numbers. Trying to optimize such a primitive algorithm is very instructive. It teaches you that it&#8217;s not about optimization; the complexity is inherent. Yet, we don&#8217;t use Merge sort with its O(n log n) <a
class="zem_slink" title="Best, worst and average case" href="http://en.wikipedia.org/wiki/Best%2C_worst_and_average_case" rel="wikipedia">worst case performance</a> and default to Quick sort with its O(n<sup>2</sup>) worst case characteristic. This is not at all obvious to a beginner, and even for many experienced programmers. <strong>Theory and practice sometimes do part ways.</strong> And that&#8217;s yet another important lesson.</p><p><strong>Without attempting to solve a <a
class="zem_slink" title="Travelling salesman problem" href="http://en.wikipedia.org/wiki/Travelling_salesman_problem" rel="wikipedia">travelling salesman problem</a> or a <a
class="zem_slink" title="Knapsack problem" href="http://en.wikipedia.org/wiki/Knapsack_problem" rel="wikipedia">knapsack problem</a> we are in danger of never really understanding why complexity is important. Why some algorithms are hopeless and will get back to haunt you one day, while others seem to be stuck in their misery and can hardly be improved.</strong></p><p>And what better way to understand how and, more importantly, why modern cryptography works than to try to factorize numbers? Searching for prime numbers is yet another long-time problem that only recently it was proved that <a
href="http://en.wikipedia.org/wiki/AKS_primality_test">primality testing is polynomial</a>, and how is all that related to <a
href="http://en.wikipedia.org/wiki/One-way_function">one-way functions</a>.</p><p>There is also another purpose to this exercise. It&#8217;s not obvious where the difficulty of solving these unsolved problems is. At first sight almost anyone presented by such a problem will come up with some solution of sorts. It&#8217;s not until much later, and with much mental effort, that one does notice the errors of their ways. It might be a hidden complexity that they introduced in their algorithm while being oblivious to it that negated the gains they scored elsewhere. It might be that the obvious or straight-forward solution misses a very simple, but equally crucial, case. Or, it may be that their solution is broken in one way or another. Either way, it&#8217;s not enough to know about the problems, their status and move on. There is much to be learned from solving unsolved problems.</p><h2>The Impossibles</h2><p>But why stop there? Why stop at the travelling salesman or a variation of the knapsack problem? <a
href="http://www.scottaaronson.com/writings/bignumbers.html">While we&#8217;re at it</a>, let&#8217;s introduce <a
href="http://en.wikipedia.org/wiki/Noncomputable_function">non-computability</a> and noncomputable functions.</p><p>I&#8217;m sure these topics are very well studied in some grad schools. But the average CS school undergrad would probably firmly believe the fastest growing functions are the exponential. (I still have to get a different answer during an interview.) Whatever happened to <a
href="http://en.wikipedia.org/wiki/Busy_beaver">Busy Beavers</a>? Apparently, a noncomputable can actually grow faster than <em>any</em> computable function! Now try to beat that in the department of slow algorithms.</p><h2>Conclusion</h2><p>I think it would be a great service to our industry if every once in a while the school assigns an unsolvable problem. Send the students home with a travelling salesman problem or two and ask them to bring in the numbers the next week. It&#8217;d prove much more instructive to see the 5-city problem solved in seconds while the 25-city&#8230;</p><p>And who knows, we might as well get a <a
href="http://www.snopes.com/college/homework/unsolvable.asp">Dantzig moment</a>! (Incidentally, <a
href="http://en.wikipedia.org/wiki/George_Dantzig">he</a>&#8216;s the inventor of <a
href="http://en.wikipedia.org/wiki/Simplex_algorithm">Simplex</a>, the single most useful algorithm in optimization.)</p><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F09%2Fon-the-virtues-of-solving-unsolvable-problems%2F&amp;title=On%20the%20Virtues%20of%20Solving%20Unsolvable%20Problems" id="wpa2a_18"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=F8YqbrKBtNo:gCZv3dkCCMo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=F8YqbrKBtNo:gCZv3dkCCMo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=F8YqbrKBtNo:gCZv3dkCCMo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=F8YqbrKBtNo:gCZv3dkCCMo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/F8YqbrKBtNo" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/09/on-the-virtues-of-solving-unsolvable-problems/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/09/on-the-virtues-of-solving-unsolvable-problems/</feedburner:origLink></item> <item><title>Building WebKit on Windows</title><link>http://feedproxy.google.com/~r/ashodnakashian/zpMw/~3/sB3ybDSQiEU/</link> <comments>http://blog.ashodnakashian.com/2011/09/building-webkit-on-windows/#comments</comments> <pubDate>Sun, 25 Sep 2011 09:06:12 +0000</pubDate> <dc:creator>Ashod Nakashian</dc:creator> <category><![CDATA[Guides]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Build]]></category> <category><![CDATA[SDK]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[WebKit]]></category><guid isPermaLink="false">http://blog.ashodnakashian.com/?p=1574</guid> <description><![CDATA[Building a large and complex such as WebKit is anything but straightforward. WebKit is the core of multiple browsers, most notably Safari and Chrome. Even the official instructions are sometimes lacking. This is mostly because such large projects are moving targets and it&#8217;s hard to keep track of all the changes in the requirements. Another <a
href='http://blog.ashodnakashian.com/2011/09/building-webkit-on-windows/'>[...]</a>]]></description> <content:encoded><![CDATA[<p>Building a large and complex such as <a
href="http://www.webkit.org/">WebKit</a> is anything but straightforward. WebKit is the core of multiple browsers, most notably <a
href="http://www.apple.com/safari/download/">Safari</a> and <a
href="http://www.google.com/chrome">Chrome</a>. Even the official instructions are sometimes lacking. This is mostly because such large projects are moving targets and it&#8217;s hard to keep track of all the changes in the requirements. Another issue is that most developers don&#8217;t setup build systems from scratch regularly. Probably no more than once or twice during the lifetime of a project. Even blogs, articles, forums and mailing lists that discuss building WebKit are almost completely outdated.</p><p><a
href="http://www.webkit.org/"><img
class="alignright size-full wp-image-1605" title="WebKit Logo" src="http://blog.ashodnakashian.com/wp-content/uploads/2011/09/webkit-logo.png" alt="" width="211" height="168" /></a></p><p>At any rate, these notes are up-to-date as of September 2011, I hope you find them helpful.</p><h2>Background</h2><p>WebKit can be built in different flavors. The differences are important, because one must setup the build system slightly differently for each flavor. There are essentially 4 different flavors: <em>Apple Windows</em>, <em>WinCairo</em>, <em>Qt</em> and <em>GTK</em>. All four require external libraries to be present for the build to succeed. I have no experience building the <em>Qt</em> and <em>GTK</em> flavors. Here I&#8217;ll cover <em>Apple Windows</em> and <em>WinCairo</em>. I do not cover building <em><a
href="http://www.chromium.org/">Chromium</a></em>.</p><h2>Build Environment</h2><p>There are some common requirements, so first and foremost make sure these are setup correctly. You may follow the instructions described <a
href="http://www.webkit.org/building/tools.html">here</a>. Unless you want to build using VS2005, ignore the instructions on VS2005.</p><p>Here is a summary:</p><ol><li>Install Cygwin. Use <a
href="http://svn.webkit.org/repository/webkit/trunk/Tools/CygwinDownloader/cygwin-downloader.zip">this downloader</a>. Preferably install to <code>C:\cygwin</code> (I&#8217;ll assume that&#8217;s where it is). Never to a path with spaces! Make sure you install: svn, curl, unzip, make, perl, python, gcc, gcc-g++, gcc4, gcc4-g++, bison, flex, gperf.</li><li>Install <a
href="http://developer.apple.com/quicktime/download/">QuickTime SDK</a> in the default location.</li><li>Install <a
href="http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&amp;FamilyID=2c7da5fb-ffbb-4af6-8c66-651cbd28ca15">DirectX SDK</a>. However, if you&#8217;ll build with VS2005, don&#8217;t install anything newer than February 2010. It&#8217;s worth noting that the August 2007 version builds WebKit just fine (as of r95358 with default flags).</li><li>Install Visual Studio 2005 or 2008 with all updates and Service Packs. For VS2005 please refer to the updates listed <a
href="http://www.webkit.org/building/tools.html">here</a>. Personally, I suggest sticking with 2008.</li><li>Install <a
href="http://www.microsoft.com/downloads/details.aspx?familyid=0baf2b35-c656-4969-ace8-e4c0c0716adb&amp;displaylang=en">Windows SDK</a> for Server 2003 R2 or newer. See below for more details.</li><li>Download the <a
href="http://developer.apple.com/opensource/internet/webkit_sptlib_agree.html">Support Libraries</a> from Apple. Copy the file (don&#8217;t extract, just copy the zip) into the WebKit source folder.</li><li>Create WEBKITLIBRARIESDIR and WEBKITOUTPUTDIR environment variables. The values must be fully-qualified Windows paths and not Cygwin/unix paths. If you don&#8217;t want to change you system-wide path, skip this and see the script below.</li></ol><h3>Windows SDK</h3><p>If you have multiple Windows SDKs (as is typically the case when installing multiple Visual Studio versions) then you will have to setup your target Visual Studio to use the SDK of choice. There are two ways to achieve this.</p><p>The first method is to change the BIN, INCLUDE and LIB directories from the Visual Studio Options dialog. From <em>Tools</em> &gt; <em>Options</em> menu, from <em>Projects and Solutions</em> &gt; <em>VC++ Directories</em> page, set the <em>Executable files</em>&#8216;s top entry to <em>%SDK%\bin</em> folder, the <em>%SDK%\lib</em> at the top of the <em>Library files</em> entries and <em>%SDK%\include</em> to the top of the <em>Include files</em>&#8216;s entries. Where <code>%SDK%</code> is the installation path of the SDK. Note: This will change the Visual Studio paths for all instances. So don&#8217;t make this change if other projects depend on your current settings, unless you care more about WebKit, of course.</p><p>The second method is much less intrusive. We can change the environment variables in a shell instance and pass them on to Visual Studio. This is relatively easy and convenient, but will require scripting. In the <em>Tools/Scripts</em> folder of WebKit there is a script called <code>pdevenv</code>. This Perl script is responsible for creating a Windows CMD file which ultimately runs Visual Studio. The reason for this is because <em>Bash</em> can&#8217;t execute the scripts necessary for setting up Visual Studio&#8217;s environment.</p><p>Here is an example of a modified <em>pdevenv</em> script that sets up the SDK:</p><pre class="brush:perl">#!/usr/bin/perl -w

use strict;
use warnings;
use File::Temp qw/tempfile/;
use FindBin;
use lib $FindBin::Bin;
use webkitdirs;

my ($fh, $path) = tempfile(UNLINK =&gt; 0, SUFFIX =&gt; '.cmd') or die;

chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`);
chomp(my $scriptsPath = `cygpath -w "$FindBin::Bin"`);

# Reverse the order of these if you prefer to use VS2008.
my $vsToolsVar;
if ($ENV{'VS80COMNTOOLS'}) {
    $vsToolsVar = "VS80COMNTOOLS";
} elsif ($ENV{'VS90COMNTOOLS'}) {
    $vsToolsVar = "VS90COMNTOOLS";
} else {
    print "*************************************************************\n";
    print "Cannot find Visual Studio tools dir.\n";
    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
    print "is set to a valid location.\n";
    print "*************************************************************\n";
    die;
}

# Comment the following to see the environment variables used.
print $fh "\@echo off\n\n";

# Setup Visual Studio.
print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\n\n";
print $fh "set PATH=$vcBin;$scriptsPath;\%PATH\%\n\n";

# Setup the 2003 SDK. Don't call its own SetEnv as it doesn't detect VS2008 or newer.
print $fh "Set MSSdk=C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\n\n";
print $fh "Set INETSDK=%MSSdk%\n\n";
print $fh "Set MSSdk=%MSSdk%\n\n";
print $fh "Set Mstools=%MSSdk%\n\n";
print $fh "Set Lib=%MSSdk%\\Lib;%Lib%\n\n";
print $fh "Set Include=%MSSdk%\\Include;%Include%\n\n";
print $fh "Set Path=%MSSdk%\\Bin;%MSSdk%\\Bin\\WinNT;%path%\n\n";

# Run Visual Studio.
print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", @ARGV) . ") ELSE ";
print $fh "VCExpress.exe /useenv " . join(" ", @ARGV) . "\n";

close $fh;
chmod 0755, $path;
chomp($path = `cygpath -w -s '$path'`);
exec("cmd /c \"call $path\"");</pre><p><em><strong>Note</strong>: If you already have SDK 6.0, 6.0A, 7.0, 7.0A or 7.1, you should be fine, but be warned: DirectX conflicts with 7.x SDKs, so make sure DirectX headers come after Windows SDK. If you have 6.0 or 6.0A you should have no problems building.</em></p><h3>Building with VS2008</h3><ol><li>Install VS2008 with all Service Packs and updates. (Express version needs a bit of a push to work. Please follow the <a
href="http://fatal-errors.com/visual-studio-crashes-faulting-module-msvcr80-dll/61787">these instructions</a>.)</li><li>Run <code>update-webkit</code> and <code>build-webkit</code> at least once. Regardless of the outcome, delete the contents of WEBKITOUTPUTDIR folder, wherever it is.</li><li>Run VS2008 and open <code>C:\cygwin\home\{username}\WebKitTrunk\Source\WebKit\win\WebKit.vcproj\WebKit.sln</code>. You&#8217;ll be prompted to convert the project files from VS2005 format to 2008. Convert and save-all.</li><li>WebKit projects have no tolerance for warnings and they are set to the highest level. Since VS2008 does emit some superfluous warnings (such as not inlining a force-inline function) the build will fail with these settings. As such, we need to change these setting.<br
/> Select every project that doesn&#8217;t end in &#8220;generated&#8221;, right-click and select Properties. In the Properties window, from the top, change the Configuration to &#8220;All Configurations&#8221;. Navigate to <em>Configuration Properties/C++/General</em> in the left tree and on the right-side change the <em>Warning Level</em> to &#8220;Off: Turn Off All Warnings (/W0)&#8221; and <em>Treat Warnings As Errors</em> to &#8220;No&#8221;. Click OK to close this dialog.<br
/> If you don&#8217;t see C++/General in the left tree it means you selected a non-C++ project. You may do this one project at a time.</li><li>The project files are now ready. Save all and exit Visual Studio.</li></ol><h3>Build Notes</h3><ol><li><strong>Disable Anti-Virus scanners</strong>. (Can you spell incredible?) Cygwin needs to simulate <em>Fork</em>, which needs to clone process memory exactly. Many AV products add system hooks to scan processes in-memory. This disrupts memory layout and DLL relocation results in differences in the memory of forked processes resulting in memory corruption. This issue may never happen even with an AV running. However, if you see <em>fork</em>, out-of-memory or Virtual-Memory allocation failures, try disabling AV and try again. Some don&#8217;t remove their system hooks by temporarily disabling them, so you&#8217;ll need to uninstall them completely.</li><li><strong>Don&#8217;t build the Trunk</strong>. WebKit is large, complex and fast moving. Unless you like testing the limits of your sanity, you may want to stay away from the Trunk, which can be broken and problem-laden. Instead, get a successfully-built and packaged source archive from the <a
href="http://nightly.webkit.org/">nightly builds</a>. At least have one recent successful build from a nightly archive before attempting the Trunk.</li><li><strong>Place Cygwin/bin before others in Path</strong>. In the system path, place CygWin binary folder after System folders but before anything else. Example: <code>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\cygwin\bin;</code>. This will insure that if you have Perl, SVN and other similar utilities installed outside of Cygwin, the Cygwin version will take precendence. NOTE: This may break other products that rely on the non-cygwin variants, in that case, you&#8217;ll have to perform this change in a build-script (see below).</li><li><strong>Place WebKit sources in your Cygwin home directory</strong>. If you install Cygwin in the root, your home should be here: <code>C:\cygwin\home\{username}</code>. WebKit should be in a folder directly within your home. Example: <code>C:\cygwin\home\{username}\webkit</code>.</li><li><strong>Add the scripts folder to the path</strong>. The webkit scripts must be reachable at all times, makes sure <code>C:\cygwin\home\{username}\webkit\Tools\Scripts</code> is prepended to the path.</li><li><strong>Don&#8217;t update the WinCairo code unless you want to build that flavor</strong>. It seems that running <code>update-webkit --wincairo</code> is changing enough in the code that it&#8217;s rendering the Apple Windows flavor broken. If this happens and you can&#8217;t build Apple Windows, then simply delete the <code>WebKitLibraries</code> folder, and run <code>update-webkit</code> (without <code>--wincairo</code>!).</li><li><strong>Run <code>update-webkit</code> at least once</strong>. Even if you don&#8217;t need to update the code, you must run this script at least once. Note that if you&#8217;ve downloaded a nightly-build package this script won&#8217;t update the code to the Trunk! It&#8217;ll only update the support libraries and other scripts.</li><li><strong>You may have to build twice before it works</strong>. The build almost always fails the first time and after deleting the WEBKITOUTPUTDIR folder, so the build script must be executed more than once to get a successful build.</li><li><strong>Look for the <em>first</em> failed project to fix errors</strong>. Since the WebKit build copies many source files as well as output binaries from one project to another, it&#8217;s vital that all dependencies of a sub-project succeed before it is built. That is, if a project fails, typically due to missing headers, identifiers etc, before panicking look for the first failed project and try to fix it. Most probably the errors are due to a previously broken dependency. This can get tricky, as some projects depend on external scripts that may be partially completed and stop reporting errors on subsequent builds. In such a case you won&#8217;t see failed dependencies and the sub-project in question would be the first to fail. To make sure this is the case, delete the WEBKITOUTPUTDIR folder and build again. If you get errors, note the first error you got and build again. Repeat this until you get the same error. This is the error you need to fix.</li><li><strong>Disable <em>warning as error</em></strong>. If you get <code>error C2220: warning treated as error - no 'object' file generated</code> errors, then follow the instruction for disabling <em>warning as error</em> in the <em>Building with VS2008</em> section above.</li></ol><p>Here is a bash script to setup the environment, update and build. You must set your home folder name. Save this file in the webkit folder, name it <em>build</em>.</p><pre class="brush:bash">#! /bin/sh

echo
echo "Exporting environment varibles..."
export PATH=~/webkit/Tools/Scripts:$PATH
export WEBKITLIBRARIESDIR=C:\\cygwin\\home\\{username}\\webkit\\WebKitLibraries\\win
export WEBKITOUTPUTDIR=C:\\cygwin\\home\\{username}\\webkit\\WebKitBuild

echo
echo "Updating source tree..."
update-webkit

echo
echo "Building..."
build-webkit $*</pre><h2>Apple Windows</h2><p>This flavor is the one used by Safari on Windows. The external libraries are copyrighted by Apple and aren&#8217;t redistributable. As such, the build system will require one to manually download an archive holding them from Apple after accepting the license agreement. This build, therefore, cannot be distributed on the internet with the external libraries. Having said that, one should at least try to get this flavor successfully built before attempting others.</p><p>To build this flavor follow these steps:</p><ol><li>Run the Cygwin shell.</li><li>cd webkit</li><li>./build</li></ol><h2>WinCairo</h2><p>To build the WinCairo flavor one had to manually download and install the various libraries, often having to build them manually or get a prebuilt version. Thanks to the efforts of volunteers now the <code>update-webkit</code> script automates all that. If you have built the Apple Windows flavor, you should be able to build WinCairo using the following:</p><ol><li>Run the Cygwin shell.</li><li>cd webkit</li><li>./build <strong>&#8211;wincairo</strong></li></ol><p>If the build fails, try running the build script again.</p><p>However if you get &#8220;CF&#8221; identifier errors, consider updating the CF library manually. All public CF library identifiers and even filenames either begin or end with &#8220;CF&#8221;, so they are easy to spot. WebKit WinCairo uses a modified version of the original Apple sources called <a
href="http://sourceforge.net/projects/opencflite">OpenCFLite</a>. Download a recent version from the <a
href="http://sourceforge.net/projects/opencflite/files/">project&#8217;s page</a> or get the <a
href="http://opencflite.svn.sourceforge.net/viewvc/opencflite/trunk/">trunk</a>. You&#8217;ll have to bite the bullet and build the library yourself, update the headers and libs and build WebKit again.</p><p>To build OpenCFLite, open the solution in VS2005 or 2008 (depending on which you&#8217;ll use for the WebKit build). Choose the Release configuration and build the CFLite project. Ignore the mountain of warning and see if the build succeeded or not. If all goes well, in the root of the OpenCFLite source folder you should see a <code>dist</code> folder. Now copy the contents of dist into <code>%WEBKITLIBRARIESDIR%\win</code> overwriting existing files.</p><p>Delete the <code>%WEBKITLIBRARIESDIR%</code> folder and build Webkit WinCairo again. You should get a clean build.</p><h2>Debugging</h2><p>Now that you have a successful build, you may want to build the Debug version by passing <code>--debug</code> switch to the <code>build-webkit</code> script. You can execute this script directly (without running the above <code>build</code> script or <code>update-webkit</code>) or you can modify the above <code>build</code> script to the same effect.</p><p>With the debug build we can use the Visual Studio debugger or the ultra-powerful <a
href="http://msdn.microsoft.com/en-us/windows/hardware/gg463009">WinDbg</a>. In Visual Studio simply open the solution file from <code>C:\cygwin\home\{username}\WebKitTrunk\Source\WebKit\win\WebKit.vcproj\WebKit.sln</code>, select one of the runner test projects as the startup and hit F5.</p><p>Happy hacking and don&#8217;t forget, you can <a
href="http://www.webkit.org/coding/contributing.html">contribute</a> by submitting bug reports and sending patches and fixes. Good luck.</p><h4>References</h4><p>I couldn&#8217;t have succeeded in building WebKit without the help of numerous developers who shared their experience on the web. Here is a list of the most helpful and relevant pages. Be forewarned however, they are mostly outdated!</p><ul><li><a
href="http://www.webkit.org/building/tools.html">webkit.org/building/tools.html</a></li><li><a
href="http://siphon9.net/loune/2009/07/compiling-webkitcairo-on-windows-with-visual-c-express">Compiling Webkit Cairo on Windows with Visual C Express</a>/</li><li><a
href="http://whtconstruct.blogspot.com/">whtconstruct.blogspot.com</a></li><li><a
href="http://peterdn.com/post/Summer-of-WebKit-Part-1.aspx">Summer of WebKit Part 1</a></li><li><a
href="http://comments.gmane.org/gmane.os.opendarwin.webkit.user/2375">comments.gmane.org/gmane.os.opendarwin.webkit.user/2375</a></li><li><a
href="https://github.com/webkitdotnet/webkitdotnet/wiki/Building-WebKit.NET-with-Visual-Studio-2008-Express%3A-A-Visual-Step-By-Step-Guide">Building WebKit.NET with Visual Studio 2008 Express: A Visual Step By Step Guide</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.ashodnakashian.com%2F2011%2F09%2Fbuilding-webkit-on-windows%2F&amp;title=Building%20WebKit%20on%20Windows" id="wpa2a_20"><img
src="http://blog.ashodnakashian.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=sB3ybDSQiEU:cMPutQjjJ2M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=sB3ybDSQiEU:cMPutQjjJ2M:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?i=sB3ybDSQiEU:cMPutQjjJ2M:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?a=sB3ybDSQiEU:cMPutQjjJ2M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ashodnakashian/zpMw?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ashodnakashian/zpMw/~4/sB3ybDSQiEU" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.ashodnakashian.com/2011/09/building-webkit-on-windows/feed/</wfw:commentRss> <slash:comments>7</slash:comments> <feedburner:origLink>http://blog.ashodnakashian.com/2011/09/building-webkit-on-windows/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 13/58 queries in 0.043 seconds using disk: basic
Object Caching 938/1069 objects using disk: basic

Served from: blog.ashodnakashian.com @ 2012-04-21 22:49:43 -->

