Skip to content

[CMake] Integrate vcpkg into Windows build#36366

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
donny-dont:eng/CMake-Integrate-vcpkg-into-Windows-build
May 16, 2025
Merged

[CMake] Integrate vcpkg into Windows build#36366
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
donny-dont:eng/CMake-Integrate-vcpkg-into-Windows-build

Conversation

@donny-dont
Copy link
Contributor

@donny-dont donny-dont commented Nov 8, 2024

32342c7

[CMake] Integrate vcpkg into Windows build
https://bugs.webkit.org/show_bug.cgi?id=282800

Reviewed by Ross Kirsling.

Use `vcpkg` to handle the third party requirements of the Windows WebKit build.
The requirements will be built locally within the build and no longer
distributed from WebKitForWindows/WebKitRequirements. While all port definitions
are in that repository a migration to the canonical vcpkg registry at
Microsoft/vcpkg will be prioritized.

Removes the code that would download prebuilt binaries to `WebKitLibraries/win`.

This change will be used to support additional libraries in the future.

* .gitignore:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsWin.cmake:
* Tools/Scripts/build-webkit:
* Tools/Scripts/download-github-release.py: Removed.
* Tools/Scripts/update-webkit-win-libs.py:
* Tools/Scripts/webkitdirs.pm:
(shouldUseVcpkg):
(generateBuildSystemFromCMakeProject):
(vcpkgArgsFromFeatures):
(windowsLibrariesDir): Deleted.
* Tools/Scripts/webkitperl/BuildSubproject.pm:
* WebKitLibraries/triplets/x64-windows-webkit.cmake: Added.
* vcpkg-configuration.json: Added.
* vcpkg.json: Added.

Canonical link: https://commits.webkit.org/295042@main

9237033

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
💥 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@donny-dont donny-dont self-assigned this Nov 8, 2024
@donny-dont donny-dont added the CMake Bugzilla component for CMake build system changes label Nov 8, 2024
@donny-dont
Copy link
Contributor Author

Needs to be rebased after #36365 lands

@donny-dont
Copy link
Contributor Author

To run create a directory to do the build in and invoke cmake directly replacing the path to your webkit checkout

cmake -DPORT="Win" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" -G Ninja -DDEVELOPER_MODE=ON -DENABLE_EXPERIMENTAL_FEATURES=ON <path-to-WebKit-checkout>

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 8, 2024
@donny-dont donny-dont removed the merging-blocked Applied to prevent a change from being merged label Nov 8, 2024
@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 596b342 to efba267 Compare November 8, 2024 18:37
@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from efba267 to 88b6f96 Compare November 8, 2024 23:30
@donny-dont
Copy link
Contributor Author

Ok so this works locally but will require some changes to the bots to support it.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 9, 2024
@donny-dont donny-dont removed the merging-blocked Applied to prevent a change from being merged label Nov 9, 2024
@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 88b6f96 to 085b077 Compare November 9, 2024 01:22
@donny-dont donny-dont marked this pull request as ready for review November 9, 2024 01:22
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 9, 2024
Copy link
Contributor

@fujii fujii left a comment

Choose a reason for hiding this comment

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

I don't like this approach.

  • Buildbot workers have to compile all required libraries. But, we have no enough VM resources.
  • It increases the built artifact size if all compiled DLL are copies to bin directory. (layout tests bots need built DLLs)

I think current WebKitRequirements64.zip approach is better.

@fujii
Copy link
Contributor

fujii commented Nov 11, 2024

I tried build-webkit --debug on my PC, and got an error.

