<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>280912</bug_id>
          
          <creation_ts>2024-10-04 15:33:40 -0700</creation_ts>
          <short_desc>Can&apos;t build WebKit&apos;s clang module on watchOS/tvOS due to availability errors</short_desc>
          <delta_ts>2024-10-04 15:34:08 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>280734</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Elliott Williams">emw</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2065574</commentid>
    <comment_count>0</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2024-10-04 15:33:40 -0700</bug_when>
    <thetext>As part of merging WebKit&apos;s Swift overlay into the main framework &lt;https://bugs.webkit.org/show_bug.cgi?id=280734&gt;, I&apos;ve experimented with building the overlay APIs for all Apple platforms. Presently the overlay is only built for platforms where WebKit is a public framework.

When I try to build for watchOS/tvOS, I get errors emitting WebKit&apos;s underlying clang module, due to availability. For example:

    WebKit SwiftEmitModule normal arm64 Emitting\ module\ for\ WebKit 
    Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.h:30:9: note: while building module &apos;UIKit&apos; imported from Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.h:30:
    #import &lt;UIKit/NSAttributedString.h&gt;                                 
    &lt;module-includes&gt;:1:9: note: in file included from &lt;module-includes&gt;:1:
    #import &quot;Headers/UIKit.h&quot;                               
    WebKitBuild/Release-appletvsimulator/SDKAdditions/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:20:9: note: in file included from WebKitBuild/Release-appletvsimulator/SDKAdditions/System/Library/Frameworks/UIKit.framewor
    k/Headers/UIKit.h:20:                                          
    #import &lt;UIKit/ShareSheet.h&gt;           
    WebKitBuild/Release-appletvsimulator/SDKAdditions/System/Library/Frameworks/UIKit.framework/Headers/ShareSheet.h:12:9: note: in file included from WebKitBuild/Release-appletvsimulator/SDKAdditions/System/Library/Frameworks/UIKit.fra
    mework/Headers/ShareSheet.h:12:                                 
    #import &lt;UIKit/UIDocumentInteractionController.h&gt;
    WebKitBuild/Release-appletvsimulator/SDKAdditions/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentInteractionController.h:20:98: error: &apos;UIActionSheetDelegate&apos; is unavailable: not available on tvOS
    API_AVAILABLE(ios(3.2)) __TVOS_PROHIBITED @interface UIDocumentInteractionController : NSObject &lt;UIActionSheetDelegate&gt;
    WebKitBuild/Release-appletvsimulator/SDKAdditions/System/Library/Frameworks/UIKit.framework/Headers/UIActionSheet.h:63:11: note: &apos;UIActionSheetDelegate&apos; has been explicitly marked unavailable here
    @protocol UIActionSheetDelegate &lt;NSObject&gt;             
    &lt;module-includes&gt;:1:9: note: in file included from &lt;module-includes&gt;:1:
    #import &quot;Headers/WebKit.h&quot;                         
    WebKitBuild/Release-appletvsimulator/WebKit.framework/Headers/WebKit.h:26:9: note: in file included from WebKitBuild/Release-appletvsimulator/WebKit.framework/Headers/WebKit.h:26:
    #import &lt;WebKit/NSAttributedString.h&gt;                     
    Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.h:30:9: error: could not build module &apos;UIKit&apos;
    #import &lt;UIKit/NSAttributedString.h&gt;        
    &lt;unknown&gt;:0: error: could not build Objective-C module &apos;WebKit&apos;

The problem is &quot;__TVOS_PROHIBITED&quot; indicates that UIDocumentInteractionController is SPI on tvOS. Normally, our &lt;AvailabilityProhibitedInternal.h&gt; header in the appropriate additions SDK in WebKitLibraries/SDKs would suppress this availability marker, but I think it&apos;s being ignored entirely because clang is looking at the `availability` modulemap in the SDK, not importing headers textually. Perhaps we need a new way to suppress availability info for building with modules.

In the meantime, I don&apos;t think this blocks merging the Swift overlay. It just means we cannot bring the overlay API to these two platforms.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2065575</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-10-04 15:34:08 -0700</bug_when>
    <thetext>&lt;rdar://problem/137312444&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>