DumpRenderTree and WebKitTestRunner both use the MacOS sdk for building their respective iOS testing apps. This is incorrect.
<rdar://problem/29182272>
Created attachment 294277 [details] Patch
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.
Created attachment 294290 [details] Patch
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.
(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.
Created attachment 294292 [details] Patch
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 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 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);
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.
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.