Skip to content
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

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

ikesyo
Copy link
Collaborator

@ikesyo ikesyo commented Dec 12, 2024

…et when its package is changed from remote one to local one (or vice-versa)
@ikesyo ikesyo marked this pull request as draft December 12, 2024 10:12
@ikesyo
Copy link
Collaborator Author

ikesyo commented Dec 12, 2024

This might be insufficient so converting to draft for now.

@ikesyo ikesyo changed the title Add PackageIdentity to SwiftPMCacheKey to differentiate the same target when its package is changed from remote one to local one (or vice-versa) 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) Dec 13, 2024
@ikesyo
Copy link
Collaborator Author

ikesyo commented Dec 13, 2024

I fixed the implementation using CanonicalPackageLocation instead of PackageIdentity and added the test case.

@ikesyo ikesyo marked this pull request as ready for review December 13, 2024 02:39
@ikesyo ikesyo requested a review from freddi-kit December 13, 2024 02:39
@@ -96,6 +96,7 @@ extension PinsStore.PinState: @retroactive Hashable {
}

public struct SwiftPMCacheKey: CacheKey {
public var canonicalPackageLocation: String
Copy link
Owner

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.

Copy link
Collaborator Author

@ikesyo ikesyo Dec 13, 2024

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.

@ikesyo ikesyo requested a review from giginet December 13, 2024 05:35
@ikesyo ikesyo force-pushed the add-packageidentity-to-swiftpmcachekey branch from 103d4c6 to 507be71 Compare December 13, 2024 05:43
For remote packages, dependency mirroring will be a problem, so avoiding.
@ikesyo ikesyo force-pushed the add-packageidentity-to-swiftpmcachekey branch from 507be71 to 0f6e237 Compare December 13, 2024 06:02
@ikesyo ikesyo merged commit 2c1144a into giginet:main Dec 13, 2024
2 checks passed
@ikesyo ikesyo deleted the add-packageidentity-to-swiftpmcachekey branch December 13, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants