Bug 314595
| Summary: | [CMake] TestWebKitAPI on Mac doesn't bundle nested resource directories | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zak ridouh <zakr> |
| Component: | CMake | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/176834169>
zak ridouh
Pull request: https://github.com/WebKit/WebKit/pull/64714
EWS
Committed 313044@main (cdc76f4dc73b): <https://commits.webkit.org/313044@main>
Reviewed commits have been landed. Closing PR #64714 and removing active labels.