Bug 1881602 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Some quick notes of things to revisit for the future if/when we return to building webkit ourselves. (note: I spent only a bit of time on looking at this more so out of curiosity)

Building locally is pretty seamless (and very quick compare to e.g. chromium) with the [instructions](https://github.com/WebKit/WebKit?tab=readme-ov-file#building-macos-port) (with the `--release` flag), though it is unclear how to add PGO ourselves.
I found this [script](https://github.com/WebKit/WebKit/blob/3f4bd57a7ba1532a3e48df585f56e6e998acdb2e/Tools/Scripts/build-and-collect-pgo-profiles) which might be what we need? but running it is not straightforward so this needs a thorough look.
also unclear on this [ominous message](https://github.com/WebKit/WebKit/blob/3f4bd57a7ba1532a3e48df585f56e6e998acdb2e/Tools/Scripts/build-and-collect-pgo-profiles#L47). Maybe because the default outputs to /Volumes?

building on CI on the 10.15.x machines has hit some snags as well with regards to the SDK. that we will need some looking into in the future
[[1]](https://treeherder.mozilla.org/jobs?repo=try&tier=1%2C2%2C3&revision=4d702f343cc0c26a4265044a86960542d2c535a5)
```
[task 2024-02-27T16:50:59.662Z] Tools/Scripts/build-webkit --release --architecture="arm64"
[task 2024-02-27T16:50:59.662Z] + Tools/Scripts/build-webkit --release --architecture=arm64
[task 2024-02-27T16:51:02.965Z] Command line invocation:
[task 2024-02-27T16:51:02.966Z]     /Applications/Xcode-12.2.app/Contents/Developer/usr/bin/xcodebuild -scheme "Everything up to WebKit + Tools" -UseSanitizedBuildSystemEnvironment=YES -ShowBuildOperationDuration=YES -workspace /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKit.xcworkspace -configuration Release -destination platform=macOS,devicetype=Mac,arch=arm64 SYMROOT=/opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild OBJROOT=/opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild SHARED_PRECOMPS_DIR=/opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild/PrecompiledHeaders ARCHS=arm64 SDKROOT=macosx
[task 2024-02-27T16:51:02.966Z] 
[task 2024-02-27T16:51:02.966Z] User defaults from command line:
[task 2024-02-27T16:51:02.966Z]     ShowBuildOperationDuration = YES
[task 2024-02-27T16:51:02.966Z]     UseSanitizedBuildSystemEnvironment = YES
[task 2024-02-27T16:51:02.966Z] 
[task 2024-02-27T16:51:02.966Z] Build settings from command line:
[task 2024-02-27T16:51:02.966Z]     ARCHS = arm64
[task 2024-02-27T16:51:02.966Z]     OBJROOT = /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild
[task 2024-02-27T16:51:02.966Z]     SDKROOT = macosx
[task 2024-02-27T16:51:02.966Z]     SHARED_PRECOMPS_DIR = /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild/PrecompiledHeaders
[task 2024-02-27T16:51:02.966Z]     SYMROOT = /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild
[task 2024-02-27T16:51:02.966Z] 
[task 2024-02-27T16:51:04.906Z] 2024-02-27 16:51:04.906 xcodebuild[3566:55375] NOTE: Referenced project libavif was written by a newer Xcode version (56) -- temporarily downgrading it (without modifying project file)
[task 2024-02-27T16:51:04.929Z] 2024-02-27 16:51:04.929 xcodebuild[3566:55375] NOTE: Referenced project dav1d was written by a newer Xcode version (56) -- temporarily downgrading it (without modifying project file)
[task 2024-02-27T16:51:13.680Z] xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, arch:arm64 }
[task 2024-02-27T16:51:13.680Z] 
[task 2024-02-27T16:51:13.680Z] 	Available destinations for the "Everything up to WebKit + Tools" scheme:
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, arch:x86_64, id:2B764F5E-CF0E-5EDC-AC17-578768FB3195 }
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, arch:x86_64, variant:Mac Catalyst, id:2B764F5E-CF0E-5EDC-AC17-578768FB3195 }
[task 2024-02-27T16:51:13.680Z] 
[task 2024-02-27T16:51:13.680Z] 	Ineligible destinations for the "Everything up to WebKit + Tools" scheme:
[task 2024-02-27T16:51:13.680Z] 		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, name:Any Mac }
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, variant:Mac Catalyst, name:Any Mac }
[task 2024-02-27T16:51:13.680Z] 		{ platform:tvOS, id:dvtdevice-DVTiOSDevicePlaceholder-appletvos:placeholder, name:Any tvOS Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:tvOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-appletvsimulator:placeholder, name:Any tvOS Simulator Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:watchOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-watchsimulator:placeholder, name:Any watchOS Simulator Device }
```
[[2]](https://treeherder.mozilla.org/jobs?repo=try&tier=1%2C2%2C3&revision=c4cd1ee1f611e0927258502d423b538f8814e305)
```
Couldn't determine platform name from Xcode SDK at /opt/worker/tasks/task_170896790059093/webkit/WebKit/Tools/Scripts/webkitdirs.pm line 921.
```
not sure if we can cross compile from x86_64 to arm64? (but locally it seems I can cross compile from arm64 to x86_64)
 But also trying to build the x86_64 had issues in CI too. Could be something missing form the xcode/sdk we have
Some quick notes of things to revisit for the future if/when we return to building webkit ourselves. (note: I spent only a bit of time on looking at this more so out of curiosity)

Building locally is pretty seamless (and very quick compare to e.g. chromium) with the [instructions](https://github.com/WebKit/WebKit?tab=readme-ov-file#building-macos-port) (with the `--release` flag), though it is unclear how to add PGO ourselves.
I found this [script](https://github.com/WebKit/WebKit/blob/3f4bd57a7ba1532a3e48df585f56e6e998acdb2e/Tools/Scripts/build-and-collect-pgo-profiles) which might be what we need? but running it is not straightforward so this needs a thorough look.
also unclear on this [ominous message](https://github.com/WebKit/WebKit/blob/3f4bd57a7ba1532a3e48df585f56e6e998acdb2e/Tools/Scripts/build-and-collect-pgo-profiles#L47). Maybe because the default outputs to /Volumes?

building on CI on the 10.15.x machines has hit some snags as well with regards to the SDK. that we will need some looking into in the future
[[1]](https://treeherder.mozilla.org/jobs?repo=try&tier=1%2C2%2C3&revision=4d702f343cc0c26a4265044a86960542d2c535a5)
```
[task 2024-02-27T16:50:59.662Z] Tools/Scripts/build-webkit --release --architecture="arm64"
[task 2024-02-27T16:50:59.662Z] + Tools/Scripts/build-webkit --release --architecture=arm64
[task 2024-02-27T16:51:02.965Z] Command line invocation:
[task 2024-02-27T16:51:02.966Z]     /Applications/Xcode-12.2.app/Contents/Developer/usr/bin/xcodebuild -scheme "Everything up to WebKit + Tools" -UseSanitizedBuildSystemEnvironment=YES -ShowBuildOperationDuration=YES -workspace /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKit.xcworkspace -configuration Release -destination platform=macOS,devicetype=Mac,arch=arm64 SYMROOT=/opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild OBJROOT=/opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild SHARED_PRECOMPS_DIR=/opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild/PrecompiledHeaders ARCHS=arm64 SDKROOT=macosx
[task 2024-02-27T16:51:02.966Z] 
[task 2024-02-27T16:51:02.966Z] User defaults from command line:
[task 2024-02-27T16:51:02.966Z]     ShowBuildOperationDuration = YES
[task 2024-02-27T16:51:02.966Z]     UseSanitizedBuildSystemEnvironment = YES
[task 2024-02-27T16:51:02.966Z] 
[task 2024-02-27T16:51:02.966Z] Build settings from command line:
[task 2024-02-27T16:51:02.966Z]     ARCHS = arm64
[task 2024-02-27T16:51:02.966Z]     OBJROOT = /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild
[task 2024-02-27T16:51:02.966Z]     SDKROOT = macosx
[task 2024-02-27T16:51:02.966Z]     SHARED_PRECOMPS_DIR = /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild/PrecompiledHeaders
[task 2024-02-27T16:51:02.966Z]     SYMROOT = /opt/worker/tasks/task_169711821482996/webkit/WebKit/WebKitBuild
[task 2024-02-27T16:51:02.966Z] 
[task 2024-02-27T16:51:04.906Z] 2024-02-27 16:51:04.906 xcodebuild[3566:55375] NOTE: Referenced project libavif was written by a newer Xcode version (56) -- temporarily downgrading it (without modifying project file)
[task 2024-02-27T16:51:04.929Z] 2024-02-27 16:51:04.929 xcodebuild[3566:55375] NOTE: Referenced project dav1d was written by a newer Xcode version (56) -- temporarily downgrading it (without modifying project file)
[task 2024-02-27T16:51:13.680Z] xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, arch:arm64 }
[task 2024-02-27T16:51:13.680Z] 
[task 2024-02-27T16:51:13.680Z] 	Available destinations for the "Everything up to WebKit + Tools" scheme:
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, arch:x86_64, id:2B764F5E-CF0E-5EDC-AC17-578768FB3195 }
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, arch:x86_64, variant:Mac Catalyst, id:2B764F5E-CF0E-5EDC-AC17-578768FB3195 }
[task 2024-02-27T16:51:13.680Z] 
[task 2024-02-27T16:51:13.680Z] 	Ineligible destinations for the "Everything up to WebKit + Tools" scheme:
[task 2024-02-27T16:51:13.680Z] 		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, name:Any Mac }
[task 2024-02-27T16:51:13.680Z] 		{ platform:macOS, variant:Mac Catalyst, name:Any Mac }
[task 2024-02-27T16:51:13.680Z] 		{ platform:tvOS, id:dvtdevice-DVTiOSDevicePlaceholder-appletvos:placeholder, name:Any tvOS Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:tvOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-appletvsimulator:placeholder, name:Any tvOS Simulator Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device }
[task 2024-02-27T16:51:13.680Z] 		{ platform:watchOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-watchsimulator:placeholder, name:Any watchOS Simulator Device }
```
[[2]](https://treeherder.mozilla.org/jobs?repo=try&tier=1%2C2%2C3&revision=c4cd1ee1f611e0927258502d423b538f8814e305)
```
Couldn't determine platform name from Xcode SDK at /opt/worker/tasks/task_170896790059093/webkit/WebKit/Tools/Scripts/webkitdirs.pm line 921.
```
not sure if we can cross compile from x86_64 to arm64? (but locally it seems I can cross compile from arm64 to x86_64)
 But also trying to build the x86_64 had issues in CI too. Could be something missing form the xcode/sdk we have

Anyway, going to focus on safari TP in the meantime as we've already discussed

Back to Bug 1881602 Comment 5