swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.76k stars 1.35k forks source link

Unable to add a dependency in Xcode with git SSH commit signing enabled #5747

Open kjvalencik opened 2 years ago

kjvalencik commented 2 years ago

Description

Git 2.34 added the ability to sign commits with SSH keys.

When enabled, SPM fails to resolve tags on dependencies.

Expected behavior

SPM would be able to resolve tags, optionally verifying tags if enabled and trusted keys are configured.

Actual behavior

SPM fails to parse the git config when gpg.format = ssh is seen as an invalid option.

This error continues even when tag verification is disabled with git config --global tag.forcesignannotated false.

image image

Steps to reproduce

Enable SSH key signing in ~/.gitconfig

[user]
    signingkey = key::ssh-...SSH public key...
[commit]
    gpgsign = true
[gpg]
    program = gpg
    format = ssh

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.6.0

Swift & OS version (output of swift --version && uname -a)

swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: x86_64-apple-macosx12.0
Darwin example.lan 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64
neonichu commented 2 years ago

Just to clarify, you're talking about SwiftPM, but the errors shown are from Xcode. Does this reproduce when using swift build as well?

kjvalencik commented 2 years ago

It appears to only happen from Xcode and not when using swift package directly. Apologies if this is the wrong place or if I'm describing things incorrectly. I am not an Apple or Swift developer.