Allow configuring sandbox entitlements in OS X Swift Playgrounds

Originator:armadsen
Number:rdar://21677248 Date Originated:05-Jul-2015 12:40 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A121l)
Classification:Enhancement Reproducible:Always
 
Summary:
OS X Swift Playgrounds run in a sandbox where network access is permitted, but other prohibited-by-default actions are not. My motivation for filing this bug is that I’d like to be able to use a serial port in a playground. Use of serial ports requires a com.apple.security.device.serial entitlement in a sandboxed application. To my knowledge, it is not currently possible to specify custom sandbox entitlements for a Swift playground.

Steps to Reproduce:
Try to open a serial port from a Swift playground.

Expected Results:
The serial port opens successfully and can be used.

Actual Results:
The open() call returns error code 1, “Operation Not Permitted”

Notes:
The attached workspace, containing a playground demonstrates the problem. It assumes a serial port at /dev/cu.usbmodem14411 . This will need to be changed to a path to a valid serial port on the machine where it is being run, of course.

(Attachment can be downloaded here: https://www.dropbox.com/s/w49prikhuzkgjmc/SerialPlayground.zip?dl=0)

Comments

+1 spent an hour trying to figure out why my playground was borked.

By mkoukoullis at Sept. 5, 2015, 9:17 a.m. (reply...)

Ditto on "the need and use-case". Serial Port in Playground.

I'm in agreement with Armadsen. Having Serial Port ( ORSSerial ) access in a Playground kinda lives the "Playground Dream" of manipulating live data in a live development environment.

Beyond that, there are professional use-cases too. Those are important every now and then, right.

By Yury.Gitman at July 5, 2015, 11:04 p.m. (reply...)

Yury, I hope you'll file a duplicate radar with Apple.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!