Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 04c87ca350d12baa5cccf76688771d1c19d520ea
      
https://github.com/WebKit/WebKit/commit/04c87ca350d12baa5cccf76688771d1c19d520ea
  Author: Simon Lewis <[email protected]>
  Date:   2026-05-18 (Mon, 18 May 2026)

  Changed paths:
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/PlatformCocoa.cmake
    M Source/WebKit/PlatformMac.cmake
    M Source/cmake/OptionsMac.cmake
    M Source/cmake/WebKitMacros.cmake
    M Tools/Scripts/swift/swiftc-wrapper.sh
    M Tools/TestWebKitAPI/PlatformMac.cmake

  Log Message:
  -----------
  [CMake][Mac] Build WebBackForwardList.swift and pass TestWebKitAPI 
back/forward tests
https://bugs.webkit.org/show_bug.cgi?id=313969

Reviewed by Adrian Taylor.

Enable ENABLE_BACK_FORWARD_LIST_SWIFT in the CMake Mac port and wire up
the Swift sources (APIArray.swift, StdlibExtras.swift,
WebBackForwardList.swift, generated WebBackForwardListMessageReceiver.swift)
plus the full source-tree WebKit_Internal modulemap so the C++ interop
types (WebPageProxy, SessionState) are visible to Swift.

Drop -explicit-module-build: per-module PCM compiles strip project
-Xcc -include/-I, breaking the C++ interop modules' prefix header.
Implicit builds with a pinned -module-cache-path retain the warm-cache
win without that breakage.

Forward ENABLE_SANITIZERS to swiftc as -sanitize= and to its clang
importer as -Xcc -D__SANITIZE_ADDRESS__/__SANITIZE_THREAD__. The importer
is parse-only and ignores -Xcc -fsanitize= for __has_feature(), so without
the explicit define it sees ASAN_ENABLED=0 -> ENABLE_SECURITY_ASSERTIONS=0
-> RefCountDebuggerImpl members compiled out -> Swift-emitted inline
`new WebBackForwardListMessageForwarder` allocates 32 bytes while the
C++-compiled ctor writes the debug members past that, and ASan reports a
heap-buffer-overflow on every WKWebView creation. Make swiftc-wrapper.sh
pass -Xcc/-Xlinker/-Xfrontend argument pairs through verbatim so the
follow-on arg isn't independently rewritten.

Mark the generated WebBackForwardListMessageReceiver.swift as GENERATED so
configure succeeds on a cold DerivedSources dir; build ordering is already
covered via the sibling .cpp OUTPUT.

Add WebKit_DerivedHeadersForSwift dependency on WebKit_SwiftCxxHeader so
derived headers exist before swiftc -emit-clang-header runs.

Mirror cmakeconfig.h to the importer by iterating
_WEBKIT_CONFIG_FILE_VARIABLES directly. GET_WEBKIT_CONFIG_VARIABLES
filters out every falsy entry, so the importer would otherwise miss every
=0 define and fall back to PlatformEnableCocoa.h defaults -- and any
header member gated on a feature whose default differs from cmakeconfig.h
shifts the offsets Swift inlines against (e.g. WebPageProxy's
m_browsingContextGroup, observed once 276e17367772 started exposing OFF
features). Add UIProcess/Cocoa/Foundation+Extras.swift to the Mac Swift
source list so its `typealias String/URL` is visible -- the Xcode build
and PlatformIOS.cmake already compile it, which is why those builds never
needed any explicit String/URL disambiguation.

* Source/WebKit/CMakeLists.txt:
* Source/WebKit/PlatformCocoa.cmake:
* Source/WebKit/PlatformMac.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitMacros.cmake:
* Tools/Scripts/swift/swiftc-wrapper.sh:
* Tools/TestWebKitAPI/PlatformMac.cmake:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to