<?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>314595</bug_id>
          
          <creation_ts>2026-05-11 17:00:06 -0700</creation_ts>
          <short_desc>[CMake] TestWebKitAPI on Mac doesn&apos;t bundle nested resource directories</short_desc>
          <delta_ts>2026-05-11 17:51:32 -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>CMake</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="zak ridouh">zakr</reporter>
          <assigned_to name="zak ridouh">zakr</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2209909</commentid>
    <comment_count>0</comment_count>
    <who name="zak ridouh">zakr</who>
    <bug_when>2026-05-11 17:00:06 -0700</bug_when>
    <thetext>The CMake build of TestWebKitAPI on the Mac port stages test resources into
TestWebKitAPIResources.bundle using a flat file(GLOB) on Resources/*.* and
Resources/cocoa/*.*, then copies the matching files (flattened) into the
bundle root.

This misses two categories of resources:

  1. Files in nested subdirectories under Resources/cocoa/, e.g.:
       - Resources/cocoa/web-extension/{manifest.json, _locales/en/messages.json,
         images/*, ...}
       - Resources/cocoa/web-extension-mac.appex/Contents/{Info.plist,
         _CodeSignature/CodeResources, MacOS/..., Resources/...}
       - Resources/cocoa/web-extension-ios.appex/...
       - Resources/cocoa/TestModalContainerControls.mlmodelc/...

  2. Top-level files whose names do not contain a &quot;.&quot; (the *.* glob requires
     a dot), e.g. Resources/cocoa/invalidDeviceIDHashSalts.

As a result, the following API tests fail when run against the CMake build at
WebKitBuild/cmake-mac/Debug/ even though the test binaries themselves compile
and link cleanly:

  - TestWebKitAPI.WKWebExtension.LoadFromDirectory
  - TestWebKitAPI.WKWebExtension.LoadFromDirectoryWithoutTrailingSlash
  - TestWebKitAPI.WKWebExtension.LoadFromMacAppExtensionBundle
  - TestWebKitAPI.WKWebExtension.LoadFromiOSAppExtensionBundle
  - TestWebKitAPI.WebKit.InvalidDeviceIdHashSalts

These tests load a directory as a bundle via
-[NSBundle URLForResource:withExtension:@&quot;&quot;] (or load a dotless filename) and
return nil because the resource isn&apos;t present at runtime.

The Xcode build is unaffected because it uses xcconfig-driven Copy Files
phases that preserve directory structure.

PlatformMac.cmake should stage Resources/ and Resources/cocoa/ recursively,
preserving directory structure under cocoa/ (with the cocoa/ prefix stripped
so URLForResource: lookups continue to resolve), and including dotless
filenames. Resources/glib/ should remain excluded on the Mac port.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209910</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-11 17:00:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/176834169&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209911</commentid>
    <comment_count>2</comment_count>
    <who name="zak ridouh">zakr</who>
    <bug_when>2026-05-11 17:01:31 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64714</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209929</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-11 17:51:30 -0700</bug_when>
    <thetext>Committed 313044@main (cdc76f4dc73b): &lt;https://commits.webkit.org/313044@main&gt;

Reviewed commits have been landed. Closing PR #64714 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>