Skip to content

api cleanup in preperation for identity improvements #3214

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 1 commit into from
Jan 29, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Jan 21, 2021

motivation: infrastructure towards improving package identity correctness

changes:

  • rename PackageReference::path to PackageReference::location
  • make PackageReference::kind explicitly set by the call-site with no default and add static builder functions
  • rename PackageContainerConstraint::identifier to PackageContainerConstraint::package to align to true meaning
  • rename PackageContainer::identifier to PackageContainer::package to align to true meaning
  • adjust tests

@tomerd
Copy link
Contributor Author

tomerd commented Jan 21, 2021

replaces some of the work done in #3152. this is the less risky subset of the changes, so we can create a separate PR for the more risky ones

@tomerd
Copy link
Contributor Author

tomerd commented Jan 21, 2021

@swift-ci please smoke test

@tomerd tomerd added the next waiting for next merge window label Jan 21, 2021
@tomerd tomerd changed the title api cleanup in preperation for identity improvments api cleanup in preperation for identity improvements Jan 21, 2021
@@ -95,7 +95,7 @@ public enum DependencyResolutionNode {
// Don’t create a version lock for anything but a product.
guard specificProduct != nil else { return nil }
return PackageContainerConstraint(
container: package,
package: package,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call this packageReference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neonichu we could, but in many other places in the code vase it is called "package". I actually have a commit with this change but its large if we want to be consistent. wdyt?

@@ -24,35 +24,35 @@ import TSCUtility
/// should be used as-is. Infact, they might not even have a git repository.
/// Examples: Root packages, local dependencies, edited packages.
public final class LocalPackageContainer: PackageContainer {
public let identifier: PackageReference
public let package: PackageReference
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call this packageReference?

motivation: infrastructure towards improve correctness by using identity more broadly throughout the code

changes:
* rename PackageReference::path to PackageReference::location
* make PackageReference kinf explicitly set by the callsite with no default
* rename PackageContainerConstraint::identifier to PackageContainerConstraint::package
* rename PackageContainer::identifier to PackageContainer::package
* adjust tests
@tomerd tomerd force-pushed the refactor/identity-01 branch from ca6fab3 to 606a9e1 Compare January 28, 2021 20:33
@tomerd
Copy link
Contributor Author

tomerd commented Jan 28, 2021

@swift-ci please smoke test

@tomerd tomerd self-assigned this Jan 28, 2021
@tomerd
Copy link
Contributor Author

tomerd commented Jan 28, 2021

@swift-ci please smoke test linux

@tomerd
Copy link
Contributor Author

tomerd commented Jan 28, 2021

/home/buildnode/jenkins/workspace/swift-package-manager-Linux-smoke-test/branch-main/swift-corelibs-foundation/Sources/Foundation/Data.swift:25:8: error: missing required module 'SwiftOverlayShims'
15:17:50 import Glibc

@tomerd tomerd merged commit bf4dd4c into swiftlang:main Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next waiting for next merge window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants