Skip to content

refine location comparison when pre-loading package state from local state #7002

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
merged 2 commits into from
Oct 17, 2023

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Oct 13, 2023

motivation: when changing between canonical dependency URLs SwiftPM over-caches and ignores changes in manifest until local cache is deleted. this can lead to auth issues when switching between https and ssh for example

changes:

  • take into account URL scheme when comparing dependency locations
  • always prefer root dependencies when computing preferred URLs
  • clean up call sites that compare dependecy location
  • add and expand tests

rdar://105732543

@tomerd tomerd changed the title refine location comparison when pre-loading package state from local … refine location comparison when pre-loading package state from local state Oct 13, 2023
@tomerd
Copy link
Contributor Author

tomerd commented Oct 13, 2023

@swift-ci test

@tomerd
Copy link
Contributor Author

tomerd commented Oct 14, 2023

@swift-ci test macOS

1 similar comment
@tomerd
Copy link
Contributor Author

tomerd commented Oct 14, 2023

@swift-ci test macOS

@@ -125,3 +125,12 @@ final class ContainerProvider {
}
}
}

extension ThreadSafeKeyValueStore where Key == PackageReference, Value == PubGrubPackageContainer {
subscript(comparingLocation package: PackageReference) -> PubGrubPackageContainer? {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: missing doc comment

…state

motivation: when changing between canonical dependency URLs SwiftPM over-caches and ignores changes in manifest until local cache is deleted. this can lead to auth issues when switching between https and ssh for example

changes:
* take into account URL scheme when comparing dependency locations
* always prefer root dependencies when computing preferred URLs
* clean up call sites that compare dependecy location
* add and expand tests

rdar://105732543
@tomerd
Copy link
Contributor Author

tomerd commented Oct 17, 2023

@swift-ci test

@tomerd tomerd enabled auto-merge (squash) October 17, 2023 03:02
@tomerd
Copy link
Contributor Author

tomerd commented Oct 17, 2023

@swift-ci test windows

@tomerd tomerd merged commit 1491d34 into swiftlang:main Oct 17, 2023
MaxDesiatov added a commit that referenced this pull request Oct 24, 2023
…m local state (#7002)"

I've verified that the reverted commit removes required packages from `Package.resolved` in certain dependency graphs.

This reverts commit 1491d34.

# Conflicts:
#	Sources/Workspace/Workspace+Manifests.swift
#	Sources/Workspace/Workspace.swift

Resolves rdar://117381924.
MaxDesiatov added a commit that referenced this pull request Oct 25, 2023
…7031)

I've verified that the reverted commit removes required packages from
`Package.resolved` in certain dependency graphs.

This reverts commit 1491d34.

```
# Conflicts:
#	Sources/Workspace/Workspace+Manifests.swift
#	Sources/Workspace/Workspace.swift
```

Resolves rdar://117381924.
tomerd added a commit that referenced this pull request Oct 25, 2023
@tomerd tomerd mentioned this pull request Oct 25, 2023
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