Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2032bf3faac5c20dc8f5f4ffecca5c089b649248
      
https://github.com/WebKit/WebKit/commit/2032bf3faac5c20dc8f5f4ffecca5c089b649248
  Author: Elliott Williams <e...@apple.com>
  Date:   2025-08-01 (Fri, 01 Aug 2025)

  Changed paths:
    M Source/WebKit/Configurations/Base.xcconfig
    A Source/WebKit/Scripts/generate-swift-availability-macros
    M Source/WebKit/Scripts/postprocess-header-rule
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Configurations/TestWebKitAPILibrary.xcconfig

  Log Message:
  -----------
  TBA availability macros in downlevels do not fall back in Swift like they do 
in ObjC
https://bugs.webkit.org/show_bug.cgi?id=294361
rdar://153108566

Reviewed by Alexey Proskuryakov.

Currently, the Swift implementation of WK_MAC_TBA et. al uses a
hard-coded version macro provided by WebKitAdditions.

This is less flexible than the existing ObjC logic (in
postprocess-header-rule). When building downlevels, the availability
version number is unchanged, so Safari is not able to use Swift API from
WebKit marked TBA. [1]

Fix by generating the availability macros at build time, using the same
logic that we have for processing headers.

[1]: There is still a bug where, once a Swift API ships and is given a
fixed availability version, it can no longer be used from downlevels. In
ObjC, we handle this by deleting the WK_API_AVAILABLE attribute entirely
from postprocessed headers, but there is no natural place to do that in
Swift. We'll need to fix this later to support Safari's use of future
WebKit API.

* Source/WebKit/Configurations/Base.xcconfig:
* Source/WebKit/Scripts/generate-swift-availability-macros: Added.
* Source/WebKit/Scripts/postprocess-header-rule: As a drive-by, simplify
  the logic to find and source `postprocess-framework-headers-definitions`.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj: Add the new script
  phase.
* Tools/TestWebKitAPI/Configurations/TestWebKitAPILibrary.xcconfig:
  Remove the config logic to load availability macros, as there's no
  legitimate reason to use TBA macros here (TestWebKitAPI has no
  clients).

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to