Bug 250094

Summary: run-jsc with the --debugger option should work with SIP enabled
Product: WebKit Reporter: Keith Miller <keith_miller>
Component: New BugsAssignee: Keith Miller <keith_miller>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, webkit-bug-importer
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ap: review+, ews-feeder: commit-queue-

Description Keith Miller 2023-01-04 11:36:57 PST
run-jsc with the --debugger option should work with SIP enabled
Comment 1 Keith Miller 2023-01-04 11:37:26 PST
Created attachment 464332 [details]
Patch
Comment 2 Alexey Proskuryakov 2023-01-04 12:48:59 PST
Comment on attachment 464332 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=464332&action=review

This somehow lacks a commit message?

> Tools/Scripts/run-jsc:56
>      $jsc = $debuggerCmd . " " . File::Spec->catfile(jscProductDir(), "jsc -- --useDollarVM=1 ") . "@ARGV";

Huh, this is not nice. "jsc -- --useDollarVM=1 " is not a path component. I'd suggest improving this line while at it.

> Tools/Scripts/run-jsc:62
>  $ENV{"DYLD_FRAMEWORK_PATH"} = $dyld;

Is this still needed?
Comment 3 Keith Miller 2023-01-06 09:27:27 PST
Comment on attachment 464332 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=464332&action=review

>> Tools/Scripts/run-jsc:56
>>      $jsc = $debuggerCmd . " " . File::Spec->catfile(jscProductDir(), "jsc -- --useDollarVM=1 ") . "@ARGV";
> 
> Huh, this is not nice. "jsc -- --useDollarVM=1 " is not a path component. I'd suggest improving this line while at it.

Yeah, that's kinda weird. I'll fix.

>> Tools/Scripts/run-jsc:62
>>  $ENV{"DYLD_FRAMEWORK_PATH"} = $dyld;
> 
> Is this still needed?

I left it in case you have a custom debugger you want to use. It's also needed for the non-debugger case. Really though, I wanna know if there's a way to have the jsc binary specify where to find the library.
Comment 4 Alexey Proskuryakov 2023-01-06 10:46:27 PST
> Really though, I wanna know if there's a way to have the jsc binary specify where to find the library.

Technically, there's @rpath that can be embedded in Mach-O loader commands (`otool -l` to see those in existing binaries). 

That would be tricky, as I don't think that jsc is always at the same relative path to the framework in all CI and development scenarios. I think that your approach in this patch is better.
Comment 5 Keith Miller 2023-01-18 12:54:45 PST
Pull request: https://github.com/WebKit/WebKit/pull/8789
Comment 6 EWS 2023-01-19 11:57:39 PST
Committed 259103@main (0e5741eb7500): <https://commits.webkit.org/259103@main>

Reviewed commits have been landed. Closing PR #8789 and removing active labels.