Skip to content

[5.5] Make the lookup of the PackageDescription dylib fall back on the versioned location if needed #3567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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).
return resources.libDir.appending(version.runtimeSubpath)
}

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