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-12191] xcodebuild -resolvePackageDependencies does not work correctly with SSH agent #4597

Closed
swift-ci opened this issue Feb 12, 2020 · 4 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-12191
Radar rdar://problem/59496032
Original Reporter kai-vala (JIRA User)
Type Bug
Status Closed
Resolution Invalid

Attachment: Download

Environment

Xcode Version 11.3.1 (11C505)
macOS Mojave 10.14.4 (18E226)
OpenSSH_7.9p1, LibreSSL 2.7.

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

md5: 7a808af90e0555bc2546db56b24c98a4

Issue Description:

Seems to only work if you have an id_rsa in your local ssh directory.

1) Example, check you have ssh key loaded:
ssh-add -l
> 2048 SHA256:<key-stuff>//<more-key-stuff> /Users/<user>/.ssh/id_rsa (RSA)

2) Delete or rename your local id_rsa

3) Try to clone a private repo (this works)
git clone git@github.com:<private-org>/<private-framework01>.git tempDir

4) Try to resolve package. dependencies (does NOT work):
xcodebuild -resolvePackageDependencies -workspace <Project1>.xcworkspace -scheme <Scheme2>

Fetching git@github.com:<private-org/<private-framework01>.git

xcodebuild: error: Could not resolve package dependencies:
Authentication failed because the credentials were rejected

Ran into this case with Team City CI when trying to use their SSH agent build feature, the same thing happens locally.

@swift-ci
Copy link
Contributor Author

Comment by Kai Molander (JIRA)

Example of what we have in the project file:

B7E15B9923CDD40E00FC7C3D /* XCRemoteSwiftPackageReference "private-framework02" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "git@github.com:<private-org>/<private-framework02>.git";
requirement = {
kind = exactVersion;
version = 0.5.5;
};
};

B7E15BDD23CDDD9200FC7C3D /* XCRemoteSwiftPackageReference "private-framework01" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "git@github.com:<private-org>/<private-framework01>.git";
requirement = {
kind = exactVersion;
version = "1.5.55-stuff-goes-here";
};
};

@beccadax
Copy link
Contributor

@swift-ci create

@ankitspd
Copy link
Member

Thanks for reporting this. I am closing this since it's a bug in Xcode and not OSS SwiftPM. As a workaround, you can try passing `-usePackageSupportBuiltinSCM` flag to xcodebuild.

@ankitspd
Copy link
Member

Feel free to report this issue using feedback assistant so you can track it http://feedbackassistant.apple.com

@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