[3632/6915] Linking CXX shared library bin\WebCore.dll
FAILED: bin/WebCore.dll lib/WebCore.lib
C:\Windows\system32\cmd.exe /C "cd . && C:\tools\cmake\bin\cmake.exe -E vs_link_dll --intdir=Source\WebCore\CMakeFiles\WebCore.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo @CMakeFiles\WebCore.rsp  /out:bin\WebCore.dll /implib:lib\WebCore.lib /pdb:bin\WebCore.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL  /DEBUG /OPT:NOICF /OPT:REF /INCREMENTAL:NO /DELAYLOAD:d3d9.dll /DELAYLOAD:dxva2.dll /DELAYLOAD:evr.dll /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll && C:\Windows\system32\cmd.exe /C "cd /D C:\webkit\wb\WebKitBuild\Debug\Source\WebCore && "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass -file "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/vcpkg/scripts/buildsystems/msbuild/applocal.ps1" -targetBinary C:/webkit/wb/WebKitBuild/Debug/bin/WebCore.dll -installedDir C:/webkit/wb/WebKitBuild/Debug/vcpkg_installed/x64-windows/debug/bin -OutVariable out""
LINK: command "C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo @CMakeFiles\WebCore.rsp /out:bin\WebCore.dll /implib:lib\WebCore.lib /pdb:bin\WebCore.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL /DEBUG /OPT:NOICF /OPT:REF /INCREMENTAL:NO /DELAYLOAD:d3d9.dll /DELAYLOAD:dxva2.dll /DELAYLOAD:evr.dll /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /MANIFEST:EMBED,ID=2" failed (exit code 1) with the following output:
lld-link: error: /failifmismatch: mismatch detected for '_ITERATOR_DEBUG_LEVEL':
>>> Source\WebCore\PAL\pal\CMakeFiles\PAL.dir\.\win\LoggingWin.cpp.obj has value 0
>>> woff2dec.lib(woff2_dec.cc.obj) has value 2
ninja: build stopped: subcommand failed.

@fujii
Copy link
Contributor

fujii commented Nov 11, 2024

  • How and when should buildbot workers wipe out %USERPROFILE%/AppData/Local/vcpkg directory?

@donny-dont donny-dont removed the merging-blocked Applied to prevent a change from being merged label Nov 13, 2024
@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 085b077 to 89c7498 Compare November 13, 2024 00:13
@donny-dont
Copy link
Contributor Author

I tried build-webkit --debug on my PC, and got an error.

[3632/6915] Linking CXX shared library bin\WebCore.dll
FAILED: bin/WebCore.dll lib/WebCore.lib
C:\Windows\system32\cmd.exe /C "cd . && C:\tools\cmake\bin\cmake.exe -E vs_link_dll --intdir=Source\WebCore\CMakeFiles\WebCore.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo @CMakeFiles\WebCore.rsp  /out:bin\WebCore.dll /implib:lib\WebCore.lib /pdb:bin\WebCore.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL  /DEBUG /OPT:NOICF /OPT:REF /INCREMENTAL:NO /DELAYLOAD:d3d9.dll /DELAYLOAD:dxva2.dll /DELAYLOAD:evr.dll /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll && C:\Windows\system32\cmd.exe /C "cd /D C:\webkit\wb\WebKitBuild\Debug\Source\WebCore && "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass -file "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/vcpkg/scripts/buildsystems/msbuild/applocal.ps1" -targetBinary C:/webkit/wb/WebKitBuild/Debug/bin/WebCore.dll -installedDir C:/webkit/wb/WebKitBuild/Debug/vcpkg_installed/x64-windows/debug/bin -OutVariable out""
LINK: command "C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo @CMakeFiles\WebCore.rsp /out:bin\WebCore.dll /implib:lib\WebCore.lib /pdb:bin\WebCore.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL /DEBUG /OPT:NOICF /OPT:REF /INCREMENTAL:NO /DELAYLOAD:d3d9.dll /DELAYLOAD:dxva2.dll /DELAYLOAD:evr.dll /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /MANIFEST:EMBED,ID=2" failed (exit code 1) with the following output:
lld-link: error: /failifmismatch: mismatch detected for '_ITERATOR_DEBUG_LEVEL':
>>> Source\WebCore\PAL\pal\CMakeFiles\PAL.dir\.\win\LoggingWin.cpp.obj has value 0
>>> woff2dec.lib(woff2_dec.cc.obj) has value 2
ninja: build stopped: subcommand failed.

This is resolved now

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 13, 2024
Copy link
Contributor

@fujii fujii left a comment

Choose a reason for hiding this comment

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

Why don't you use GitHub packages binary cache?
https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching

@donny-dont donny-dont removed the merging-blocked Applied to prevent a change from being merged label Nov 16, 2024
@donny-dont donny-dont removed the merging-blocked Applied to prevent a change from being merged label Mar 25, 2025
@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 7da4d15 to 5639869 Compare March 25, 2025 20:39
@iangrunert
Copy link
Contributor

Any update on this @fujii ? I don't think the USE_SKIA build works on main at the moment because the latest WebKitRequirements doesn't include harfbuzz. I think this patch would fix that and make it easier to update the dependencies over time.

