[webkit-changes] [WebKit/WebKit] 95f293: WebKit engineering builds intermittently fail on n...

Wenson Hsieh noreply at github.com
Sun Feb 25 16:13:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 95f2938cac22780333865b25ca9a6cdcf95e0ad3
      https://github.com/WebKit/WebKit/commit/95f2938cac22780333865b25ca9a6cdcf95e0ad3
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-02-25 (Sun, 25 Feb 2024)

  Changed paths:
    M Source/WTF/wtf/PlatformEnable.h
    M Source/WebKit/Configurations/Base.xcconfig
    M Source/WebKit/Configurations/WebKit.xcconfig
    M Source/WebKit/Configurations/WebKitSwift.xcconfig
    M Source/WebKit/Shared/API/Cocoa/WebKitLegacy.h
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    A Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionItem.h
    A Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionItem.swift
    A Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.h
    A Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.mm
    R Source/WebKit/UIProcess/Cocoa/WKTextExtractionItem.h
    R Source/WebKit/UIProcess/Cocoa/WKTextExtractionUtilities.h
    R Source/WebKit/UIProcess/Cocoa/WKTextExtractionUtilities.mm
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    R Source/WebKit/WebKitSwift/TextExtraction/WKTextExtractionItem.swift
    M Tools/WebKitTestRunner/Configurations/Base.xcconfig
    M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h
    M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm
    M Tools/WebKitTestRunner/cocoa/WKTextExtractionTestingHelpers.h
    M Tools/WebKitTestRunner/cocoa/WKTextExtractionTestingHelpers.mm

  Log Message:
  -----------
  WebKit engineering builds intermittently fail on newer SDK versions
https://bugs.webkit.org/show_bug.cgi?id=269879
rdar://123426004

Reviewed by Richard Robinson.

Refactor TextExtraction support, such that the new swift sources and relevant ObjC bridging exists
purely within WebKit, instead of WebKitSwift. This sidesteps the need for a WebKitSwift dependency
on WebKit due to the `import WebKit`, simplifies the Swift integration by avoiding the need to soft
link all of the text extraction classes, and lastly allows us to avoid soft-linking WebKitSwift when
launching Safari, when text extraction is enabled.

* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setTextExtractionEnabled:]):

There's no need to soft link `libWebKitSwift` when enabling the runtime flag anymore.

* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionItem.h: Renamed from Source/WebKit/UIProcess/Cocoa/WKTextExtractionItem.h.
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionItem.swift: Renamed from Source/WebKit/WebKitSwift/TextExtraction/WKTextExtractionItem.swift.
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.h: Renamed from Source/WebKit/UIProcess/Cocoa/WKTextExtractionUtilities.h.
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WKTextExtractionUtilities.mm.

Move these files into a sub-group (and sub-directory) in `Source/WebKit/UIProcess/Cocoa` for text
extraction support.

(WebKit::containerType):
(WebKit::createWKTextItem):
(WebKit::createItemWithChildren):
(WebKit::createItemRecursive):
(WebKit::createItem):
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h:
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/WebKitTestRunner/Configurations/Base.xcconfig:
* LayoutTests/platform/ios-wk2/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WTF/wtf/PlatformEnable.h:

Add a build-time flag to avoid compiling code that uses `WKTextExtractionItem` (or related classes)
in non-internal watchOS or tvOS builds. Importantly, this means we'll avoid compiling the new Swift
sources on non-internal tvOS and watchOS builders for now where importing the UIKit module fails due
to the way we currently rely on the iOS SDK in `SDKAdditions` when building for watch or TV, thus
sidestepping a build failure.

* Source/WebKit/Configurations/Base.xcconfig:

Add `-experimental-spi-only-imports`.

* Source/WebKit/Configurations/WebKit.xcconfig:

Exclude `WKWebView+TextExtraction.swift` in non-internal SDKs, and additionally exclude
`WKTextExtractionItem.swift` on non-internal tvOS and watchOS SDKs, where
`ENABLE(TEXT_EXTRACTION_SUPPORT)` is disabled altogether.

* Source/WebKit/Configurations/WebKitSwift.xcconfig:
* Source/WebKit/Shared/API/Cocoa/WebKitLegacy.h:

Pulling these Swift sources into WebKit means that all `<WebKit/Foo.h>` header includes in and under
the WebKit umbrella will treat `Foo.h` as project headers in WebKit, rather than the reexported
WebKitLegacy private headers, if the names of the headers match. This is problematic for some of the
headers such as `WebBackForwardList.h`, whose names match both reexported WebKitLegacy headers and
WebKit project headers.

To work around this issue, simply avoid including these reexported legacy headers when creating the
WebKit Swift module on macOS. These headers should not be necessary when building the private Swift
module, which only includes an extension on `WKWebView`.

* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setTextExtractionEnabled:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:

Add `ENABLE(TEXT_EXTRACTION_SUPPORT)` guards around any code that uses the new Swift functionality
in `WKTextExtractionItem.swift`.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionItem.h: Renamed from Source/WebKit/UIProcess/Cocoa/WKTextExtractionItem.h.
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionItem.swift: Renamed from Source/WebKit/WebKitSwift/TextExtraction/WKTextExtractionItem.swift.
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.h: Renamed from Source/WebKit/UIProcess/Cocoa/WKTextExtractionUtilities.h.
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WKTextExtractionUtilities.mm.
(WebKit::createWKTextItem):
(WebKit::createItemWithChildren):
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h:
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/WebKitTestRunner/Configurations/Base.xcconfig:
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h:
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:
* Tools/WebKitTestRunner/cocoa/WKTextExtractionTestingHelpers.h:
* Tools/WebKitTestRunner/cocoa/WKTextExtractionTestingHelpers.mm:

Add more `ENABLE(TEXT_EXTRACTION_SUPPORT)` guards.

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



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


More information about the webkit-changes mailing list