Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: swiftlang/sourcekit-lsp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: swift-embedded/sourcekit-lsp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: embedded-5.1
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 12 commits
  • 4 files changed
  • 4 contributors

Commits on Apr 29, 2019

  1. [test] Make swiftpm test robust against host triple differences

    Hardcoding the triples was silly; the only interesting platform
    difference is about which parts have a version number on macOS and which
    do not.
    benlangmuir authored and sarveshtamba committed Apr 29, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    47d497e View commit details

Commits on Apr 30, 2019

  1. Merge pull request #102 from sarveshtamba/swift-5.1-branch

    [test] Make swiftpm test robust against host triple differences
    benlangmuir authored Apr 30, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c2f720d View commit details

Commits on May 1, 2019

  1. Merge remote-tracking branch 'origin/master' into swift-5.1-branch

    Semantically, we want our branch point to match swiftpm, but all of the
    changes since then also look good to take into the branch, so just do
    one last merge from master.
    benlangmuir committed May 1, 2019
    Copy the full SHA
    bdcbb11 View commit details
  2. Copy the full SHA
    d28ec89 View commit details
  3. Merge pull request #103 from benlangmuir/update-51

    [5.1] Update swift-5.1-branch to match the swiftpm branch point
    aciidgh authored May 1, 2019
    Copy the full SHA
    76ee75d View commit details

Commits on Aug 2, 2019

  1. Merge pull request #127 from millenomi/foundationxml

    FoundationXML: Adoption
    akyrtzi authored and millenomi committed Aug 2, 2019
    Copy the full SHA
    ee5ce45 View commit details
  2. Merge pull request #129 from millenomi/foundationxml-5.1

    [5.1] FoundationXML: Adoption
    benlangmuir authored Aug 2, 2019
    Copy the full SHA
    3bd5835 View commit details

Commits on Aug 16, 2019

  1. Copy the full SHA
    940c447 View commit details

Commits on Aug 17, 2019

  1. Merge pull request #145 from benlangmuir/merge-51

    [5.1] Update with changes from master
    benlangmuir authored Aug 17, 2019
    Copy the full SHA
    dd0b724 View commit details

Commits on Sep 23, 2019

  1. Copy the full SHA
    9ce308d View commit details
  2. Copy the full SHA
    7939f78 View commit details

Commits on Jan 4, 2020

  1. Copy the full SHA
    3521a96 View commit details