@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 5639869 to 8d7ae1b Compare April 3, 2025 17:47
@donny-dont
Copy link
Contributor Author

build-webkit --debug fails. Please test debug build&test before updating this PR.

I'm maintaining 14 Windows buildbot workers. Downloading tarball from official servers will make them flaky. We should use Binary Caching.

I updated the Docker images in docker-webkit-dev and did a build of this patch locally. The first one put artifacts at WebKitForWindows (note that it may not be visible to those without permissions). The second one restored them. See the output 👇

PS C:\webkit> perl .\Tools\Scripts\build-webkit --generate-project-only
+  cmake -DPORT="Win" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-webkit -G Ninja -DDEVELOPER_MODE=ON -DENABLE_EXPERIMENTAL_FEATURES=ON -DVCPKG_MANIFEST_FEATURES=web;jpeg-xl;lcms;cairo;woff2 "C:/webkit"
-- Running vcpkg install
Fetching registry information from https://github.com/WebKitForWindows/WebKitRequirements (HEAD)...
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
Detecting compiler hash for triplet x64-windows...
A suitable version of powershell-core was not found (required v7.2.24).
Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.2.24/PowerShell-7.2.24-win-x64.zip -> PowerShell-7.2.24-win-x64.zip
Successfully downloaded PowerShell-7.2.24-win-x64.zip
Extracting powershell-core...
A suitable version of 7zip was not found (required v24.9.0).
Downloading https://github.com/ip7z/7zip/releases/download/24.09/7z2409.exe -> 7z2409.7z.exe
Successfully downloaded 7z2409.7z.exe
Extracting 7zip...
A suitable version of 7zr was not found (required v24.9.0).
Downloading https://github.com/ip7z/7zip/releases/download/24.09/7zr.exe -> 44d8504a-7zr.exe
Successfully downloaded 44d8504a-7zr.exe
Compiler found: C:/MSVS/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
Detecting compiler hash for triplet x64-windows-webkit...
Compiler found: C:/MSVS/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
The following packages will be built and installed:
    brotli:x64-windows-webkit@1.1.0#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\4e5b5ae1ad26c80535c893cc0307121f0398549e
    cairo:x64-windows-webkit@1.18.2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\d66ade1c9bb9ec902032fad20ac0d975208fedb4
    curl[core,http3,ipv6,libressl]:x64-windows-webkit@8.13.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\cc5115020dc054ffead1ff27fb41a39b9ef9c31b
  * highway:x64-windows-webkit@1.2.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\6084fa0969d208dd78997f44e8b4b406aa174345
    icu:x64-windows-webkit@76.1.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\017ddcb2e0493fecbad3eb52acebc458353ccdb9
    lcms:x64-windows-webkit@2.16 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\781f8c60a57e793ac8b9800b3b7cfa6e46f75b44
    libjpeg-turbo:x64-windows-webkit@3.1.0#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\6180688844449e5724d6dc8eb49ab90124438ce2
    libjxl:x64-windows-webkit@0.11.1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\1b18a67135031ccaa38f55a3f8c0a2dff6082754
    libpng:x64-windows-webkit@1.6.46 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\0074ace75112e0a4ff3465de21e692c07d6e6b5f
    libpsl[core,libicu]:x64-windows-webkit@0.21.5#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\1f1ba362bcb9a330a5882ff668eb7fc3a2c2b6c3
    libressl:x64-windows-webkit@4.0.0#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\becbc2d569c392b3f2d60027db3797b51839c53a
    libwebp[core,libwebpmux,nearlossless,simd,unicode]:x64-windows-webkit@1.5.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\785bb5f8a86b4f67c4186cdb2c7ee09d344dcfff
    libxml2[core,icu]:x64-windows-webkit@2.13.5#2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\90c8aae598f04d95b887f5bfd29e24ab1308bbfa
    libxslt[core,profiler,thread]:x64-windows-webkit@1.1.42#2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\00e5829fca614f1b82dc9fa5439ef0a8d35d7cb4
    nghttp2:x64-windows-webkit@1.65.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\1c6c0f58fa40de3a567e40bcf361c6d448d5f7fb
    nghttp3:x64-windows-webkit@1.8.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\e2baa2babbe24c2c68c68e1dc8f66cc5f6550415
    ngtcp2[core,libressl]:x64-windows-webkit@1.11.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\aa28f3bb1e6ff83a034c6126468849699412a355
  * pixman:x64-windows-webkit@0.44.2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\39c74ae3b4a9b82eb48d08a5c80ddb171817c03c
    sqlite3[core,fts3,json1,rtree]:x64-windows-webkit@3.49.1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\92c7e25e29daa51849b0f0b82bae84898ebb80d9
  * vcpkg-cmake:x64-windows@2024-04-23 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\e74aa1e8f93278a8e71372f1fa08c3df420eb840
  * vcpkg-cmake-config:x64-windows@2024-05-23 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\97a63e4bc1a17422ffe4eff71da53b4b561a7841
  * vcpkg-cmake-get-vars:x64-windows@2024-09-22 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\f23148add155147f3d95ae622d3b0031beb25acf
  * vcpkg-tool-meson:x64-windows@1.6.1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\dc948c67d7f1359319f801078422e996b0a89fd0
    woff2:x64-windows-webkit@1.0.2#4 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\fbd2207ad0ad1e7e52b421b86f96deff9ed7ec65
    zlib:x64-windows-webkit@zlib-ng -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\b7e95e97d224d1a520ec9d5246f76c1e52bb4c8c
  * zlib-ng:x64-windows-webkit@2.2.3#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\8282d357a50be706405e9aed44a79a333a8e8af1
