Commit Graph

12 Commits

Author SHA1 Message Date
Kabir Oberai
821663c6fd Use SwiftPM's SDK computation logic (#1643)
Using `SwiftSDK.deriveTargetSwiftSDK`, which is the same method that SwiftPM's own CLI tools use to determine the SDK from passed-in info (target `--triple`, `--swift-sdk`, and host sdk). This allows us to better uphold the contract in the [Configuration File](d11c101ce2/Documentation/Configuration%20File.md (structure)) docs, namely that the `swiftSDK` param is "Equivalent to SwiftPM's `--swift-sdk` option" and similarly for `triple`.

As concrete examples of where (AFAICT) the current implementation diverges:
- Passing a `--triple` of `wasm32-unknown-wasi` to `swift-build` will use the toolchain-integrated Wasm SDK if one exists. Passing the same value to sourcekit-lsp does not do this.
- Perhaps more relevant: after landing https://github.com/swiftlang/swift-package-manager/pull/6828, this change will make it so that building for iOS is as simple as setting `"triple": "arm64-apple-ios"` in the config! Currently, it's necessary to set C/Swift flags and hardcode the sysroot. Should close https://github.com/swiftlang/sourcekit-lsp/issues/1587.

This PR depends on:

- https://github.com/swiftlang/swift-package-manager/pull/7925
2024-08-29 09:15:26 -07:00
Alex Hoppen
189f32ae04 Remove workarounds that are no longer needed 2024-08-17 07:52:55 -07:00
Pavel Yaskevich
2bb86c55c5 [SwiftPM] Switch from BuildTriple to BuildDestination
`BuildTriple` is going away to it's as good time as any to introduce a new type to be used by SourceKit-LSP.

Paired with https://github.com/swiftlang/swift-package-manager/pull/7884
2024-08-15 13:47:07 -07:00
Alex Hoppen
430fdef818 Use BuildDescription.traverseModules to get the target targets of a SwiftPM package 2024-08-08 16:55:02 -07:00
Alex Hoppen
e43740a5d0 Re-arrange members in SwiftPMBuildSystem by groups 2024-08-08 12:52:20 -07:00
Alex Hoppen
50a28bb86a Change FIXME and TODO comments to always have an associated issue
Do one of the following for every `FIXME` or `TODO` comment
- Add an issue that tracks the task
- Remove the comment if we are not planning to address it
2024-08-07 10:00:04 -07:00
Alexis Laferrière
ae152de1bc Merge pull request #1609 from AndrewHoos/asyncGraphLoading
Adopt new async (but not yet swift 6) methods from SwiftPM
2024-08-05 17:05:20 -07:00
Alex Hoppen
c31122b255 Merge pull request #1570 from ahoppen/remove-indexpathmappings
Remove `indexPrefixMappings` from `BuildSystem`
2024-08-05 10:41:05 -07:00
Andrew Hoos
a5168091da Update sourcekit-lsp for async, but not yet Swift 6 package graph loading 2024-08-05 09:09:17 -07:00
Alex Hoppen
0249741aba Remove indexPrefixMappings from BuildSystem
They weren’t used.
2024-08-01 10:11:48 -07:00
Alex Hoppen
7e2d12a7a0 Add configuration option to disable the sandbox for SwiftPM operations
Disabling the sandbox is needed to run tests for the Swift VS Code extension in a sandbox.
2024-08-01 09:24:17 -07:00
Alex Hoppen
4c8916ac60 Merge SKSwiftPMWorkspace into BuildSystemIntegration
The SwiftPM build system integration was the only one in its own modules. Merge it into the `BuildSystemIntegration` modules next to eg. the compilation database build system.
2024-07-25 09:13:46 -07:00