Bug 133963

Summary: Add knowledge of the iOS Simulator to webkitpy
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: David Farler <dfarler>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dbates, ddkilzer, dfarler, glenn, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: iOS 7.0   
Attachments:
Description Flags
Patch
none
Patch simon.fraser: review+

Description Simon Fraser (smfr) 2014-06-16 19:09:43 PDT
Add knowledge of the iOS Simulator to webkitpy
Comment 1 Simon Fraser (smfr) 2014-06-16 19:13:07 PDT
Created attachment 233206 [details]
Patch
Comment 2 WebKit Commit Bot 2014-06-16 19:13:57 PDT
Attachment 233206 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/port/ios-simulator.py:88:  no spaces around keyword / parameter equals  [pep8/E251] [5]
ERROR: Tools/Scripts/webkitpy/port/ios-simulator.py:122:  multiple statements on one line (semicolon)  [pep8/E702] [5]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brent Fulgham 2014-07-22 11:54:05 PDT
Comment on attachment 233206 [details]
Patch

I think this looks good, but perhaps Ryosuke should review.
Comment 4 Simon Fraser (smfr) 2014-07-22 12:06:39 PDT
David Farler should also say whether this will be useful to him.
Comment 5 David Farler 2014-07-22 12:15:22 PDT
Here's some feedback based on the simulator relay app I'm working on:

You can just use "LayoutTestRelay" as the driver for both DRT and WKTR.

--app
I've been using --app /path/to/DRTorWKTR.app which I install with CoreSimulator.

--suffix
In order to support multiple copies of the dump tool running simultaneously, they need to have a unique bundle identifier. LayoutTestRelay can handle this but it needs to have a suffix passed to it so it knows how to unique the identifier (LayoutTestRelay and DRT/WKTR instances are 1:1). I've been using --suffix {1..N} depending on how many instances are passed in as the option.

--product-dir
To set DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH when launching in the simulator. I can also just pick these up from the environment.

--A way to specify the device type.
CoreSimulator spawns devices as (SimDeviceType, SimRuntime) -> SimDevice. For any device type, I'll have to do a check to see if the device and runtime are compatible, since you can have more than one simulator runtime in an Xcode.app bundle. They are identified by reverse-DNS style identifiers. It would be easiest to provide both --deviceType <identifier> --runtime <identifier> to the relay app, where I can do a quick check and bail if the combination is invalid.

Simulator device types roughly correspond to iOS hardware models, and simulator runtimes correspond roughly to simulator SDK versions.
Comment 6 David Farler 2014-07-24 16:37:53 PDT
Yoink.
Comment 7 David Farler 2014-07-24 16:39:24 PDT
Comment on attachment 233206 [details]
Patch

Got a bunch more changes on top of this. Will upload another patch.
Comment 8 David Farler 2014-07-24 17:34:59 PDT
Created attachment 235481 [details]
Patch
Comment 9 Simon Fraser (smfr) 2014-07-24 17:40:35 PDT
Comment on attachment 235481 [details]
Patch

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

> Tools/ChangeLog:16
> +        * Scripts/webkitpy/port/ios.py: Added.

can we call this iossimulator.py ?

> Tools/Scripts/webkitpy/port/ios.py:50
> +    ARCHITECTURES = ['x86_64', 'x86']

We should probably support 32-bit too.
Comment 10 David Farler 2014-07-24 18:36:46 PDT
(In reply to comment #9)
> (From update of attachment 235481 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=235481&action=review
> 
> > Tools/ChangeLog:16
> > +        * Scripts/webkitpy/port/ios.py: Added.
> 
> can we call this iossimulator.py ?

We can, but I was just going to put the simulator and device support (when that is ready) in the same module, since they will both run in more or less the same way. Eventually we will have an IOSDevicePort and it makes sense for them to be in the same Python module.

> 
> > Tools/Scripts/webkitpy/port/ios.py:50
> > +    ARCHITECTURES = ['x86_64', 'x86']
> 
> We should probably support 32-bit too.

Ah, I copied this from the Mac, I assumed that’s what ‘x86’ was. It looks like x86 is webkitpy-speak for i386:

mac.py:72:def _build_driver_flags(self):
return ['ARCHS=i386'] if self.architecture() == 'x86' else []
Comment 11 David Farler 2014-07-29 21:49:50 PDT
Committed r171789: <http://trac.webkit.org/changeset/171789>