Additional packages (*) will be modified to complete this operation.
Restored 26 package(s) from NuGet in 15 s. Use --debug to see more details.
Installing 1/26 vcpkg-cmake-config:x64-windows@2024-05-23...
Elapsed time to handle vcpkg-cmake-config:x64-windows: 140 ms
vcpkg-cmake-config:x64-windows package ABI: 0408c0ddaacdb1609e91b76b78561e1416aa65a288ca98a83b5e6c7f6c596a8d
Installing 2/26 vcpkg-cmake:x64-windows@2024-04-23...
Elapsed time to handle vcpkg-cmake:x64-windows: 111 ms
vcpkg-cmake:x64-windows package ABI: 55779ee0cf97e43c44324cd2cebe8e813b3aab526fcf4715203f83a99fb6c9d1
Installing 3/26 icu:x64-windows-webkit@76.1.0...
Elapsed time to handle icu:x64-windows-webkit: 2.8 s
icu:x64-windows-webkit package ABI: 6767277326c700e71d1ba0c88c21418acebce9d630ac65a534ead5534a34f056
Installing 4/26 zlib-ng:x64-windows-webkit@2.2.3#1...
Elapsed time to handle zlib-ng:x64-windows-webkit: 240 ms
zlib-ng:x64-windows-webkit package ABI: 743b38b5169e58949b803e502c44e270319bd953bbf0d417633da74cea596837
Installing 5/26 zlib:x64-windows-webkit@zlib-ng...
Elapsed time to handle zlib:x64-windows-webkit: 66.6 ms
zlib:x64-windows-webkit package ABI: f4f7fe272f5d7de5731b3609abb0a03b9f3211c8bc04fef8fce9211eeca8f994
Installing 6/26 vcpkg-cmake-get-vars:x64-windows@2024-09-22...
Elapsed time to handle vcpkg-cmake-get-vars:x64-windows: 93 ms
vcpkg-cmake-get-vars:x64-windows package ABI: 1522f2f862a248cae2cfc3ba9468da02b748d4befa0009d097f0b4cb2d8e355f
Installing 7/26 vcpkg-tool-meson:x64-windows@1.6.1...
Elapsed time to handle vcpkg-tool-meson:x64-windows: 102 ms
vcpkg-tool-meson:x64-windows package ABI: cd2237cebc2042df7ecb53b4b3cc79aebd8bfcd66d91cd047fee6d9ed580d0a2
Installing 8/26 libpng:x64-windows-webkit@1.6.46...
Elapsed time to handle libpng:x64-windows-webkit: 327 ms
libpng:x64-windows-webkit package ABI: be0bbfbee8b3b3381b6fc032f865d05f5e2c7e874747360f32485f0445926136
Installing 9/26 pixman:x64-windows-webkit@0.44.2...
Elapsed time to handle pixman:x64-windows-webkit: 126 ms
pixman:x64-windows-webkit package ABI: 60f9d3f8cc27fcfedc26a84b156b0be8a601ebb3eca1e54370e9eb35ba06bac2
Installing 10/26 cairo:x64-windows-webkit@1.18.2...
Elapsed time to handle cairo:x64-windows-webkit: 290 ms
cairo:x64-windows-webkit package ABI: 28e7dfd56762f23f22a3b6e1d4b88bd212c66cf5b7432ba4d690332a8574f6bb
Installing 11/26 lcms:x64-windows-webkit@2.16...
Elapsed time to handle lcms:x64-windows-webkit: 226 ms
lcms:x64-windows-webkit package ABI: bcad59ff281bad28e84758b6f875d84f515c1e07e7713f0b3a76a44783d3561c
Installing 12/26 highway:x64-windows-webkit@1.2.0...
Elapsed time to handle highway:x64-windows-webkit: 521 ms
highway:x64-windows-webkit package ABI: b8264269220c234d116b1cf18ea27301cfe360db8da7bac3301a4fbef55eb68e
Installing 13/26 brotli:x64-windows-webkit@1.1.0#1...
Elapsed time to handle brotli:x64-windows-webkit: 548 ms
brotli:x64-windows-webkit package ABI: 2008b3d3c47ead4c66b1332d834bda072704260b0e57656e8ba11a5a6b1a03cb
Installing 14/26 libjxl:x64-windows-webkit@0.11.1...
Elapsed time to handle libjxl:x64-windows-webkit: 781 ms
libjxl:x64-windows-webkit package ABI: 0e82470d707d356134f22bd5fbcc531387e3a229bac785b8ec666c998bd19711
Installing 15/26 libressl:x64-windows-webkit@4.0.0#1...
Elapsed time to handle libressl:x64-windows-webkit: 1.2 s
libressl:x64-windows-webkit package ABI: 3c4bcab353e7195822c93aa8903ea0fe8da18eba4eee1481e9490c5afbad68db
Installing 16/26 ngtcp2[core,libressl]:x64-windows-webkit@1.11.0...
Elapsed time to handle ngtcp2:x64-windows-webkit: 419 ms
ngtcp2:x64-windows-webkit package ABI: 93cb2e0136d0888393b7717a081232b4594d9d9e8342cc3d87ea418813329901
Installing 17/26 nghttp3:x64-windows-webkit@1.8.0...
Elapsed time to handle nghttp3:x64-windows-webkit: 297 ms
nghttp3:x64-windows-webkit package ABI: d21f3128346b45f55c59fce30669d893f006648d345581f7eaba639808b690fc
Installing 18/26 nghttp2:x64-windows-webkit@1.65.0...
Elapsed time to handle nghttp2:x64-windows-webkit: 246 ms
nghttp2:x64-windows-webkit package ABI: 0a439b6a369077874867659027bb9194878df50e9207bfa2461f536e99b7abbb
Installing 19/26 curl[core,http3,ipv6,libressl]:x64-windows-webkit@8.13.0...
Elapsed time to handle curl:x64-windows-webkit: 473 ms
curl:x64-windows-webkit package ABI: 2dd29e0feb551b9c5c52e191261b8bc577b94cfb91356b4c958d21d4d7d3baba
Installing 20/26 libjpeg-turbo:x64-windows-webkit@3.1.0#1...
Elapsed time to handle libjpeg-turbo:x64-windows-webkit: 448 ms
libjpeg-turbo:x64-windows-webkit package ABI: 7e3eb3f93f06310a41cc564d23704d6dfff2ffa01373ffbf1b09c4fee3448d9a
Installing 21/26 libpsl[core,libicu]:x64-windows-webkit@0.21.5#1...
Elapsed time to handle libpsl:x64-windows-webkit: 422 ms
libpsl:x64-windows-webkit package ABI: 3c62d32bdf6a220f27922f107fc6f6bf915012547bf15c3239726ded69769ca2
Installing 22/26 libwebp[core,libwebpmux,nearlossless,simd,unicode]:x64-windows-webkit@1.5.0...
Elapsed time to handle libwebp:x64-windows-webkit: 713 ms
libwebp:x64-windows-webkit package ABI: bb8ce14edd7ef6e6a5a34c8684742ab635391f40da481a70b670885d5cd07495
Installing 23/26 libxml2[core,icu]:x64-windows-webkit@2.13.5#2...
Elapsed time to handle libxml2:x64-windows-webkit: 1.2 s
libxml2:x64-windows-webkit package ABI: 9ed4034b111e9606a90e6cef94c179863ed5a576a4d2c50f1cde21526d5ca052
Installing 24/26 libxslt[core,profiler,thread]:x64-windows-webkit@1.1.42#2...
Elapsed time to handle libxslt:x64-windows-webkit: 649 ms
libxslt:x64-windows-webkit package ABI: 959519efdc675b3e1af1c3891147f111a4d8833a744d2eb6b18a9e5edd86c4be
Installing 25/26 sqlite3[core,fts3,json1,rtree]:x64-windows-webkit@3.49.1...
Elapsed time to handle sqlite3:x64-windows-webkit: 373 ms
sqlite3:x64-windows-webkit package ABI: 36e524abc038558437d00e3a212e496d89c67cae7503bb418dc95f4eb11de563
Installing 26/26 woff2:x64-windows-webkit@1.0.2#4...
Elapsed time to handle woff2:x64-windows-webkit: 388 ms
woff2:x64-windows-webkit package ABI: aaa97111aeb3fb0c4203f47cd648a7d78b57704da46b6a09c2b70b28b5bb9eff

