Bug 314595

Summary: [CMake] TestWebKitAPI on Mac doesn't bundle nested resource directories
Product: WebKit Reporter: zak ridouh <zakr>
Component: CMakeAssignee: zak ridouh <zakr>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

zak ridouh
Reported 2026-05-11 17:00:06 PDT
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 "." (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:@""] (or load a dotless filename) and return nil because the resource isn'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.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-05-11 17:00:13 PDT
zak ridouh
Comment 2 2026-05-11 17:01:31 PDT
EWS
Comment 3 2026-05-11 17:51:30 PDT
Committed 313044@main (cdc76f4dc73b): <https://commits.webkit.org/313044@main> Reviewed commits have been landed. Closing PR #64714 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.