Skip to content

[Collections] 'describe' package matching is too loose #3543

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
Jun 11, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Jun 10, 2021

Motivation:
rdar://79069839

To distinguish between package vs. collection URL, we first search for it as if it were a package URL. The package search, however, is done using PackageIdentity and not the actual URL itself. The problem with identity is that it only uses the last URL path component, so bar/foo and baz/foo would end up with the same identity foo.

Modifications:
Update findPackage to allow multiple results since a package identity (the way it is) can be associated with multiple repository URLs. Caller of findPackage should then filter out packages by repository URL if needed.

Motivation:
rdar://79069839

To distinguish between package vs. collection URL, we first search for it as if it were a package URL. The package search, however, is done using `PackageIdentity` and not the actual URL itself. The problem with identity is that it only uses the last URL path component, so `bar/foo` and `baz/foo` would end up with the same identity `foo`.

Modifications:
Update `findPackage` to allow multiple results since a package identity (the way it is) can be associated with multiple repository URLs. Caller of `findPackage` should then filter out packages by repository URL if needed.
@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 10, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 10, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 11, 2021

@swift-ci please smoke test macOS

@yim-lee yim-lee merged commit 5e638b0 into swiftlang:main Jun 11, 2021
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Jun 11, 2021
* [Collections] 'describe' package matching is too loose

Motivation:
rdar://79069839

To distinguish between package vs. collection URL, we first search for it as if it were a package URL. The package search, however, is done using `PackageIdentity` and not the actual URL itself. The problem with identity is that it only uses the last URL path component, so `bar/foo` and `baz/foo` would end up with the same identity `foo`.

Modifications:
Update `findPackage` to allow multiple results since a package identity (the way it is) can be associated with multiple repository URLs. Caller of `findPackage` should then filter out packages by repository URL if needed.
@yim-lee yim-lee deleted the fix-describe branch June 11, 2021 21:35
yim-lee added a commit that referenced this pull request Jun 14, 2021
* [Collections] 'describe' package matching is too loose

Motivation:
rdar://79069839

To distinguish between package vs. collection URL, we first search for it as if it were a package URL. The package search, however, is done using `PackageIdentity` and not the actual URL itself. The problem with identity is that it only uses the last URL path component, so `bar/foo` and `baz/foo` would end up with the same identity `foo`.

Modifications:
Update `findPackage` to allow multiple results since a package identity (the way it is) can be associated with multiple repository URLs. Caller of `findPackage` should then filter out packages by repository URL if needed.
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.

2 participants