The line from ☝️ to note is this one

Restored 26 package(s) from NuGet in 15 s. Use --debug to see more details.

By using Docker images the build environment between bots will be the same so they will hash to the same version. After the first build is done then all bots will get those packages from the configured NuGet feed.

See 👇 for the packages which shows the download count.

github-packages-first

@donny-dont
Copy link
Contributor Author

Updated config to include ICU 77.1

vcpkg x-update-baseline
updated registry 'https://github.com/microsoft/vcpkg': baseline '533a5fda5c0646d1771345fb572e759283444d5f' -> '9b75e789ece3f942159b8500584e35aafe3979ff'
updated registry 'https://github.com/WebKitForWindows/WebKitRequirements': baseline 'aee032959456f198c4cad0d9be09475fa1432629' -> '1da9e582b871b47fbf6d8fb881d25de3bd37cc08'

@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 8d7ae1b to 616c811 Compare April 4, 2025 05:38
@donny-dont
Copy link
Contributor Author

Added the vcpkg binary caching as requested to WebKitForWindows/docker-webkit-dev#408

I ran it locally with the updated requirements and 👇 was pushed. The latest change updated ICU to 77.1.

icu-77

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 4, 2025
@donny-dont donny-dont removed the merging-blocked Applied to prevent a change from being merged label Apr 5, 2025
@donny-dont donny-dont force-pushed the eng/CMake-Integrate-vcpkg-into-Windows-build branch from 616c811 to 5e5416a Compare April 5, 2025 01:24
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 5, 2025
@donny-dont
Copy link
Contributor Author

