Skip to content

[Win] Cross-compiling the Windows port from Linux#57907

Open
iangrunert wants to merge 1 commit intoWebKit:mainfrom
iangrunert:ig/build-win-on-linux-scripts
Open

[Win] Cross-compiling the Windows port from Linux#57907
iangrunert wants to merge 1 commit intoWebKit:mainfrom
iangrunert:ig/build-win-on-linux-scripts

Conversation

@iangrunert
Copy link
Contributor

@iangrunert iangrunert commented Feb 5, 2026

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

Reviewed by NOBODY (OOPS!).

Added check-win-cross-build-deps script, that validates the required
dependencies and helps the user download them as required.

Fixes for case sensitivity issues in header includes.

Using the WebKitLibraries/windows folder as a download location for required
files - Windows SDK, clang_rt builtins, etc.

Changes to build-webkit, webkitdirs.pm to support running build-webkit --win on
a Linux host.

1cb5029

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 ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-debug-arm64 ✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv ✅ 🛠 mac-safer-cpp ✅ 🧪 jsc-armv7-tests
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@iangrunert iangrunert self-assigned this Feb 5, 2026
@iangrunert
Copy link
Contributor Author

This is not yet ready to land, but I want to get EWS feedback to make sure it doesn't break the regular Windows build or any of the other builds.

I need to push a vcpkg release somewhere (likely https://github.com/WebKitForWindows/WebKitRequirements), or fix the vcpkg build on Linux.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 5, 2026
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 7c49cbc to 13ca7bd Compare February 6, 2026 03:59
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 13ca7bd to 12106be Compare February 6, 2026 20:09
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 12106be to 0b9a3a2 Compare February 6, 2026 20:39
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 0b9a3a2 to dc392d9 Compare February 6, 2026 21:14
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from dc392d9 to 01e7f20 Compare February 6, 2026 21:24
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 01e7f20 to 988cf49 Compare February 6, 2026 21:41
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 988cf49 to 82de4ca Compare February 6, 2026 22:11
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 82de4ca to 4ab5a3b Compare February 7, 2026 18:07
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 4ab5a3b to fcb8171 Compare February 11, 2026 19:54
@iangrunert iangrunert marked this pull request as ready for review February 11, 2026 20:16
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from fcb8171 to 4da551a Compare February 17, 2026 20:43
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 4da551a to 2f8876a Compare February 17, 2026 21:02
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 2f8876a to efa0d1d Compare February 17, 2026 21:03
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from efa0d1d to 66b43e4 Compare February 23, 2026 17:36
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 66b43e4 to 13bac0f Compare February 23, 2026 18:41
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 13bac0f to 06aaf3c Compare February 23, 2026 20:56
@iangrunert
Copy link
Contributor Author

I think this is ready to review.

Unfortunately it doesn't work when running an x86_64 Docker container on an ARM64 Mac; this configuration doesn't play nicely with wine (with or without Rosetta). I'm hoping to work on ARM64 builds under a separate bug.

@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 06aaf3c to 550954a Compare February 25, 2026 18:00
Copy link
Member

@gsnedders gsnedders left a comment

Choose a reason for hiding this comment

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

I haven't closely reviewed all the CMake stuff here; the non-CMake changes look fine to me.

One kinda nit, and one question about why we're hardcoding specific versions of Clang/LLVM:

Comment on lines +2880 to +2886
# Force clang-cl-20 for cross-compilation (use absolute paths)
push @args, '-DCMAKE_C_COMPILER=/usr/bin/clang-cl-20';
push @args, '-DCMAKE_CXX_COMPILER=/usr/bin/clang-cl-20';
push @args, '-DCMAKE_LINKER=/usr/bin/lld-link-20';
push @args, '-DCMAKE_AR=/usr/bin/llvm-lib-20';
push @args, '-DCMAKE_RC_COMPILER=/usr/bin/llvm-rc-20';
push @args, '-DCMAKE_MT=/usr/bin/llvm-mt-20';
Copy link
Member

Choose a reason for hiding this comment

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

It feels slightly surprising we're forcing a specific version of LLVM/Clang?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran into a compilation error on LLVM-21 that I felt like it should get reviewed separately, at which point we should be able to relax this to point at non-versioned paths and check LLVM version > 20 inside check-win-cross-build-deps.

Comment on lines +1852 to +1855
sub isWinCrossCompileFromLinux()
{
return isWin() && isLinux();
}
Copy link
Member

Choose a reason for hiding this comment

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

Kinda a nit:

This does have the problem of "if we ever support cross-compiling for Linux from Windows, this is ambiguous".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fair; the flags in general are a little confusing as it's not immediately clear if we're checking "what platform is this running on" or "what port are we building" (e.g. in this case, isWin refers to the port and isLinux refers to the OS it's running on).

Could probably clean up the flags to make it clearer which is being checked.

@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 550954a to 09b6649 Compare February 27, 2026 20:32
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 09b6649 to 236c074 Compare March 5, 2026 04:17
https://bugs.webkit.org/show_bug.cgi?id=282276

Reviewed by NOBODY (OOPS!).

Added check-win-cross-build-deps script, that validates the required
dependencies and helps the user download them as required.

Fixes for case sensitivity issues in header includes.

Using the WebKitLibraries/windows folder as a download location for required
files - Windows SDK, clang_rt builtins, etc.

Changes to build-webkit, webkitdirs.pm to support running build-webkit --win on
a Linux host.

The vcpkg upgrade updated some libraries, which required a couple of fixes:

Curl upgrade required some small changes to CurlRequest fix broken tests.

Harfbuzz upgrade broke a couple of tests - one is marked as a failure already
for glib based ports, the other is similar but we may be on an even newer
version of Harfbuzz compared to WPE / GTK.
@iangrunert iangrunert force-pushed the ig/build-win-on-linux-scripts branch from 236c074 to 1cb5029 Compare March 5, 2026 20:05
@iangrunert
Copy link
Contributor Author

The remaining win-tests failures caused by the curl / harfbuzz version bumps have been fixed.

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

Labels

merging-blocked Applied to prevent a change from being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants