Bug 82371

Summary: WebKit fails to load a staged framework when soft linking
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: WebKit Misc.Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bweinstein, joepeck, mitz, mrowe, timothy, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed Change none

Description Timothy Hatcher 2012-03-27 12:49:29 PDT
The Web Inspector framework is failing to load when the framework does not exist at the system install path.
Comment 1 Timothy Hatcher 2012-03-27 12:58:02 PDT
<rdar://problem/11125989>
Comment 2 Timothy Hatcher 2012-03-27 13:00:53 PDT
Created attachment 134118 [details]
Proposed Change
Comment 3 WebKit Review Bot 2012-03-27 13:04:29 PDT
Attachment 134118 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/platform/mac/SoftLinking.h:58:  Missing space before {  [whitespace/braces] [5]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 WebKit Review Bot 2012-03-27 13:44:36 PDT
Comment on attachment 134118 [details]
Proposed Change

Clearing flags on attachment: 134118

Committed r112312: <http://trac.webkit.org/changeset/112312>
Comment 5 WebKit Review Bot 2012-03-27 13:44:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Alexey Proskuryakov 2012-03-28 23:43:23 PDT
Comment on attachment 134118 [details]
Proposed Change

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

Is it correct to try unstaged location first, and then staged location? It seems like it should be the opposite order.

> Source/WebCore/platform/mac/SoftLinking.h:55
> -#define SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(framework) \
> +#define SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(framework, unstagedLocation) \

The new name doesn't appear to correctly describe the behavior - the macro loads either installed or staged framework.

Also, shouldn't all soft link macros support staged frameworks, making the clarification redundant?
Comment 7 Mark Rowe (bdash) 2012-03-28 23:54:21 PDT
(In reply to comment #6)
> (From update of attachment 134118 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134118&action=review
> 
> Is it correct to try unstaged location first, and then staged location? It seems like it should be the opposite order.

It's counter-intuitive, but looking in the normal location first is the right behavior as dlopen will still respect any dyld environment variables that influence the search path.

> > Source/WebCore/platform/mac/SoftLinking.h:55
> > -#define SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(framework) \
> > +#define SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(framework, unstagedLocation) \
> 
> The new name doesn't appear to correctly describe the behavior - the macro loads either installed or staged framework.
> 
> Also, shouldn't all soft link macros support staged frameworks, making the clarification redundant?

Given the limited application of staged frameworks there wouldn't be much benefit to doing this.