Using GitHub Packages as a NuGet feed for vcpkg was verified in EWS.

The cache was populated in https://ews-build.webkit.org/#/builders/59/builds/49007 . As an example here's icu 👇

Installing 3/26 icu:x64-windows-webkit@77.1.0...
Building icu:x64-windows-webkit@77.1.0...
C:\BW\Win-Build-EWS\build\WebKitLibraries\triplets\x64-windows-webkit.cmake: info: loaded overlay triplet from here
C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\ea40f10ddf278b30180b541393a9045baebe740c: info: installing overlay port from here
Downloading https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz -> icu4c-77_1-src.tgz
Successfully downloaded icu4c-77_1-src.tgz
-- Extracting source C:/vcpkg/downloads/icu4c-77_1-src.tgz
-- Applying patch C:/Users/ContainerAdministrator/AppData/Local/vcpkg/registries/git-trees/ea40f10ddf278b30180b541393a9045baebe740c/patches/0001-Add-CMake-platform.patch
-- Applying patch C:/Users/ContainerAdministrator/AppData/Local/vcpkg/registries/git-trees/ea40f10ddf278b30180b541393a9045baebe740c/patches/0002-Remove-install-suffix-on-Windows.patch
-- Using source at C:/vcpkg/buildtrees/icu/src/c-77_1-src-e4739f0a52.clean
-- Configuring x64-windows-webkit
-- Building x64-windows-webkit-dbg
-- Building x64-windows-webkit-rel
Downloading msys2-mingw-w64-x86_64-pkgconf-1~2.3.0-1-any.pkg.tar.zst, trying https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.3.0-1-any.pkg.tar.zst
Successfully downloaded msys2-mingw-w64-x86_64-pkgconf-1~2.3.0-1-any.pkg.tar.zst
Downloading msys2-msys2-runtime-3.5.4-2-x86_64.pkg.tar.zst, trying https://mirror.msys2.org/msys/x86_64/msys2-runtime-3.5.4-2-x86_64.pkg.tar.zst
Successfully downloaded msys2-msys2-runtime-3.5.4-2-x86_64.pkg.tar.zst
-- Using msys root at C:/vcpkg/downloads/tools/msys2/21caed2f81ec917b
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/lib/pkgconfig
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/lib/pkgconfig/icu-i18n.pc
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/lib/pkgconfig/icu-io.pc
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/lib/pkgconfig/icu-uc.pc
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/debug/lib/pkgconfig
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/debug/lib/pkgconfig/icu-i18n.pc
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/debug/lib/pkgconfig/icu-io.pc
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/debug/lib/pkgconfig/icu-uc.pc
-- Installing: C:/vcpkg/packages/icu_x64-windows-webkit/share/icu/copyright
-- Performing post-build validation
Starting submission of icu:x64-windows-webkit@77.1.0 to 1 binary cache(s) in the background
Elapsed time to handle icu:x64-windows-webkit: 2.8 min
icu:x64-windows-webkit package ABI: 94d1add935157941e2392ad56e7246e188e78065d71b85fecdd32b70fbeffa8a

