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-11057] SwiftPM: transitive dependencies fetch original URLs if they appear in Package.resolved despite mirrors #4686

Open
weissi opened this issue Jul 2, 2019 · 3 comments
Assignees
Labels

Comments

@weissi
Copy link
Member

weissi commented Jul 2, 2019

Previous ID SR-11057
Radar rdar://problem/52529011
Original Reporter @weissi
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee @tomerd
Priority Medium

md5: 5072becf92410481f084ab50c44aab4c

Issue Description:

if I have a repository with the following dependencies (arrow means 'depends on')

https://internal/my_repo -> https://internal/some_other_repo -> https://github.com/apple/swift-log

This bug only manifests if the mirrored repository is a transitive and not a direct dependency.

Then running swift build will produce such a Package.resolved file:

$ grep github.com Package.resolved 
        "repositoryURL": "https://github.com/apple/swift-log.git",

which is correct. If I now configure a mirror like so:

$ export SWIFTPM_MIRROR_CONFIG=/Path/To/My/SwiftPM/Mirror/config 

that covers swift-log and all other github.com dependencies, I would hope that swift build never contacts github.com because the whole idea of the mirroring is that it never needs to reach out of say a company's network.

However:

$ swift build
Fetching https://internal/some_other_repo
Fetching https://github.com/apple/swift-log.git     ## <<<<< BAD
Completed resolution in 4.33s
Cloning https://github.com/apple/swift-log.git      ## <<<<< BAD
Resolving https://github.com/apple/swift-log.git at 1.1.0
Cloning https://internal/some_other_repo
Resolving https://internal/some_other_repo at 1.0.7
Updating https://internal/some_other_repo
Fetching https://internal/mirrors/swift-log.git
Completed resolution in 4.76s
Removing https://github.com/apple/swift-log.git
Cloning https://internal/mirrors/swift-log.git
Resolving https://internal/mirrors/swift-log.git at 1.1.0

So the good thing is that it converges to the right solution (using the mirrors instead of github.com) but in the intermediate steps, it does fetch from github.com, despite a mirror being configured.

Tested with:

$ jw-swift-5.1 swift -version
Apple Swift version 5.1-dev (LLVM 2238e51577, Swift 16859f1963)
Target: x86_64-apple-darwin19.0.0
@weissi
Copy link
Member Author

weissi commented Jul 2, 2019

@swift-ci create

@weissi
Copy link
Member Author

weissi commented Apr 27, 2021

fix lives in #3447

CC @tomerd

@weissi
Copy link
Member Author

weissi commented Apr 12, 2022

@tomerd can we close this? I think this is believed to be fixed.

@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

2 participants