From dfc98a3faeb5bb627f57b423decc2c3c8f61c084 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Tue, 5 Aug 2025 13:45:07 +0100 Subject: [PATCH 01/14] Update WindowsPort.md As per #129 --- docs/Ports/WindowsPort.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index db735175..aef1fe23 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -11,14 +11,16 @@ Install [the latest Visual Studio with "Desktop development with C++" workload]( 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. +- 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 ``` Install pywin32 Python module for run-webkit-tests and git-webkit. From aa4b6c7df69a83abd055a7f6330a7dc94cb3e4cb Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Tue, 12 Aug 2025 14:23:27 +0100 Subject: [PATCH 02/14] Update WindowsPort.md - Make users aware that shallow cloning of the WebKit repo will cause failure - Make users aware that "C++ Clang Tools for Windows" will cause build failure and offer workaround in the Webkit Command Prompt script. - Add option to set ccmake for pch in the Webkit Command Prompt --- docs/Ports/WindowsPort.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index aef1fe23..25741b8a 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -3,10 +3,15 @@ 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 +A full clone of the [Webkit repository](https://github.com/WebKit/WebKit) is required. Shallow cloning will not 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 you have *"C++ Clang Tools for Windows"* installed for the workload, this will take precedence and the build will fail. Explicitilty provide the full path to a alternative llvm `clang-cl.exe` in the Webkit Command Prompt script for this case. + [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. @@ -75,6 +80,8 @@ set DUMPRENDERTREE_TEMP=%TEMP% set CC=clang-cl set CXX=clang-cl +rem set CC=\clang-cl.exe +rem set CXX=\clang-cl.exe rem set http_proxy=http://your-proxy:8080 rem set https_proxy=%http_proxy% @@ -89,6 +96,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 enabled +rem set CCACHE_SLOPPINESS=pch_defines,time_macros + call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat" cd %~dp0 start powershell From 23de9e02155abb0bc979186f15fa7db4a8b59e78 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 15:32:48 +0100 Subject: [PATCH 03/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 25741b8a..a751cf8c 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -4,16 +4,17 @@ It is using [cairo](https://www.cairographics.org/) for the graphics backend, [l It supports only 64 bit Windows. ## Cloning Webkit -A full clone of the [Webkit repository](https://github.com/WebKit/WebKit) is required. Shallow cloning will not work. +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.
+A shallow clone of the WebKit repository at a hash or tag may work if you are just building a release and not intending to develop WebKit. ## 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 you have *"C++ Clang Tools for Windows"* installed for the workload, this will take precedence and the build will fail. Explicitilty provide the full path to a alternative llvm `clang-cl.exe` in the Webkit Command Prompt script for this case. +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. @@ -96,8 +97,8 @@ 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 enabled -rem set CCACHE_SLOPPINESS=pch_defines,time_macros +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 From 6beb1ae0d869762e7217a573a23f7538a7244fe1 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 16:19:55 +0100 Subject: [PATCH 04/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index a751cf8c..bdcbed85 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -5,7 +5,7 @@ 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.
-A shallow clone of the WebKit repository at a hash or tag may work if you are just building a release and not intending to develop WebKit. +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 From 617bab264fe44244258a1b89c2ff2badbce2732d Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 18:36:24 +0100 Subject: [PATCH 05/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index bdcbed85..e65ccd84 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -17,27 +17,29 @@ If have included *C++ Clang Tools for Windows* for the workload, it's Llvm will `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. -- Cmake 4+ has [a dowstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use Cmake 3.31.8. +- Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). Use Python 3.11.x if you experience issues. +- Cmake 4+ has [a dowstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use Cmake 3.x. 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 gperf llvm ninja -choco install -y cmake --version=3.31.8 +```powershell +choco install -y xampp-81 python ruby git gperf llvm ninja +# Use the latest 3.x version of cmake available +choco search -e cmake -a +choco install -y cmake --version=3.??.? ``` Install pywin32 Python module for run-webkit-tests and git-webkit. -``` +```powershell python -m pip install pywin32 ``` Windows Git enables `autocrlf` by default. But, some layout tests files have to be checked out as LF line end style. See [Bug 240158](https://bugs.webkit.org/show_bug.cgi?id=240158). -``` +```powershell git config --global core.autocrlf input ``` From 17f78333ec251b45cc4f332a54cdbf98a6b25e09 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 18:39:44 +0100 Subject: [PATCH 06/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index e65ccd84..3051f4c1 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -28,7 +28,8 @@ XAMPP includes Perl, and running layout tests needs XAMPP. Install XAMPP instead choco install -y xampp-81 python ruby git gperf llvm ninja # Use the latest 3.x version of cmake available choco search -e cmake -a -choco install -y cmake --version=3.??.? +choco install -y cmake --version=3.x.x +choco pin add -n=cmake ``` Install pywin32 Python module for run-webkit-tests and git-webkit. From c413ea1a614b67cc1de647a0a5aee0dc260e8627 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 18:47:12 +0100 Subject: [PATCH 07/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 3051f4c1..b1669a38 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -4,7 +4,7 @@ It is using [cairo](https://www.cairographics.org/) for the graphics backend, [l 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.
+Ensure that you are NOT cloning under an ancestor directory that is a git repository. This may confuse the `build-webkit` script and result in failure. 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 From f17aab2f7b1f6a404e92cd7489d98018eecdd5b1 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 23:32:28 +0100 Subject: [PATCH 08/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index b1669a38..57cf082d 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -18,7 +18,7 @@ If have included *C++ Clang Tools for Windows* for the workload, it's Llvm will Install CMake, Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. - Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). Use Python 3.11.x if you experience issues. -- Cmake 4+ has [a dowstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use Cmake 3.x. +- CMake 4+ has [a dowstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use CMake 3.x. 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. @@ -26,7 +26,7 @@ XAMPP includes Perl, and running layout tests needs XAMPP. Install XAMPP instead ```powershell choco install -y xampp-81 python ruby git gperf llvm ninja -# Use the latest 3.x version of cmake available +# Use the latest 3.x version of CMake available choco search -e cmake -a choco install -y cmake --version=3.x.x choco pin add -n=cmake From 8a3f853f9b67c6033f5731a956dc4740537a8843 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 23:39:00 +0100 Subject: [PATCH 09/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 57cf082d..712851bc 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -29,7 +29,7 @@ choco install -y xampp-81 python ruby git gperf llvm ninja # Use the latest 3.x version of CMake available choco search -e cmake -a choco install -y cmake --version=3.x.x -choco pin add -n=cmake +choco pin add --name="'cmake'" --version="'3.x.x'" --reason="'WebKit downstream issue building woff2 with vcpkg requires CMake < 4'" ``` Install pywin32 Python module for run-webkit-tests and git-webkit. From 4e61b146df618299454accd83dde9f3e2a6853bd Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Wed, 13 Aug 2025 23:41:12 +0100 Subject: [PATCH 10/14] Update WindowsPort.md --- docs/Ports/WindowsPort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 712851bc..8f09f804 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -18,7 +18,7 @@ If have included *C++ Clang Tools for Windows* for the workload, it's Llvm will Install CMake, Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. - Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). Use Python 3.11.x if you experience issues. -- CMake 4+ has [a dowstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use CMake 3.x. +- CMake 4+ has [a downstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use CMake 3.x. 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. From e7e3f6792572c1cb38cbbdf2695733cdd8a240bc Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Thu, 28 Aug 2025 20:00:09 +0100 Subject: [PATCH 11/14] Update WindowsPort.md Add patch fix for CMake complications with woff2 --- docs/Ports/WindowsPort.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 8f09f804..43e46d6a 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -9,7 +9,7 @@ A shallow clone of the WebKit repository at a detached hash may work if you are ## 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). +Install [the latest Visual Studio with "Desktop development with C++" workload](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation). Ensure that "vcpkg" has been included. 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. @@ -18,18 +18,13 @@ If have included *C++ Clang Tools for Windows* for the workload, it's Llvm will Install CMake, Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. - Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). Use Python 3.11.x if you experience issues. -- CMake 4+ has [a downstream problem for vcpkg woff2 at the moment](https://github.com/WebKit/Documentation/issues/129). Use CMake 3.x. - +- 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. ```powershell -choco install -y xampp-81 python ruby git gperf llvm ninja -# Use the latest 3.x version of CMake available -choco search -e cmake -a -choco install -y cmake --version=3.x.x -choco pin add --name="'cmake'" --version="'3.x.x'" --reason="'WebKit downstream issue building woff2 with vcpkg requires CMake < 4'" +choco install -y xampp-81 python ruby git gperf cmake llvm ninja ``` Install pywin32 Python module for run-webkit-tests and git-webkit. @@ -105,6 +100,25 @@ rem set CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_fil call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat" cd %~dp0 + +rem Vcpkg cannot install woff2 with CMake 4+ +rem Apply the patch below to force vcpkg to the VS toolchain bundled version of CMake 3 +rem The WebKit build will still use the CMake on your PATH +rem ( +rem echo diff --git a/WebKitLibraries/triplets/x64-windows-webkit.cmake b/WebKitLibraries/triplets/x64-windows-webkit.cmake +rem echo index 502577b9fe..b06fdcdbda 100644 +rem echo --- a/WebKitLibraries/triplets/x64-windows-webkit.cmake +rem echo +++ b/WebKitLibraries/triplets/x64-windows-webkit.cmake +rem echo @@ -1,3 +1,5 @@ +rem echo +set^(VCPKG_ENV_PASSTHROUGH DevEnvDir^) +rem echo +set^(CMAKE_COMMAND "$ENV{DevEnvDir}CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe"^) +rem echo set^(VCPKG_TARGET_ARCHITECTURE x64^) +rem echo set^(VCPKG_CRT_LINKAGE dynamic^) +rem echo set^(VCPKG_LIBRARY_LINKAGE dynamic^) +rem ) > triplet.patch +rem git apply --whitespace=nowarn triplet.patch 2>nul +rem del triplet.patch + start powershell ``` From be90997b387897f8aebd920194572321af74de6b Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Fri, 29 Aug 2025 11:44:57 +0100 Subject: [PATCH 12/14] Update WindowsPort.md Mixed CMake with patch build fails. Force PATH to bundled CMake 3.x instead. --- docs/Ports/WindowsPort.md | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 43e46d6a..62390def 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -1,6 +1,6 @@ # Windows port -It is using [cairo](https://www.cairographics.org/) for the graphics backend, [libcurl](https://curl.se/libcurl/) for the network backend. +It is using [skia](https://skia.org/) for the graphics backend, [libcurl](https://curl.se/libcurl/) for the network backend. It supports only 64 bit Windows. ## Cloning Webkit @@ -11,20 +11,21 @@ A shallow clone of the WebKit repository at a detached hash may work if you are Install [the latest Visual Studio with "Desktop development with C++" workload](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation). Ensure that "vcpkg" has been included. -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. +If you 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. -Install CMake, Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. +Install Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. - Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). Use Python 3.11.x if you experience issues. -- +- We use CMake 3.x that is bundled with the "Desktop development with C++" workload. Downstream vcpkg Woff2 has problems compiling with CMake 4+. + 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. ```powershell -choco install -y xampp-81 python ruby git gperf cmake llvm ninja +choco install -y xampp-81 python ruby git gperf llvm ninja ``` Install pywin32 Python module for run-webkit-tests and git-webkit. @@ -45,7 +46,7 @@ If you prefer [WinGet](https://learn.microsoft.com/en-us/windows/package-manager Invoke the following command in an elevated PowerShell or cmd prompt. ``` -winget install --scope=machine --id Git.Git Kitware.CMake Ninja-build.Ninja Python.Python.3.11 RubyInstallerTeam.Ruby.3.2 ApacheFriends.Xampp.8.2 LLVM.LLVM +winget install --scope=machine --id Git.Git Ninja-build.Ninja Python.Python.3.11 RubyInstallerTeam.Ruby.3.2 ApacheFriends.Xampp.8.2 LLVM.LLVM winget install --id GnuWin32.Gperf ``` @@ -68,7 +69,6 @@ cd %~dp0 path C:\xampp\apache\bin;%path% path C:\xampp\perl\bin;%path% -path %ProgramFiles%\CMake\bin;%path% path %ProgramFiles(x86)%\Microsoft Visual Studio\Installer;%path% for /F "usebackq delims=" %%I in (`vswhere.exe -latest -property installationPath`) do set VSPATH=%%I @@ -99,26 +99,10 @@ rem You can use ccache with pre-compiled headers @see https://ccache.dev/manual/ rem set CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat" -cd %~dp0 - -rem Vcpkg cannot install woff2 with CMake 4+ -rem Apply the patch below to force vcpkg to the VS toolchain bundled version of CMake 3 -rem The WebKit build will still use the CMake on your PATH -rem ( -rem echo diff --git a/WebKitLibraries/triplets/x64-windows-webkit.cmake b/WebKitLibraries/triplets/x64-windows-webkit.cmake -rem echo index 502577b9fe..b06fdcdbda 100644 -rem echo --- a/WebKitLibraries/triplets/x64-windows-webkit.cmake -rem echo +++ b/WebKitLibraries/triplets/x64-windows-webkit.cmake -rem echo @@ -1,3 +1,5 @@ -rem echo +set^(VCPKG_ENV_PASSTHROUGH DevEnvDir^) -rem echo +set^(CMAKE_COMMAND "$ENV{DevEnvDir}CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe"^) -rem echo set^(VCPKG_TARGET_ARCHITECTURE x64^) -rem echo set^(VCPKG_CRT_LINKAGE dynamic^) -rem echo set^(VCPKG_LIBRARY_LINKAGE dynamic^) -rem ) > triplet.patch -rem git apply --whitespace=nowarn triplet.patch 2>nul -rem del triplet.patch +rem Set PATH to use the VS toolchain bundled CMake 3.x. This ensures that downstream vcpkg builds will succeed. +path %DevEnvDir%CommonExtensions\\Microsoft\\CMake\\CMake\\bin;%path% +cd %~dp0 start powershell ``` From f03dd45fefab4969bdcd951628c6eef10cd9d73d Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Fri, 29 Aug 2025 14:21:35 +0100 Subject: [PATCH 13/14] Update WindowsPort.md Housekeeping, formatting, semantics and update to consider VCPKG build in recent WebKit versions. --- docs/Ports/WindowsPort.md | 106 ++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 62390def..6547bd4c 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -1,5 +1,4 @@ # Windows port - It is using [skia](https://skia.org/) for the graphics backend, [libcurl](https://curl.se/libcurl/) for the network backend. It supports only 64 bit Windows. @@ -7,44 +6,48 @@ It supports only 64 bit Windows. Ensure that you are NOT cloning under an ancestor directory that is a git repository. This may confuse the `build-webkit` script and result in failure. 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 +You may need to [enable Windows long paths](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry) to fully clone the repo sucessfully. -Install [the latest Visual Studio with "Desktop development with C++" workload](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation). Ensure that "vcpkg" has been included. +Windows Git enables `autocrlf` by default, but some layout tests files have to be checked out as LF line end style. See [Bug 240158](https://bugs.webkit.org/show_bug.cgi?id=240158). +``` +git config --global core.autocrlf input +``` -If you 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. +## Installing VS Development Tools and configuring Windows +[Install](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation) VS 2022 and it's "Desktop development with C++" workload. Ensure that "VCPKG" has been enabled for the workload. -[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. +If you have enabled "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 native LLVM's `clang-cl.exe` in the "Webkit command prompt" script described below. -Install Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. -- Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). Use Python 3.11.x if you experience issues. -- We use CMake 3.x that is bundled with the "Desktop development with C++" workload. Downstream vcpkg Woff2 has problems compiling with CMake 4+. - -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. +The `build-webkit` script creates a symlink to a generated `compile_commands.json`, +so [activate Windows developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development#activate-developer-mode) to allow for scripted symlinks. -```powershell -choco install -y xampp-81 python ruby git gperf llvm ninja -``` +## Installing Development Dependencies +Install Windows native Perl, Python, Ruby, gperf \([GnuWin32 Gperf](https://gnuwin32.sourceforge.net/packages/gperf.htm)\), LLVM, and Ninja. -Install pywin32 Python module for run-webkit-tests and git-webkit. +**Notes:** +- Python 3.12+ potentially has [a problem for WebKit in some contexts](https://webkit.org/b/261113). + Use Python 3.11.x if you experience issues. +- Downstream `vcpkg` Woff2 has problems compiling with CMake 4+. + We thus use CMake 3.x that is bundled in the VS 2022 "Desktop development with C++" workload. + +### Using Chocolatey +**Notes:** +- [ActivePerl chocolatey package](https://community.chocolatey.org/packages/ActivePerl) has a problem and no package maintainer at the time of writing. +- XAMPP includes Perl, and running layout tests needs XAMPP. Install XAMPP instead. -```powershell -python -m pip install pywin32 +You can use [Chocolatey](https://community.chocolatey.org/) from an elevated prompt to install the tools. +``` +choco install -y xampp-81 python ruby git gperf llvm ninja ``` -Windows Git enables `autocrlf` by default. But, some layout tests files have to be checked out as LF line end style. See [Bug 240158](https://bugs.webkit.org/show_bug.cgi?id=240158). - -```powershell -git config --global core.autocrlf input +From an elevated prompt, install the `pywin32` Python module if you intend to use the `run-webkit-tests` and `git-webkit` scripts. +``` +python -m pip install pywin32 ``` ### Using WinGet - -If you prefer [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) to Chocolatey, you can use it. -Invoke the following command in an elevated PowerShell or cmd prompt. - +If you prefer [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) to Chocolatey, invoke the following command in an elevated PowerShell or cmd prompt: ``` winget install --scope=machine --id Git.Git Ninja-build.Ninja Python.Python.3.11 RubyInstallerTeam.Ruby.3.2 ApacheFriends.Xampp.8.2 LLVM.LLVM winget install --id GnuWin32.Gperf @@ -56,14 +59,14 @@ WinGet may not append the path into your PC. If some errors occered, please check your path settings, including LLVM and GnuWin32(Gperf). ## WebKit command prompt - To compile, run programs and run tests, you need to set some environment variables. -For ease of development, it's recommended to create a batch file to set environment variables and open PowerShell. -Create a batch file with the following content with adjusting it to your PC. -And put it in the top WebKit source directory. -And double-click it to open PowerShell, we call this opened shell as "WebKit command prompt" hereafter. +For ease of development, it's recommended to create a batch file to set environment variables and open PowerShell: +- Create a `.bat` file with the following content while adjusting it for your PC, +- put it in the top WebKit source directory, +- double-click it to open PowerShell. -``` +We call this opened shell "WebKit command prompt" hereafter. +```.bat @echo off cd %~dp0 @@ -72,20 +75,24 @@ path C:\xampp\perl\bin;%path% path %ProgramFiles(x86)%\Microsoft Visual Studio\Installer;%path% for /F "usebackq delims=" %%I in (`vswhere.exe -latest -property installationPath`) do set VSPATH=%%I +rem Set these for older versions that do not use VCPKG for library building rem set WEBKIT_LIBRARIES=%~dp0WebKitLibraries\win -path %~dp0WebKitLibraries\win\bin;%path% +rem path %~dp0WebKitLibraries\win\bin;%path% + set WEBKIT_TESTFONTS=%~dp0Tools\WebKitTestRunner\fonts set DUMPRENDERTREE_TEMP=%TEMP% set CC=clang-cl set CXX=clang-cl -rem set CC=\clang-cl.exe -rem set CXX=\clang-cl.exe +rem Set full paths if you have "C++ Clang Tools for Windows" enabled in workload. +rem set CC=path-to-native-LLVM\clang-cl.exe +rem set CXX=path-to-native-LLVM\clang-cl.exe rem set http_proxy=http://your-proxy:8080 rem set https_proxy=%http_proxy% -rem You can pass necessary JSC options https://github.com/WebKit/WebKit/blob/main/Source/JavaScriptCore/runtime/OptionsList.h#L83-L607. +rem You can pass necessary JSC options; +rem https://github.com/WebKit/WebKit/blob/main/Source/JavaScriptCore/runtime/OptionsList.h#L83-L607 rem set JSC_dumpOptions=1 rem set JSC_useJIT=0 rem set JSC_useDFGJIT=0 @@ -98,36 +105,34 @@ 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 +rem Set the VC environment variables call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat" + rem Set PATH to use the VS toolchain bundled CMake 3.x. This ensures that downstream vcpkg builds will succeed. path %DevEnvDir%CommonExtensions\\Microsoft\\CMake\\CMake\\bin;%path% cd %~dp0 start powershell ``` - You can replace `powershell` with `cmd` or `wt` (Windows Terminal) if you like. ## Building - -In the WebKit command prompt, invoke `build-webkit` to start building. - +In the WebKit command prompt, invoke `build-webkit` to start building: ``` perl Tools/Scripts/build-webkit --release ``` -You will get required libraries [WebKitRequirements](https://github.com/WebKitForWindows/WebKitRequirements) downloaded automatically when you perform a `build-webkit`. -It checks the latest WebKitRequirements every time. -I'd like to recommend to use `--skip-library-update` for incremental build to speed up for the next time. +Recent WebKit versions will use [VCPKG](https://vcpkg.io) to build the required libraries. +Older versions will automatically download required libraries from [WebKitRequirements](https://github.com/WebKitForWindows/WebKitRequirements) when you perform a `build-webkit`. +It checks the latest WebKitRequirements every time, so it is recommended to use `--skip-library-update` for incremental builds to speed up the next time. ``` python Tools\Scripts\update-webkit-win-libs.py perl Tools\Scripts\build-webkit --release --skip-library-update ``` The build succeeded if you got `WebKit is now built` message. Run your `MiniBrowser`. - ``` WebKitBuild/Release/bin64/MiniBrowser.exe ``` @@ -135,7 +140,6 @@ WebKitBuild/Release/bin64/MiniBrowser.exe You can run programs under a debugger with [this instruction](../Build & Debug/DebuggingWithVS.md). ### Building from within Visual Studio - You can use CMake Visual Studio generator instead of Ninja generator. Install [the LLVM extension](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild) of MSBuild. It bundles a Clang compiler. @@ -143,22 +147,18 @@ But, if the bundled compiler is too old, you might need to [set a custom LLVM lo Instead of creating a Directory.build.props file, you can [set LLVMInstallDir and LLVMToolsVersion environment variables](https://marketplace.visualstudio.com/items?itemName=MarekAniola.mangh-llvm2019). In the WebKit command prompt, - ``` perl Tools/Scripts/build-webkit --release --no-ninja --generate-project-only ``` Open the generated solution file by invoking devenv command from a WebKit command prompt. - ``` devenv WebKitBuild\Release\WebKit.sln ``` Build "MiniBrowser" project. - ## Running the tests - WebKit test runner run-webkit-tests is using a command line debugger [NTSD](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging-using-cdb-and-ntsd) to get crash logs. However, Windows SDK installer doesn't install it by default. @@ -172,14 +172,12 @@ However, Windows SDK installer doesn't install it by default. Install XAMPP as described above. Install required Python and Ruby modules. - ``` python -m pip install pywin32 gem install webrick ``` If Apache service is running, stop it. - ``` net stop apache2.4 ``` @@ -206,7 +204,6 @@ XAMPP contains openssl.exe in C:\xampp\apache\bin directory. Append the director Open the WebKit command prompt as administrator because http tests need to run Apache service. Invoke `run-webkit-tests`. - ``` python Tools/Scripts/run-webkit-tests --release ``` @@ -223,15 +220,12 @@ netsh int ipv4 set dynamicport tcp start=1025 num=64511 ``` ### Running the tests in Docker - You can use Docker to run LayoutTests by mounting the host directory. - ``` docker run -it --rm --cpu-count=8 --memory=16g -v %cd%:c:\repo -w c:\repo webkitdev/msbuild ``` ## Downloading build artifacts from Buildbot - * Go to [Windows-64-bit-Release-Build Buildbot builder page](https://build.webkit.org/#/builders/1192). * Click any "Build #" which is green. * Click the "Archive" link under "compile-webkit" to download the zip From 49c61a19e4ecd2d7bb49d84bc7df2cf349310499 Mon Sep 17 00:00:00 2001 From: Michael Jonker Date: Fri, 29 Aug 2025 15:34:10 +0100 Subject: [PATCH 14/14] Update WindowsPort.md Add link to commit that switches to VCPKG for dependency libs. --- docs/Ports/WindowsPort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Ports/WindowsPort.md b/docs/Ports/WindowsPort.md index 6547bd4c..70d1a858 100644 --- a/docs/Ports/WindowsPort.md +++ b/docs/Ports/WindowsPort.md @@ -123,7 +123,7 @@ In the WebKit command prompt, invoke `build-webkit` to start building: perl Tools/Scripts/build-webkit --release ``` -Recent WebKit versions will use [VCPKG](https://vcpkg.io) to build the required libraries. +[Recent WebKit versions](https://commits.webkit.org/295042@main) will use [VCPKG](https://vcpkg.io) to build the required libraries. Older versions will automatically download required libraries from [WebKitRequirements](https://github.com/WebKitForWindows/WebKitRequirements) when you perform a `build-webkit`. It checks the latest WebKitRequirements every time, so it is recommended to use `--skip-library-update` for incremental builds to speed up the next time.