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-3975] SPM unable to recognize duplicate repo because URLs slightly differ #5104

Closed
swift-ci opened this issue Feb 16, 2017 · 5 comments
Closed
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-3975
Radar None
Original Reporter ylin (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: abab3f05ed6521ce2bf33194795e339a

duplicates:

  • SR-1195 Dependency names that differ only in case cause conflicts

Issue Description:

Here is a simple Package.swift that shows the issue:

import PackageDescription

let package = Package(
    name: "spm-strict-url-comparison",
    dependencies: [
       .Package(url: "https://github.com/IBM-Swift/SwiftyJSON.git", majorVersion: 15),
       .Package(url: "https://github.com/IBM-Swift/SwiftyJSON", majorVersion: 15)
    ]
)

The only difference between the two URLs is the `.git`. On Swift 3.0.2, this causes an error in the package fetch stage. On Swift 3.1 2/15 snapshot, package fetch succeeds, but compiling stage returns errors (because the same classes are fetched twice).

If I add `.git` to the second URL, Swift 3.0.2 is able to recognize the duplicate repo and fetch correctly.

The bigger issue is that if both dependency A and B fetch dependency C, but the URLs in A and B that point to C differ in the `.git`, this causes errors even though the URLs are still technically correct.

Issue originally identified in the public Swift@IBM Slack: https://swift-at-ibm.slack.com/archives/kitura/p1487266218001148

@ankitspd
Copy link
Member

some context here #249

@swift-ci
Copy link
Contributor Author

Comment by Youming Lin (JIRA)

Thanks for the context.

Was the discussion ever settled/resolved?

@ankitspd
Copy link
Member

I think we just need to implement the fix, it is a little complicated to do right now because we use the package URLs as unique keys to identify the dependencies.

  1. We need to remove the dependency on these URLs.
  2. We need to identify and verify that two cloned packages having different URLs but same package names are in fact equal and then do the right things.

@abertelrud
Copy link
Contributor

@abertelrud
Copy link
Contributor

Looks like this was marked as duplicate of SR-1195 but depending on how the fix was implemented, fixing the problem with differences in case might not fix this one (the presence or absence of a .git suffix).

@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
This issue was closed.
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