The hash from ☝️ is represented in the package listing 👇 .

image

The next build then restored from cache on a different bot because the build environment hash was the same. (this is why the counter is 1 for ☝️). See https://ews-build.webkit.org/#/builders/59/builds/49018 for the complete build.

The following packages will be built and installed:
    brotli:x64-windows-webkit@1.1.0#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\4e5b5ae1ad26c80535c893cc0307121f0398549e
    cairo:x64-windows-webkit@1.18.2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\d66ade1c9bb9ec902032fad20ac0d975208fedb4
    curl[core,http3,ipv6,libressl]:x64-windows-webkit@8.13.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\cc5115020dc054ffead1ff27fb41a39b9ef9c31b
  * highway:x64-windows-webkit@1.2.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\6084fa0969d208dd78997f44e8b4b406aa174345
    icu:x64-windows-webkit@77.1.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\ea40f10ddf278b30180b541393a9045baebe740c
    lcms:x64-windows-webkit@2.16 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\781f8c60a57e793ac8b9800b3b7cfa6e46f75b44
    libjpeg-turbo:x64-windows-webkit@3.1.0#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\6180688844449e5724d6dc8eb49ab90124438ce2
    libjxl:x64-windows-webkit@0.11.1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\1b18a67135031ccaa38f55a3f8c0a2dff6082754
    libpng:x64-windows-webkit@1.6.46 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\0074ace75112e0a4ff3465de21e692c07d6e6b5f
    libpsl[core,libicu]:x64-windows-webkit@0.21.5#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\1f1ba362bcb9a330a5882ff668eb7fc3a2c2b6c3
    libressl:x64-windows-webkit@4.0.0#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\becbc2d569c392b3f2d60027db3797b51839c53a
    libwebp[core,libwebpmux,nearlossless,simd,unicode]:x64-windows-webkit@1.5.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\785bb5f8a86b4f67c4186cdb2c7ee09d344dcfff
    libxml2[core,icu]:x64-windows-webkit@2.13.5#2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\90c8aae598f04d95b887f5bfd29e24ab1308bbfa
    libxslt[core,profiler,thread]:x64-windows-webkit@1.1.42#2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\00e5829fca614f1b82dc9fa5439ef0a8d35d7cb4
    nghttp2:x64-windows-webkit@1.65.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\1c6c0f58fa40de3a567e40bcf361c6d448d5f7fb
    nghttp3:x64-windows-webkit@1.8.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\e2baa2babbe24c2c68c68e1dc8f66cc5f6550415
    ngtcp2[core,libressl]:x64-windows-webkit@1.11.0 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\aa28f3bb1e6ff83a034c6126468849699412a355
  * pixman:x64-windows-webkit@0.44.2 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\39c74ae3b4a9b82eb48d08a5c80ddb171817c03c
    sqlite3[core,fts3,json1,rtree]:x64-windows-webkit@3.49.1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\92c7e25e29daa51849b0f0b82bae84898ebb80d9
  * vcpkg-cmake:x64-windows@2024-04-23 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\e74aa1e8f93278a8e71372f1fa08c3df420eb840
  * vcpkg-cmake-config:x64-windows@2024-05-23 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\97a63e4bc1a17422ffe4eff71da53b4b561a7841
  * vcpkg-cmake-get-vars:x64-windows@2024-09-22 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\f23148add155147f3d95ae622d3b0031beb25acf
  * vcpkg-tool-meson:x64-windows@1.6.1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\dc948c67d7f1359319f801078422e996b0a89fd0
    woff2:x64-windows-webkit@1.0.2#4 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\fbd2207ad0ad1e7e52b421b86f96deff9ed7ec65
    zlib:x64-windows-webkit@zlib-ng -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\b7e95e97d224d1a520ec9d5246f76c1e52bb4c8c
  * zlib-ng:x64-windows-webkit@2.2.3#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\8282d357a50be706405e9aed44a79a333a8e8af1
