Bug 232982

Summary: Get daemon API ready to work in the iOS simulator (starting with WebPushD)
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=233080
Attachments:
Description Flags
Patch for EWS v2
ews-feeder: commit-queue-
Patch for EWS v2
ews-feeder: commit-queue-
Patch for EWS v3
ews-feeder: commit-queue-
Patch for EWS v4
ews-feeder: commit-queue-
Patch for EWS v5
ews-feeder: commit-queue-
Patch for EWS v6
ews-feeder: commit-queue-
Patch for EWS v7
ews-feeder: commit-queue-
Patch for EWS v8
ews-feeder: commit-queue-
Patch for EWS v9
ggaren: review+, ews-feeder: commit-queue-
Patch for landing v1
ews-feeder: commit-queue-
Patch for landing v2
ews-feeder: commit-queue-
Patch for landing v3
ews-feeder: commit-queue-
Patch for landing v4 none

Description Brady Eidson 2021-11-10 20:15:02 PST
Get daemon API tests working in the iOS simulator (starting with WebPushD.PermissionManagement)
Comment 1 Brady Eidson 2021-11-10 20:28:37 PST
Created attachment 443900 [details]
Patch for EWS v2
Comment 2 Brady Eidson 2021-11-10 20:59:29 PST
Created attachment 443902 [details]
Patch for EWS v2
Comment 3 Brady Eidson 2021-11-10 21:27:18 PST
Created attachment 443905 [details]
Patch for EWS v3
Comment 4 Brady Eidson 2021-11-10 21:32:55 PST
Created attachment 443906 [details]
Patch for EWS v4
Comment 5 Brady Eidson 2021-11-10 21:37:38 PST
Created attachment 443907 [details]
Patch for EWS v5
Comment 6 Brady Eidson 2021-11-11 10:08:44 PST
Created attachment 443964 [details]
Patch for EWS v6
Comment 7 Brady Eidson 2021-11-11 13:46:56 PST
Created attachment 443998 [details]
Patch for EWS v7
Comment 8 Brady Eidson 2021-11-11 14:35:16 PST
Created attachment 444004 [details]
Patch for EWS v8
Comment 9 Brady Eidson 2021-11-11 15:44:20 PST
Created attachment 444013 [details]
Patch for EWS v9
Comment 10 Geoffrey Garen 2021-11-11 16:53:41 PST
Comment on attachment 444013 [details]
Patch for EWS v9

r=me
Comment 11 Brady Eidson 2021-11-11 18:44:57 PST
Created attachment 444033 [details]
Patch for landing v1
Comment 12 Brady Eidson 2021-11-12 10:12:29 PST
Created attachment 444078 [details]
Patch for landing v2

Daemon failed to launch on the EWS bot, causing TestWebKitAPI crashes.

This patch fixes those crashes and turns them into "clean failures", but I'm still exploring why the daemon isn't launching.
Comment 13 Brady Eidson 2021-11-12 12:33:45 PST
Okay I figured out the difference between my setup and what the bots are doing.

Locally, we often symlink our built frameworks into the sim runtime.
When I did that, the tests were working great.

If I undo that and just rely on the run-api-tests script like the bots do, I get the same "daemon won't launch" failure.

Trying to figure out the difference now.
Comment 14 Brady Eidson 2021-11-12 16:32:26 PST
TL;DR

OSLaunchdJob + the simulator require us to pass a daemon path relative to the runtime root.

But run-api-tests just sets a whole bunch of Mac-relative DYLD* paths, and we don't actually *have* anything installed inside the runtime root.

Jonathan helped me brainstorm possible solutions an has volunteered to hack on run-api-tests to implement a solution that seems reasonable.
Comment 15 Brady Eidson 2021-11-12 17:08:08 PST
(In reply to Brady Eidson from comment #14)
> TL;DR
> 
> OSLaunchdJob + the simulator require us to pass a daemon path relative to
> the runtime root.
> 
> But run-api-tests just sets a whole bunch of Mac-relative DYLD* paths, and
> we don't actually *have* anything installed inside the runtime root.
> 
> Jonathan helped me brainstorm possible solutions an has volunteered to hack
> on run-api-tests to implement a solution that seems reasonable.

https://bugs.webkit.org/show_bug.cgi?id=232982 for that change.

I'll be testing changes to this patch with that one applied \o/
Comment 16 Brady Eidson 2021-11-12 17:09:00 PST
(In reply to Brady Eidson from comment #15)> 
> https://bugs.webkit.org/show_bug.cgi?id=232982 for that change.
> 
> I'll be testing changes to this patch with that one applied \o/

I, of course, meant https://bugs.webkit.org/show_bug.cgi?id=233080
Comment 17 Brady Eidson 2021-11-12 20:58:02 PST
Created attachment 444133 [details]
Patch for landing v3
Comment 18 Brady Eidson 2021-11-14 19:52:19 PST
Retitling:
        Get daemon API ready to work in the iOS simulator (starting with WebPushD)

Because I'm going to land this patch as-is - doing all the groundwork to enable the daemon tests - but still disabled until we resolve the "how to get the daemon executable visible inside the runtime root" patch
Comment 19 Brady Eidson 2021-11-14 19:55:41 PST
Created attachment 444209 [details]
Patch for landing v4
Comment 20 EWS 2021-11-14 23:17:43 PST
Committed r285799 (244243@main): <https://commits.webkit.org/244243@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444209 [details].
Comment 21 Radar WebKit Bug Importer 2021-11-14 23:18:21 PST
<rdar://problem/85400420>