Bug 164549 - Use Correct SDK for DumpRenderTree and WebKitTestRunner
Summary: Use Correct SDK for DumpRenderTree and WebKitTestRunner
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-09 10:51 PST by Jonathan Bedard
Modified: 2016-11-10 16:33 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.58 KB, patch)
2016-11-09 13:28 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (5.07 KB, patch)
2016-11-09 14:23 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (2.77 KB, patch)
2016-11-09 14:40 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2016-11-09 10:51:38 PST
DumpRenderTree and WebKitTestRunner both use the MacOS sdk for building their respective iOS testing apps.  This is incorrect.
Comment 1 Radar WebKit Bug Importer 2016-11-09 10:54:59 PST
<rdar://problem/29182272>
Comment 2 Jonathan Bedard 2016-11-09 13:28:45 PST
Created attachment 294277 [details]
Patch
Comment 3 David Kilzer (:ddkilzer) 2016-11-09 13:50:01 PST
Comment on attachment 294277 [details]
Patch

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

r-; Jonathan and I talked in person about this.  He's going to post a new patch soon.

> Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:53
>  SDKROOT[sdk=iphone*] = $(SDKROOT);
> +SDKROOT = $(SDKROOT_iphoneos_$(USE_INTERNAL_SDK));
> +SDKROOT_iphoneos_ = iphoneos;
> +SDKROOT_iphoneos_YES = iphoneos.internal;
> +
>  SDKROOT = $(SDKROOT_macosx_$(USE_INTERNAL_SDK));
>  SDKROOT_macosx_ = macosx;
>  SDKROOT_macosx_YES = macosx.internal;

Two things:

1. This config file is used for multiple targets, such as ImageDiff which still run on macOS, so we should not make this change here.

2. The change needs to go into DumpRenderTreeApp.xcconfig, and it should only modify the SDKROOT for iphoneos builds since iphonesimulator does not have an *.internal variant.  That would look something like this, and the SDKROOT settings in Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj could be removed since Debug/Release/Production configurations are based on DumpRenderTreeApp.xcconfig:
 
SDKROOT[sdk=iphoneos*] = $(SDKROOT_iphoneos);
SDKROOT_iphoneos = $(SDKROOT_iphoneos_$(USE_INTERNAL_SDK));
SDKROOT_iphoneos_ = iphoneos;
SDKROOT_iphoneos_YES = iphoneos.internal;

A similar change needs to be done for WebKitTestRunner as well.
Comment 4 Jonathan Bedard 2016-11-09 14:23:42 PST
Created attachment 294290 [details]
Patch
Comment 5 David Kilzer (:ddkilzer) 2016-11-09 14:32:13 PST
Comment on attachment 294290 [details]
Patch

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

> Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:1348
> +				SDKROOT = "$(SDKROOT_iphoneos)";

This line should not be needed in the Xcode project if the four lines in the DumpRenderTreeApp.xcconfig file below stay as-is.

In other words, you should be able to manually delete this line by editing the file, and everything should still work.

This line is also technically incorrect when building for the iphonesimulator SDK.

> Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:1357
> +				SDKROOT = "$(SDKROOT_iphoneos)";

Ditto.

> Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:1366
> +				SDKROOT = "$(SDKROOT_iphoneos)";

Ditto.

> Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:1123
> +				SDKROOT = "$(SDKROOT_iphoneos)";

Similarly, you should be able to delete this line an the SDKROOT should be picked up from WebKitTestRunnerApp.xcconfig.

Note that this is also incorrect when building for the iphonesimulator SDK.

> Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:1135
> +				SDKROOT = "$(SDKROOT_iphoneos)";

Ditto.

> Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:1147
> +				SDKROOT = "$(SDKROOT_iphoneos)";

