[SourceKit] Include sourcekitd.h in distributed toolchain


(Ryan Lovelett) #1

The `soucekitd.framework` that comes bundled with Xcode does not include
the headers, specifically `sourcekitd.h` [1]. On the other hand, the
toolchains that get downloaded from Swift.org do come with the headers.
Is there any particular reason for this?

The reason why I ask is that libraries that interface with SourceKit,
e.g., SourceKitten [2] and node-sourcekit [3], are having to bundle the
`sourcekitd.h` in their code bases [4][5] in order to compile against
the distributed framework. It would be wonderful the _standard_
distributed framework on macOS contained the headers.

I understand that this is not exactly the correct forum to ask Xcode
questions. But this one does not strike me as a _strictly_ Xcode
question. Of course if it is I suppose I will file a Radar.

[1]
https://github.com/apple/swift/blob/adee86068e0941dfc6fd7da18e88abc9f7748fd9/tools/SourceKit/tools/sourcekitd/include/sourcekitd/sourcekitd.h
[2] https://github.com/jpsim/SourceKitten
[3] https://github.com/RLovelett/node-sourcekit
[4]
https://github.com/jpsim/SourceKitten/blob/f538238e746789cbca68d9c8b6b271e15c3ea79b/Source/SourceKittenFramework/sourcekitd.h
[5]
https://github.com/RLovelett/node-sourcekit/blob/better-include-linking-support/includes/sourcekitd/sourcekitd.h


(Argyrios Kyrtzidis) #2

Hi Ryan,

The `soucekitd.framework` that comes bundled with Xcode does not include
the headers, specifically `sourcekitd.h` [1]. On the other hand, the
toolchains that get downloaded from Swift.org do come with the headers.
Is there any particular reason for this?

The header is not currently bundled with Xcode because it is not considered a supported stable API.
The toolchain snapshots from swift.org do not make any promises about stable APIs so we include it with those.

···

On Aug 9, 2016, at 5:32 PM, Ryan Lovelett via swift-dev <swift-dev@swift.org> wrote:

The reason why I ask is that libraries that interface with SourceKit,
e.g., SourceKitten [2] and node-sourcekit [3], are having to bundle the
`sourcekitd.h` in their code bases [4][5] in order to compile against
the distributed framework. It would be wonderful the _standard_
distributed framework on macOS contained the headers.

I understand that this is not exactly the correct forum to ask Xcode
questions. But this one does not strike me as a _strictly_ Xcode
question. Of course if it is I suppose I will file a Radar.

[1]
https://github.com/apple/swift/blob/adee86068e0941dfc6fd7da18e88abc9f7748fd9/tools/SourceKit/tools/sourcekitd/include/sourcekitd/sourcekitd.h
[2] https://github.com/jpsim/SourceKitten
[3] https://github.com/RLovelett/node-sourcekit
[4]
https://github.com/jpsim/SourceKitten/blob/f538238e746789cbca68d9c8b6b271e15c3ea79b/Source/SourceKittenFramework/sourcekitd.h
[5]
https://github.com/RLovelett/node-sourcekit/blob/better-include-linking-support/includes/sourcekitd/sourcekitd.h
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


(Keith Smiley) #3

I sent something last week about including the related CLIs as well, but it
hasn't received any responses.

https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20160725/002587.html

I assume the problem here would be the same since these aren't particularly
meant to be production ready tools.

···

--
Keith Smiley

On 08/10, Argyrios Kyrtzidis via swift-dev wrote:

Hi Ryan,

> On Aug 9, 2016, at 5:32 PM, Ryan Lovelett via swift-dev <swift-dev@swift.org> wrote:
>
> The `soucekitd.framework` that comes bundled with Xcode does not include
> the headers, specifically `sourcekitd.h` [1]. On the other hand, the
> toolchains that get downloaded from Swift.org do come with the headers.
> Is there any particular reason for this?

The header is not currently bundled with Xcode because it is not considered a supported stable API.
The toolchain snapshots from swift.org do not make any promises about stable APIs so we include it with those.

>
> The reason why I ask is that libraries that interface with SourceKit,
> e.g., SourceKitten [2] and node-sourcekit [3], are having to bundle the
> `sourcekitd.h` in their code bases [4][5] in order to compile against
> the distributed framework. It would be wonderful the _standard_
> distributed framework on macOS contained the headers.
>
> I understand that this is not exactly the correct forum to ask Xcode
> questions. But this one does not strike me as a _strictly_ Xcode
> question. Of course if it is I suppose I will file a Radar.
>
> [1]
> https://github.com/apple/swift/blob/adee86068e0941dfc6fd7da18e88abc9f7748fd9/tools/SourceKit/tools/sourcekitd/include/sourcekitd/sourcekitd.h
> [2] https://github.com/jpsim/SourceKitten
> [3] https://github.com/RLovelett/node-sourcekit
> [4]
> https://github.com/jpsim/SourceKitten/blob/f538238e746789cbca68d9c8b6b271e15c3ea79b/Source/SourceKittenFramework/sourcekitd.h
> [5]
> https://github.com/RLovelett/node-sourcekit/blob/better-include-linking-support/includes/sourcekitd/sourcekitd.h
> _______________________________________________
> swift-dev mailing list
> swift-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


(Ryan Lovelett) #4

The header is not currently bundled with Xcode because it is not
considered a supported stable API.
The toolchain snapshots from swift.org do not make any promises about
stable APIs so we include it with those.

Thank you for the response. It seems that you do a lot of the
management/development of the SourceKit tool. Obviously you are way more
knowledgeable than me about this.

Forgive the impertinence, but _why_ is the API not considered supported
or stable? It is obvious Xcode makes use of it and I think Xcode is
considered a stable product? Enough of that though.

The far more important question is what can I do to change this
position? Even more important is there anything that I can do to change
the stance before Swift 3.0 is shipped?


(Argyrios Kyrtzidis) #5

The header is not currently bundled with Xcode because it is not
considered a supported stable API.
The toolchain snapshots from swift.org do not make any promises about
stable APIs so we include it with those.

Thank you for the response. It seems that you do a lot of the
management/development of the SourceKit tool. Obviously you are way more
knowledgeable than me about this.

Forgive the impertinence, but _why_ is the API not considered supported
or stable? It is obvious Xcode makes use of it and I think Xcode is
considered a stable product? Enough of that though.

There is a significant difference between using Xcode as a product that builds your project and using frameworks and headers contained inside the Xcode.app bundle to link with your project.
With ‘not supported’ I mean that, unless stated otherwise, frameworks contained inside the Xcode.app bundle are considered internal implementation details and we reserve the right to completely change them between Xcode versions (the ABI may change or the framework eliminated entirely, etc.); even though such changes may not have any observable changes for _using_ Xcode.app.

···

On Aug 12, 2016, at 7:14 AM, Ryan Lovelett <swift-dev@ryan.lovelett.me> wrote:

The far more important question is what can I do to change this
position? Even more important is there anything that I can do to change
the stance before Swift 3.0 is shipped?