Skip to content
19 changes: 16 additions & 3 deletions docs/Ports/WindowsPort.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,30 @@
It is using [cairo](https://www.cairographics.org/) for the graphics backend, [libcurl](https://curl.se/libcurl/) for the network backend.
It supports only 64 bit Windows.

## Cloning Webkit
Ensure that you are NOT cloning under an ancestor directory that is a git repository. This may confuse `build-webkit` script and result in failure.<br>
A shallow clone of the WebKit repository at a detached hash may work if you are just building and not intending to develop WebKit. Official Apple release tags are unlikely to work.

## Installing Development Tools

Install [the latest Visual Studio with "Desktop development with C++" workload](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation).

If have included *C++ Clang Tools for Windows* for the workload, it's Llvm will take precedence and the build may fail. For this scenario, explicitilty provide the full path to an alternative Windows Llvm's `clang-cl.exe` in the Webkit Command Prompt script.

[Activate Developer Mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development#activate-developer-mode).
build-webkit script creates a symlink to a generated compile_commands.json.
`build-webkit` script creates a symlink to a generated compile_commands.json.

Install CMake, Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja.
Python 3.12 has [a problem for WebKit at the moment](https://webkit.org/b/261113). Use Python 3.11.
- Python 3.12 has [a problem for WebKit at the moment](https://webkit.org/b/261113). Use Python 3.11.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not 100% sure this is still an issue and I’m not sure if Python 3.13 is good to use. Might be worth verifying this.

Copy link
Author

@citkane citkane Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.13 (latest choco) compiles WebKit for me with the following caveates:

  • I did not flush ccache or __pycache__
  • I am not building or running any tests
  • I am only building Release

While choco install python311 works, it is no longer on the Chocolately package list. I don't really understand the underlying issue at a low level to make a call on this, but maybe the documentation should advise to do choco install python --version=3.11.x only if problems are experienced?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure if that works because you can have multiple python versions installed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iangrunert any thoughts on this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using Python 3.12 and haven't ran into issues as of yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From CMake configure: -- Found Python: C:/Python313/python.exe (found version "3.13.6") found components: Interpreter

I think this is hard-coded somewhere obfuscated to PATH. I tried setting the PYTHON env variable to something else from the WebKit shell script, and it got overwritten. Chocolately should however fix PATH to whatever version is installed last, even though multiple version remain on disk.

Let me know if we are good with 3.13.x. If so, we can just document python for choco install.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iangrunert @donny-dont
Have you reached any conclusion on how to document Python?

- Cmake 4+ has [a dowstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use Cmake 3.31.8.

You can use [Chocolatey](https://community.chocolatey.org/) to install the tools.
[ActivePerl chocolatey package](https://community.chocolatey.org/packages/ActivePerl) has a problem and no package maintainer now.
XAMPP includes Perl, and running layout tests needs XAMPP. Install XAMPP instead.

```
choco install -y xampp-81 python311 ruby git cmake gperf llvm ninja
choco install -y xampp-81 python311 ruby git gperf llvm ninja
choco install -y cmake --version=3.31.8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a choco pin command with this so when someone upgrades they don’t end up with CMake 4. Ideally the version could be <4.0.0 so if there is another 3.x release it’ll upgrade.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See revised

```

Install pywin32 Python module for run-webkit-tests and git-webkit.
Expand Down Expand Up @@ -73,6 +81,8 @@ set DUMPRENDERTREE_TEMP=%TEMP%

set CC=clang-cl
set CXX=clang-cl
rem set CC=<path-to-llvm>\clang-cl.exe
rem set CXX=<path-to-llvm>\clang-cl.exe

rem set http_proxy=http://your-proxy:8080
rem set https_proxy=%http_proxy%
Expand All @@ -87,6 +97,9 @@ rem set JSC_useDOMJIT=0
rem You can show check TextureMapper FPS via WEBKIT_SHOW_FPS.
rem set WEBKIT_SHOW_FPS=1

rem You can use ccache with pre-compiled headers @see https://ccache.dev/manual/latest.html#_precompiled_headers
rem set CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime

call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
cd %~dp0
start powershell
Expand Down