-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add canonical package location to SwiftPMCacheKey to differentiate the same target when its package is changed from remote one to local one (or vice-versa) #168
Conversation
…et when its package is changed from remote one to local one (or vice-versa)
This might be insufficient so converting to draft for now. |
…differentiate remote and local packages
I fixed the implementation using CanonicalPackageLocation instead of PackageIdentity and added the test case. |
@@ -96,6 +96,7 @@ extension PinsStore.PinState: @retroactive Hashable { | |||
} | |||
|
|||
public struct SwiftPMCacheKey: CacheKey { | |||
public var canonicalPackageLocation: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about the remote URL being embedded. If it's used in a mirrored repository, all caches will be expired. I think it's better to be it Optional
and it should have only for local packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, I addressed this in 0f6e237.
103d4c6
to
507be71
Compare
For remote packages, dependency mirroring will be a problem, so avoiding.
507be71
to
0f6e237
Compare
Currently there is no package information in SwiftPMCacheKey.
ref: https://github.com/swiftlang/swift-package-manager/blob/bc689418acad746af6f2e24e6bef640e411d9bd7/Sources/PackageModel/PackageIdentity.swift#L16-L19