Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Sources/PackageLoading/ManifestLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,18 @@ public final class ManifestLoader: ManifestLoaderProtocol {
/// Returns the runtime path given the manifest version and path to libDir.
private func runtimePath(for version: ToolsVersion) -> AbsolutePath {
// Bin dir will be set when developing swiftpm without building all of the runtimes.
return resources.binDir ?? resources.libDir.appending(component: "ManifestAPI")
if let binDir = resources.binDir {
return binDir
}

// Otherwise we use the standard location of the manifest API in the toolchain, if it exists.
let manifestAPIDir = resources.libDir.appending(component: "ManifestAPI")
if localFileSystem.exists(manifestAPIDir) {
return manifestAPIDir
}

// Otherwise, fall back on the old location (this would indicate that we're using an old toolchain).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we emit some warning in this case, or is it valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is valid. It's due to the different locations of PackageDescription, both of which are valid, but are different depending on whether the toolchain has the unified implementation or not.

return resources.libDir.appending(version.runtimeSubpath)
}

/// Returns path to the manifest database inside the given cache directory.
Expand Down