Showing with 29 additions and 13 deletions.
  1. +3 −3 Package.swift
  2. +6 −1 Sources/SKCore/BuildSetup.swift
  3. +12 −8 Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift
  4. +8 −1 Sources/sourcekit-lsp/main.swift
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ let package = Package(
// useful to any Swift package. Similar in spirit to SwiftPM's Basic module.
.target(
name: "SKSupport",
dependencies: ["SPMUtility"]),
dependencies: ["SwiftPM-auto", "SPMUtility"]),
.testTarget(
name: "SKSupportTests",
dependencies: ["SKSupport", "SKTestSupport"]),
@@ -97,8 +97,8 @@ import Darwin.C
if getenv("SWIFTCI_USE_LOCAL_DEPS") == nil {
// Building standalone.
package.dependencies += [
.package(url: "https://github.com/apple/indexstore-db.git", .branch("master")),
.package(url: "https://github.com/apple/swift-package-manager.git", .branch("master")),
.package(url: "https://github.com/apple/indexstore-db.git", .branch("swift-5.1-branch")),
.package(url: "https://github.com/swift-embedded/swift-package-manager.git", .branch("embedded-5.1")),
]
} else {
package.dependencies += [
7 changes: 6 additions & 1 deletion Sources/SKCore/BuildSetup.swift
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

import Basic
import Workspace
import SPMUtility
import SKSupport

@@ -31,9 +32,13 @@ public struct BuildSetup {
/// Additional build flags
public let flags: BuildFlags

public init(configuration: BuildConfiguration, path: AbsolutePath?, flags: BuildFlags) {
/// Custom compilation destination, if different from host
public let customDestination: Destination?

public init(configuration: BuildConfiguration, path: AbsolutePath?, flags: BuildFlags, customDestination: Destination? = nil) {
self.configuration = configuration
self.path = path
self.flags = flags
self.customDestination = customDestination
}
}
20 changes: 12 additions & 8 deletions Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift
Original file line number Diff line number Diff line change
@@ -73,22 +73,25 @@ public final class SwiftPMWorkspace {
throw Error.cannotDetermineHostToolchain
}

let destination = try Destination.hostDestination(destinationToolchainBinDir)
let toolchain = try UserToolchain(destination: destination)

let buildPath: AbsolutePath = buildSetup.path ?? packageRoot.appending(component: ".build")

let hostDestination = try Destination.hostDestination(destinationToolchainBinDir)
let manifestToolchain = try UserToolchain(destination: hostDestination)
let buildDestination = try? Destination(fromFile: buildPath.appending(component: "destination.json"),
fileSystem: fileSystem)
let targetDestination = buildSetup.customDestination ?? buildDestination ?? hostDestination
let targetToolchain = try UserToolchain(destination: targetDestination)


self.workspace = Workspace(
dataPath: buildPath,
editablesPath: packageRoot.appending(component: "Packages"),
pinsFile: packageRoot.appending(component: "Package.resolved"),
manifestLoader: ManifestLoader(manifestResources: toolchain.manifestResources, cacheDir: buildPath),
manifestLoader: ManifestLoader(manifestResources: manifestToolchain.manifestResources, cacheDir: buildPath),
delegate: BuildSettingProviderWorkspaceDelegate(),
fileSystem: fileSystem,
skipUpdate: true)

let triple = Triple.hostTriple

let swiftPMConfiguration: PackageModel.BuildConfiguration
switch buildSetup.configuration {
case .debug:
@@ -98,9 +101,10 @@ public final class SwiftPMWorkspace {
}

self.buildParameters = BuildParameters(
dataPath: buildPath.appending(component: triple.tripleString),
dataPath: buildPath.appending(component: targetDestination.target.tripleString),
configuration: swiftPMConfiguration,
toolchain: toolchain,
toolchain: targetToolchain,
destinationTriple: targetDestination.target,
flags: buildSetup.flags)

self.packageGraph = PackageGraph(rootPackages: [], requiredDependencies: [])
9 changes: 8 additions & 1 deletion Sources/sourcekit-lsp/main.swift
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ import Dispatch
import Basic
import SPMUtility
import Foundation
import Workspace
import sourcekitd // Not needed here, but fixes debugging...

func parseArguments() throws -> BuildSetup {
@@ -28,6 +29,7 @@ func parseArguments() throws -> BuildSetup {
let loggingOption = parser.add(option: "--log-level", kind: LogLevel.self, usage: "Set the logging level (debug|info|warning|error) [default: \(LogLevel.default)]")
let buildConfigurationOption = parser.add(option: "--configuration", shortName: "-c", kind: BuildConfiguration.self, usage: "Build with configuration (debug|release) [default: debug]")
let buildPathOption = parser.add(option: "--build-path", kind: PathArgument.self, usage: "Specify build/cache directory")
let destinationOption = parser.add(option: "--destination", kind: PathArgument.self)
let buildFlagsCc = parser.add(option: "-Xcc", kind: [String].self, strategy: .oneByOne, usage: "Pass flag through to all C compiler invocations")
let buildFlagsCxx = parser.add(option: "-Xcxx", kind: [String].self, strategy: .oneByOne, usage: "Pass flag through to all C++ compiler invocations")
let buildFlagsLinker = parser.add(option: "-Xlinker", kind: [String].self, strategy: .oneByOne, usage: "Pass flag through to all linker invocations")
@@ -41,6 +43,10 @@ func parseArguments() throws -> BuildSetup {
buildFlags.linkerFlags = parsedArguments.get(buildFlagsLinker) ?? []
buildFlags.swiftCompilerFlags = parsedArguments.get(buildFlagsSwift) ?? []

let customDestination = try parsedArguments.get(destinationOption).map {
return try Destination(fromFile: $0.path)
}

if let logLevel = parsedArguments.get(loggingOption) {
Logger.shared.currentLevel = logLevel
} else {
@@ -50,7 +56,8 @@ func parseArguments() throws -> BuildSetup {
return BuildSetup(
configuration: parsedArguments.get(buildConfigurationOption) ?? BuildSetup.default.configuration,
path: parsedArguments.get(buildPathOption)?.path,
flags: buildFlags)
flags: buildFlags,
customDestination: customDestination)
}

let clientConnection = JSONRPCConection(inFD: STDIN_FILENO, outFD: STDOUT_FILENO, closeHandler: {