Skip to content

Commit 965167c

Browse files
committed
[Build] Support public builds on the macOS 26 SDK
https://bugs.webkit.org/show_bug.cgi?id=294213 rdar://152747039 Reviewed by Abrar Rahman Protyasha. Copy SDK additions from macOS Sequoia, and fix a couple build failures in places where code is assuming an internal SDK. Rename the directories containing SPI modules added in https://commits.webkit.org/293940@main. Directory names need to match the module name imported, so that the compiler enters the directory and discovers the modulemap. * Source/WebKit/Platform/cocoa/WKMaterialHostingSupport.swift: * Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI_Private_SPI/WritingToolsUISPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI/WritingToolsUISPI.h. * Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI_Private_SPI/module.modulemap: Renamed from Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI/module.modulemap. * Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools_SPI/WritingToolsSPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools/WritingToolsSPI.h. * Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools_SPI/module.modulemap: Renamed from Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools/module.modulemap. * Source/WebKit/_WebKit_SwiftUI/Implementation/WebViewRepresentable.swift: (WebPageWebView.configureScrollInputBehavior(_:for:)): * WebKitLibraries/SDKs/macosx26.0-additions.sdk/SDKSettings.plist: Added. * WebKitLibraries/SDKs/macosx26.0-additions.sdk/SymlinkedHeaders-output.xcfilelist: Added. * WebKitLibraries/SDKs/macosx26.0-additions.sdk/SymlinkedHeaders.xcfilelist: Added. * WebKitLibraries/SDKs/macosx26.0-additions.sdk/usr/local/include/AvailabilityProhibitedInternal.h: Added. Canonical link: https://commits.webkit.org/296023@main
1 parent 3c907c5 commit 965167c

10 files changed

Lines changed: 85 additions & 1 deletion

File tree

Source/WebKit/Platform/cocoa/WKMaterialHostingSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2222
// THE POSSIBILITY OF SUCH DAMAGE.
2323

24-
#if HAVE_MATERIAL_EFFECT
24+
#if HAVE_MATERIAL_HOSTING
2525

2626
internal import WebKit_Internal
2727

Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI/WritingToolsUISPI.h renamed to Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI_Private_SPI/WritingToolsUISPI.h

File renamed without changes.

Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI/module.modulemap renamed to Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI_Private_SPI/module.modulemap

File renamed without changes.

Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools/WritingToolsSPI.h renamed to Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools_SPI/WritingToolsSPI.h

File renamed without changes.

Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools/module.modulemap renamed to Source/WebKit/Platform/spi/Cocoa/Modules/WritingTools_SPI/module.modulemap

File renamed without changes.

Source/WebKit/_WebKit_SwiftUI/Implementation/WebViewRepresentable.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
internal import SwiftUI
2525
@_spi(CrossImportOverlay) import WebKit
2626

27+
#if !USE_APPLE_INTERNAL_SDK
28+
// Stubs for behavior not implemented in open source.
29+
extension WebPageWebView {
30+
public func configureScrollInputBehavior(_ behavior: Any, for input: Any) { }
31+
}
32+
#endif
33+
2734
@MainActor
2835
struct WebViewRepresentable {
2936
let page: WebPage
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CanonicalName</key>
6+
<string>WebKitSDKAdditions_macosx</string>
7+
<key>HeaderSearchPaths</key>
8+
<array>
9+
<string>usr/local/include</string>
10+
</array>
11+
<key>IsBaseSDK</key>
12+
<string>NO</string>
13+
</dict>
14+
</plist>

WebKitLibraries/SDKs/macosx26.0-additions.sdk/SymlinkedHeaders-output.xcfilelist

Whitespace-only changes.

WebKitLibraries/SDKs/macosx26.0-additions.sdk/SymlinkedHeaders.xcfilelist

Whitespace-only changes.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (C) 2023 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23+
* THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#pragma once
27+
28+
// Handle __IOS_PROHIBITED and friends.
29+
#undef __OS_AVAILABILITY
30+
#define __OS_AVAILABILITY(...)
31+
32+
#undef SWIFT_AVAILABILITY
33+
#define SWIFT_AVAILABILITY __NULL_AVAILABILITY
34+
35+
// Take care of {A,S}PI_DEPRECATED{,WITH_REPLACEMENT}{,_BEGIN,_END}
36+
#undef __API_DEPRECATED_MSG_GET_MACRO
37+
#define __API_DEPRECATED_MSG_GET_MACRO(...) __NULL_AVAILABILITY
38+
39+
// Take care of {A,S}PI_AVAILABLE{,_BEGIN,_END}
40+
#undef __API_AVAILABLE_GET_MACRO
41+
#define __API_AVAILABLE_GET_MACRO(...) __NULL_AVAILABILITY
42+
43+
// Take care of API_UNAVAILABLE{,_BEGIN,_END}
44+
#undef __API_UNAVAILABLE_GET_MACRO
45+
#define __API_UNAVAILABLE_GET_MACRO(...) __NULL_AVAILABILITY
46+
47+
// Starting in iOS 18.4 and aligned SDKs, AvailabilityInternal.h has a hash
48+
// number used to detect accidental use of multiple copies of the library. Keep
49+
// track of known hashes and undef the hashed macro names. When encountering an
50+
// unknown hash, emit an error to avoid confusing build failures.
51+
#define __WEBKIT_OVERRIDDEN_AVAILABILITY_VERSIONS_VERSION_HASH 93585900U
52+
#if defined(__AVAILABILITY_VERSIONS_VERSION_HASH) && (__AVAILABILITY_VERSIONS_VERSION_HASH != 93585900U)
53+
#error __AVAILABILITY_VERSIONS_VERSION_HASH not recognized, please add it to WebKit's AvailabilityProhibitedInternal.h to silence availability errors.
54+
#endif
55+
56+
#ifdef __API_AVAILABLE_GET_MACRO_93585900
57+
#undef __API_AVAILABLE_GET_MACRO_93585900
58+
#define __API_AVAILABLE_GET_MACRO_93585900(...) __NULL_AVAILABILITY
59+
#undef __API_UNAVAILABLE_GET_MACRO_93585900
60+
#define __API_UNAVAILABLE_GET_MACRO_93585900(...) __NULL_AVAILABILITY
61+
#endif
62+
63+
#define __NULL_AVAILABILITY(...)

0 commit comments

Comments
 (0)