Ditto.
Comment 6 Jonathan Bedard 2016-11-09 14:38:40 PST
(In reply to comment #5)
> ...
> > Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:1147
> > +				SDKROOT = "$(SDKROOT_iphoneos)";
> 
> Ditto.

Without these lines, the proper SDK will not be bound.

The change that does result in the correct SDK being assigned is setting the SDK root as follows:

SDKROOT = $(SDKROOT_iphoneos);

A patch will follow with this change.
Comment 7 Jonathan Bedard 2016-11-09 14:40:02 PST
Created attachment 294292 [details]
Patch
Comment 8 Jonathan Bedard 2016-11-09 15:35:41 PST
This is actually going to be a bit more difficult than anticipated.

Here's the issue:
build-webkit builds every single Target in every single project with the specified SDK.  This issue with this approach is that it makes no sense.  Take, for example, DumpRenderTree.  DumpRenderTree targets both an app (for simulator testing) and an executable (for testing on a Mac).  No mater the SDK, both targets are built.  Meaning that Mac attempts to build the app with a MacOSX SDK (this is the cause of the EWS failures at the moment)
Comment 9 David Kilzer (:ddkilzer) 2016-11-09 18:27:33 PST
Comment on attachment 294292 [details]
Patch

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

If the projects won't build without the SDKROOT defined in the project.pbxproj file, then this line probably needs to be moved from the *.xcconfig files into the Debug, Release and Production configurations in project.pbxproj:

SDKROOT[sdk=iphoneos*] = $(SDKROOT_iphoneos);

This line can be left off because building for the iOS Simulator should just work:

SDKROOT[sdk=iphonesimulator*] = iphonesimulator;

> Tools/DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig:32
> +SDKROOT = $(SDKROOT_iphoneos);

Change this:

SDKROOT = $(SDKROOT_iphoneos);

To this (use the "*" if a version is specified, although there should be another way to "declare" this binary as an iOS app):

SDKROOT[sdk=iphonesimulator*] = iphonesimulator;

> Tools/WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:32
> +SDKROOT = $(SDKROOT_iphoneos);

Change this:

SDKROOT = $(SDKROOT_iphoneos);

To this (use the "*" if a version is specified, although there should be another way to "declare" this binary as an iOS app):

SDKROOT[sdk=iphonesimulator*] = iphonesimulator;
Comment 10 David Kilzer (:ddkilzer) 2016-11-09 18:28:51 PST
Comment on attachment 294292 [details]
Patch

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

>> Tools/DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig:32
>> +SDKROOT = $(SDKROOT_iphoneos);
> 
> Change this:
> 
> SDKROOT = $(SDKROOT_iphoneos);
> 
> To this (use the "*" if a version is specified, although there should be another way to "declare" this binary as an iOS app):
> 
> SDKROOT[sdk=iphonesimulator*] = iphonesimulator;

Ugh.  That wasn't even correct.  I meant to say change this:

SDKROOT = $(SDKROOT_iphoneos);

To this:

SDKROOT[sdk=iphoneos*] = $(SDKROOT_iphoneos);

>> Tools/WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:32
>> +SDKROOT = $(SDKROOT_iphoneos);
> 
> Change this:
> 
> SDKROOT = $(SDKROOT_iphoneos);
> 
> To this (use the "*" if a version is specified, although there should be another way to "declare" this binary as an iOS app):
> 
> SDKROOT[sdk=iphonesimulator*] = iphonesimulator;

Ugh.  That wasn't even correct.  I meant to say change this:

SDKROOT = $(SDKROOT_iphoneos);

To this:

SDKROOT[sdk=iphoneos*] = $(SDKROOT_iphoneos);
Comment 11 David Kilzer (:ddkilzer) 2016-11-10 07:26:23 PST
You might also check the value of these Xcode variables when building DRT/WKTR for iphoneos and iphonesimulator:

AVAILABLE_PLATFORMS
PLATFORM_NAME
SUPPORTED_DEVICE_FAMILIES
SUPPORTED_PLATFORMS
TARGETED_DEVICE_FAMILY

If one of these isn't set properly, that might lead to the SDK not being set properly.
Comment 12 Jonathan Bedard 2016-11-10 16:33:01 PST
Further investigation has revealed that this is likely a non-issue.

Since run-webkit-tests over-rides the target SDK, the process to add XCtests is to temporarily target iOS when constructing the tests through Xcode and then remove the explicit SDK target and allow Xcode to implicitly define the SDK target.

Closing this bug, as now change is needed.