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-4621] [PackageManager] Package fetch with authentication broken. #5034

Closed
swift-ci opened this issue Apr 18, 2017 · 3 comments
Closed

[SR-4621] [PackageManager] Package fetch with authentication broken. #5034

swift-ci opened this issue Apr 18, 2017 · 3 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-4621
Radar rdar://problem/30661854
Original Reporter jfilling (JIRA User)
Type Bug
Status Closed
Resolution Duplicate
Environment

Swift-3.1 RELEASE
MacOS 10.12.3

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

md5: 11778934c6398f702d4ea2ffc76bce9f

duplicates:

  • SR-6735 github fetch silently stuck waiting for ssh passphrase

is duplicated by:

  • SR-6735 github fetch silently stuck waiting for ssh passphrase

relates to:

  • SR-3981 Using private repository for editable package

Issue Description:

With the Swift 3.1 release, it appears that fetching packages from URLs that require authentication is broken.

Either https or ssh access results in a hang when attempting to fetch via 'swift package fetch' or via 'swift build'.

This was detected during an upgrade from Swift 3.0.1 RELEASE to Swift 3.1 RELEASE. I have only tested this with gitlab, but making a project Public allows it to be fetched.

@ankitspd
Copy link
Member

This seem to happen when host authenticity is not established i.e. when git shows prompts like this:

The authenticity of host 'gitlab.com (52.167.219.168)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)?

From what I understand this should have been solved by #1001 but looks like it doesn;t work for host authenticity prompt.

Workaround: Make sure it is possible to clone the repository using git.

@swift-ci
Copy link
Contributor Author

Comment by Jeremy Fillingim (JIRA)

I'm not experiencing the particular issue that you are pointing out (meaning I don't have the host authenticity issue) when I clone my private repositories with git via both https and ssh.

I'm working around it by using Swift 3.0.1 (where the issue does not exist), but it was disappointing to encounter a flaw of this type in an official release.

Here is a capture of some (hopefully) illustrative commands:

When I clone the following repository via https, it prompts me for username and password, and succeeds.

$ git clone https://gitlab.com/XYZ/systemmodules
Cloning into 'systemmodules'...
Username for 'https://gitlab.com': jfilling
Password for 'https://jfilling@gitlab.com':
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 14 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (14/14), done.

When the fetch happens through swift, I am prompted for a username, then nothing else happens.

$ swift package fetch
Fetching https://gitlab.com/XYZ/systemmodules
Username for 'https://gitlab.com': jfilling

I have a line in my Package.swift file that looks like:

dependencies: [ .Package(url: "https://gitlab.com/XYZ/systemmodules", majorVersion: 1) ],

@ankitspd
Copy link
Member

That patch probably hasn't made into the 3.1 release then. I suggest using a SSH key and git+ssh instead of https.
Note: That patch doesn't fix the prompt issue but just errors out instead of hanging.

@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

2 participants