This guide provides instructions for building WebKit on Windows 8.1 without Cygwin (the AppleWin port of WebKit). You can optionally install Cygwin in order to run tests.
Begin by installing the following programs and setting up your environment:
Make sure all the programs you just installed (except Visual Studio and iTunes) are accessible through your
$PATH http://www.itechtics.com/customize-windows-environment-variables/ You may be required to reboot after modifying
$PATH before new shells will see the updated variable.
If you are behind a proxy, be sure to set the
HTTPS_PROXY environment variables.
Tell git your name.
> git config --global user.name "John Smith"
Tell git your email address.
> git config --global user.email "email@example.com"
Download a clone of the repository.
> git clone <git://git.webkit.org/WebKit.git> > cd WebKit
(Optional: If you intend to interact with Subversion patches)
Automatically configure the local clone to follow Subversion:
> python Tools\Scripts\webkit-patch setup-git-clone
Download the WebKit Support Libraries to the root of your source tree https://developer.apple.com/opensource/internet/webkit_sptlib_agree.html If the file is incorrectly named, rename it to WebKitSupportLibrary.zip. Do not extract its contents. This archive includes an SDK (headers only) for the Windows builds of the Apple stack of software (like CoreGraphics, for example).
In addition, you will need to download https://developer.apple.com/opensource/internet/WebKitAuxiliaryLibrary.zip
> cd Tools\Scripts > perl update-webkit
If the above command asks you to reboot your machine, do so.
Note that this command will automatically download WebKitAuxiliaryLibrary.zip from Apple and extract it into your tree (inside the WebKitLibraries folder). This archive includes Windows builds of all the public libraries that WebKit depends on (like libxml2). Note also that this command might set environment variables.
> perl build-webkit
Note that this command will automatically extract WebKitSupportLibrary.zip (which you downloaded in step 6) into your tree (inside the WebKitLibraries folder).
You can build with either Visual Studio 2015 or Visual Studio 2015 Community Edition.
Use the default options for the installation.
Cygwin is a collection of utilities for Windows that includes not only a Subversion client, but also additional tools that are required to build the
WebKit source. We have made a downloader available that automatically collects all of the required packages.
Download cygwin-downloader.zip. Extract the content of the archive to some folder and start
cygwin-downloader.exe from that folder. This will download all the Cygwin packages you need. When all the packages have finished downloading, the Cygwin installer will launch. Choose Install from Local Directory, then click Next until the install is complete. If you are running Vista, the installer won’t be able to launch automatically, so you will have to manually launch Cygwin’s
Note: If you are behind a proxy you need to set the
HTTP_PROXY environment variable to the URL of the proxy. This would likely match this pattern:
http[s]://[username[:password]@]somehost.com[:port]. The square brackets (
[…]) are not part of the URL, but are used to indicate optional elements of the URL.
Note: Vista may warn you that Cygwin did not install correctly. Ignore this warning and tell Vista that the install was successful.
Warning: If you are running Vista or Windows 7, Cygwin may have trouble with implementing
fork (the POSIX function frequently used to start child processes, needed by many of the WebKit build tools). In order to enable
cygwin1.dll to implement fork successfully it is better if no DLL loaded in the parent process is relocated at runtime. One way to achive this is to rebase all cygwin dlls except
cygwin1.dll to base addresses that cause them to not overlap in memory.
In order to rebase all cygwin dlls a
rebaseall script is provided in the cygwin installation’s
bin directory (usually
C:\cygwin\bin). This script must be run from
ash.exe (found in the same directory) while no other cygwin application is running.
ash.exe has very limited command line editing features so cutting and pasting to the commandline is recommended.
PATH environment variable may not contain the
/bin directory by default thus the script should be launched as
rebaseall is complaining about failure to write to a Windows Temp directory (i.e.
/cygdrive/c/Users/you/AppData/Local/Temp), fix the permissions on that folder (i.e.
/bin/chown you /cygdrive/c/Users/you/AppData/Local/Temp) or change the TMP environment variable to point to a directory with the appropriate permission flags
export TMP=/tmp). Note: The rebase process may need to be repeated to include any new libraries added later to cygwin by listing these libraries by full cygwin path in a file and passing the file to
rebaseall via the
-T fileName commandline argument. The dlls under
LayoutTests/http/conf are a relevant use case.
Remove the following lines from
/home/[username]/.bashrc (if present):
unset TMP unset TEMP
Those lines would prevent picking up the Windows TMP and TEMP environment variables.
If you are behind a proxy you need to do the following to allow cygwin svn to get through the proxy (similar steps are available for your Windows svn):
svn help. This will create in your cygwin home directory the file
Download Perl 5.18 (or newer) from activestate.com and install it.
Download Python 2.7.8 from activestate.com and install it.
Download Ruby 2.0.0 from rubyinstaller.org and install it.
Install php, we use the following steps (you need this to run http layout tests):
chmod a+x apt-cya
4. Change line 341 of the
apt-cya script to
wget -nc $mirror/../$install
apt-cyg -m ftp://sourceware.org/pub/cygwinports/x86 install php
Optional: Hotfix for 64-bit Windows (Windows 7 or earlier) to disable the user-mode callback filter for exceptions
Without the 976038 hotfix, exceptions may be thrown in callback routines that do not cause a crash but leave the application in an inconsistent state that might cause a crash later. You will need to click on “View and request hotfix downloads” and fill out the form. A link to download the hotfix and a password will be emailed to you.
Type these commands to check out the WebKit source tree:
tar jxvf WebKit-SVN-source.tar.bz2 cd webkit
Note the archived checkout uses an HTTP connection. We recommend running the following command to use HTTPS instead:
svn switch --relocate http://svn.webkit.org/repository/webkit/trunk https://svn.webkit.org/repository/webkit/trunk
Alternatively, type this command to check out the WebKit source tree:
svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit
Download the WebKit Support Libraries to the root of your source tree (
If the file is incorrectly named, rename it to
WebKitSupportLibrary.zip. Do not extract its contents.
./Tools/Scripts/update-webkit script to update your source tree.
If you downloaded the tarball, this will bring it up to date. Windows users must always execute this command after first obtaining the code, since it will download additional libraries that are needed to build.
Once you have a current tree, the next step is building WebKit.
Windows Error Reporting (WER) has been integrated into the operating system. By default, Windows uploads the crash logs to Microsoft, but does not save a local copy. This is configurable via the registry.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting] "ForceQueue"=dword:00000001
The next time Safari (or any other application) crashes, the crash information will be written into a folder located inside
%LOCALAPPDATA%\Microsoft\Windows\WER\ReportQueue. Check the modification date to make sure you are using the correct file. Be sure to include the following files in your bug report: