DYLD USAGE: SourceKitten uses `dlopen()` to make it possible for the user to control where to load `sourcekitd.framework` at run time.

Originator:Norio.Nomura
Number:rdar://32831229 Date Originated:June 17 2017, 6:55 PM
Status:open Resolved:
Product:macOS 10.13 (17A264c) Product Version:
Classification:suggestion Reproducible:
 
Area:
Xcode

Summary:
Hi, I'm writing this just after watching Session 413 of WWDC 17.

I'm a member of https://github.com/jpsim/SourceKitten and will give you feedback on *why we are using `dlopen()`* in SourceKitten.

SourceKitten is a tool that makes use of `sourcekitd.framework` attached to Swift toolchain.
To support multiple versions of Swift, SourceKitten uses `dlopen ()` to make it possible for the user to control where to load `sourcekitd.framework` at run time.
https://github.com/jpsim/SourceKitten/blob/master/Source/SourceKittenFramework/library_wrapper.swift#L56
It looks for `sourcekitd.framework` with the same rules that `xcrun` looks for `swift`.
This is why we are using `dlopen()`.

As far as I tested, SourceKitten has no problem on loading `sourcekitd.framework` on macOS High Sierra with Xcode 9 beta 1.

I am glad that this feedback will be of help to you.
Best,
--
norio

Steps to Reproduce:
Not applicable

Expected Results:
Not applicable

Observed Results:
Not applicable

Version:
macOS 10.13 (17A264c)

Notes:


Configuration:
Xcode 9.0 beta 1 (9M136h)

Comments


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!