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

[SR-14393] SPM package repo URL conflicts fail resolution #4441

Open
stephencelis opened this issue Mar 23, 2021 · 1 comment
Open

[SR-14393] SPM package repo URL conflicts fail resolution #4441

stephencelis opened this issue Mar 23, 2021 · 1 comment
Labels

Comments

@stephencelis
Copy link
Contributor

Previous ID SR-14393
Radar rdar://problem/75743990
Original Reporter @stephencelis
Type Bug
Environment

Xcode 12.4

Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 1a056f06c807d89b50a4a494f3285c84

Issue Description:

Following from discussion here: https://forums.swift.org/t/package-url-conflicts/35915/9

If the same package is depended on twice in a project, for example in an upstream dependency as well as downstream, and the URL is slightly different, for example, upstream omits the ".git" of a GitHub package, and downstream includes it, then package resolution sometimes seems to omit this dependency entirely, leading to confusing "Missing package product" errors.

Ideally:

  • SPM would use the SHA/version information of the resolved packages even if the URLs are different and the user would not encounter any error, or

  • SPM would "canonicalize" common URL differences like these into a single representation, or

  • SPM would at least provide an error message that points to the mismatch

Pasted from the discussion for more context:

I've hit this a few times. Luckily in repos I'm an owner of so I can fix, but always more painful to debug and track down than I expect given the error messaging. The bug does appear to be non-deterministic, but here's an open source project that exhibits the issue on CI, and I was able to reproduce it:

https://github.com/pointfreeco/isowords/runs/2175855054?check_suite_focus=true

The error is "Missing package product 'XCTestDynamicOverlay'", which comes from a package that is depended on both upstream in several libraries, where ".git" is omitted from the repo name:

And then downstream, where the URL included ".git": https://github.com/pointfreeco/isowords/blob/2db490517a7768cd8d82807eabb33bf7ae1418ce/Package.swift#L42

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants