Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build failures when importing WebKit, when -DOS_OBJECT_USE_OBJC=0 is set #19087

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

whsieh
Copy link
Member

@whsieh whsieh commented Oct 14, 2023

722fe4f

Fix build failures when importing WebKit, when `-DOS_OBJECT_USE_OBJC=0` is set
https://bugs.webkit.org/show_bug.cgi?id=263156
rdar://114438852

Reviewed by Richard Robinson.

Before iOS 17 / macOS Sonoma, it was possible to pull in WebKit headers (directly, or through Swift
modules) when compiling without ObjC-backed OS objects, by specifying `-DOS_OBJECT_USE_OBJC=0` as a
build setting. Some popular libraries and plugins such as the `flutter_inappwebview` plugin (see
also: <pichillilorenzo/flutter_inappwebview#1735>) use this.

However, after we introduced the following public API in iOS 17:

```
@property (nullable, nonatomic, copy) NSArray<nw_proxy_config_t> *proxyConfigurations;
```

...this became impossible, since `nw_proxy_config_t` would be type-defined to an opaque struct
pointer in `Network.framework`, which is invalid as a type template argument in an `NSArray`. To fix
this, we adopt the same technique used in `Network/NSURLSession+Network.h` and simply expose a
generically-typed `NSArray` in the case where `OS_OBJECT_USE_OBJC` is off.

* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h:

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

51785e5

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@whsieh whsieh requested a review from cdumez as a code owner October 14, 2023 20:02
@whsieh whsieh self-assigned this Oct 14, 2023
@whsieh whsieh added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Oct 14, 2023
@whsieh
Copy link
Member Author

whsieh commented Oct 14, 2023

It looks like flutter_inappwebview already worked around this, but it's probably still worth fixing since there's been at least one other report that's not due to this specific flutter dependency.

@whsieh whsieh added the merge-queue Applied to send a pull request to merge-queue label Oct 16, 2023
@whsieh
Copy link
Member Author

whsieh commented Oct 16, 2023

Thanks for the review!

…0` is set

https://bugs.webkit.org/show_bug.cgi?id=263156
rdar://114438852

Reviewed by Richard Robinson.

Before iOS 17 / macOS Sonoma, it was possible to pull in WebKit headers (directly, or through Swift
modules) when compiling without ObjC-backed OS objects, by specifying `-DOS_OBJECT_USE_OBJC=0` as a
build setting. Some popular libraries and plugins such as the `flutter_inappwebview` plugin (see
also: <pichillilorenzo/flutter_inappwebview#1735>) use this.

However, after we introduced the following public API in iOS 17:

```
@Property (nullable, nonatomic, copy) NSArray<nw_proxy_config_t> *proxyConfigurations;
```

...this became impossible, since `nw_proxy_config_t` would be type-defined to an opaque struct
pointer in `Network.framework`, which is invalid as a type template argument in an `NSArray`. To fix
this, we adopt the same technique used in `Network/NSURLSession+Network.h` and simply expose a
generically-typed `NSArray` in the case where `OS_OBJECT_USE_OBJC` is off.

* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h:

Canonical link: https://commits.webkit.org/269371@main
@webkit-commit-queue
Copy link
Collaborator

Committed 269371@main (722fe4f): https://commits.webkit.org/269371@main

Reviewed commits have been landed. Closing PR #19087 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 16, 2023
@webkit-commit-queue webkit-commit-queue merged commit 722fe4f into WebKit:main Oct 16, 2023
@whsieh whsieh deleted the eng/263156 branch October 17, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
4 participants