Additional packages (*) will be modified to complete this operation.
Restored 26 package(s) from NuGet in 13 s. Use --debug to see more details.

So a restore only took 13s. This seems more efficient than the WebKitRequirements.zip.

Overall this is ready to go. The request for binary caching has been done for all bots using Docker. A bot provided by Playwright folks is not using Docker, ews-004, and does not have vcpkg installed. I believe this is due to Visual Studio 2022 build tools which does not package vcpkg. Using the Docker images there or adding in vcpkg like the Docker images is the only thing that needs to be done to land this patch.

@mxschmitt
Copy link
Contributor

We as Playwright have tried this patch and it works well for us (builds successfully and works). It simplifies rolling of dependencies, seems to solve pinning and allows vcpkg caching strategies to get used. Thanks Don for the work and we're excited to get this landed and remove our local vcpkg hacks.

@fujii
Copy link
Contributor

fujii commented Apr 8, 2025

debug builds still have a problem https://bugs.webkit.org/show_bug.cgi?id=287815

@rkirsling
Copy link
Member

rkirsling commented Apr 17, 2025

Given that the error in the linked bug literally says Fatal because this is a curl debug build, it certainly seems reasonable that these cases be marked as debug failures in a test gardening patch—is there any reason to view these as a blocker for merging this PR?

(It's surprising for this to be raised as an issue prior to landing, given that Windows tests are not run via EWS.)

@fujii
Copy link
Contributor

fujii commented Apr 17, 2025

I know it's not a problem for you. You don't maintain Windows WebKit. You don't fix problems for Windows WebKit.
Please adopt vcpkg manifest mode to PlayStation port beforehand. I'm confident it will cause trouble. If it is really nice, I will change my mind.

@donny-dont
Copy link
Contributor Author

Given the needs of the community shipping the Windows port I am confident this solves all the issues with WebKitRequirements.zip. Their concerns with the status quo are valid and need to be prioritized.

This patch has already identified issues in the codebase that weren’t caught because the release crt was used. Using fully debug libraries might identify more issues.

Hypotheticals aren’t a reason to block this patch and not landing this patch is making the windows port less secure.

https://bugs.webkit.org/show_bug.cgi?id=282800

Reviewed by Ross Kirsling.

Use `vcpkg` to handle the third party requirements of the Windows WebKit build.
The requirements will be built locally within the build and no longer
distributed from WebKitForWindows/WebKitRequirements. While all port definitions
are in that repository a migration to the canonical vcpkg registry at
Microsoft/vcpkg will be prioritized.

Removes the code that would download prebuilt binaries to `WebKitLibraries/win`.

This change will be used to support additional libraries in the future.

* .gitignore:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsWin.cmake:
* Tools/Scripts/build-webkit:
* Tools/Scripts/download-github-release.py: Removed.
* Tools/Scripts/update-webkit-win-libs.py:
* Tools/Scripts/webkitdirs.pm:
(shouldUseVcpkg):
(generateBuildSystemFromCMakeProject):
(vcpkgArgsFromFeatures):
(windowsLibrariesDir): Deleted.
* Tools/Scripts/webkitperl/BuildSubproject.pm:
* WebKitLibraries/triplets/x64-windows-webkit.cmake: Added.
* vcpkg-configuration.json: Added.
* vcpkg.json: Added.

Canonical link: https://commits.webkit.org/295042@main
@webkit-commit-queue
Copy link
Collaborator

Committed 295042@main (32342c7): https://commits.webkit.org/295042@main

Reviewed commits have been landed. Closing PR #36366 and removing active labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake Bugzilla component for CMake build system changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants