Skip to content

Commit 7a4e672

Browse files
committed
fixup
1 parent e37c93b commit 7a4e672

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Sources/PackageGraph/PackageGraph+Loading.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private func createResolvedPackages(
255255
// check if the resolved package location is the same as the dependency one
256256
// if not, this means that the dependencies share the same identity
257257
// which only allowed when overriding
258-
if resolvedPackage.package.manifest.packageKind.canonicalLocation != dependencyPackageRef.canonicalLocation && !resolvedPackage.allowedToOverride {
258+
if resolvedPackage.package.manifest.canonicalPackageLocation != dependencyPackageRef.canonicalLocation && !resolvedPackage.allowedToOverride {
259259
let error = PackageGraphError.dependencyAlreadySatisfiedByIdentifier(
260260
package: package.identity.description,
261261
dependencyLocation: dependencyPackageRef.locationString,

Sources/PackageModel/Manifest.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public final class Manifest {
4848
/// The repository URL the manifest was loaded from.
4949
public let packageLocation: String
5050

51+
/// The canonical repository URL the manifest was loaded from.
52+
public var canonicalPackageLocation: CanonicalPackageLocation {
53+
CanonicalPackageLocation(self.packageLocation)
54+
}
55+
5156
// FIXME: deprecated 2/2021, remove once clients migrate
5257
@available(*, deprecated, message: "use packageLocation instead")
5358
public var url: String {

Sources/Workspace/Workspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ extension Workspace {
17461746
// dependencies that have the same identity but from a different location
17471747
// which is an error case we diagnose an report about in the GraphLoading part which
17481748
// is prepared to handle the case where not all manifest are available
1749-
$0.packageKind.canonicalLocation == dependency.createPackageRef().canonicalLocation ?
1749+
$0.canonicalPackageLocation == dependency.createPackageRef().canonicalLocation ?
17501750
KeyedPair($0, key: Key(identity: dependency.identity, productFilter: dependency.productFilter)) : nil
17511751
}
17521752
}

0 commit comments

Comments
 (0)