Skip to content

Cannot resolve the dependencies with swift package registry #295

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
3 tasks done
erikgadireddi opened this issue Nov 14, 2024 · 1 comment
Open
3 tasks done

Cannot resolve the dependencies with swift package registry #295

erikgadireddi opened this issue Nov 14, 2024 · 1 comment

Comments

@erikgadireddi
Copy link

erikgadireddi commented Nov 14, 2024

Question Checklist

Question Subject

How to make the Package.swift of this project work with swift package resolve --use-registry-identity-for-scm if I am using swift package registry where is the swift-asn1 package hosted.
I have everything set up correctly, but I am still getting error:
error: 'apple.swift-crypto': product 'SwiftASN1' required by package 'apple.swift-crypto' target '_CryptoExtras' not found in package 'swift-asn1'. Did you mean '.product(name: "SwiftASN1", package: "apple.swift-asn1")'?
It seems to me the line below from Package.swift, does not work properly with this command swift package resolve --use-registry-identity-for-scm :
.product(name: "SwiftASN1", package: "swift-asn1") in Package.swift .
I already filled a bug issue in spm: swiftlang/swift-package-manager#8116 , but I still hope I can somehow find a way how to make it work..

What I tried:

1. Attempt

I would guess the .product(name: "SwiftASN1", package: "swift-asn1") should be .product(name: "SwiftASN1", package: "apple.swift-asn1"), but then the spm returns error:
error: 'swift-crypto': unknown package 'apple.swift-asn1' in dependencies of target '_CryptoExtras'; valid packages are: 'swift-asn1' (from 'https://github.com/apple/swift-asn1.git')
I would guess the spm should resolve it but it does not...

2. Attempt

Changing the url to id: .package(id: "https://github.com/apple/swift-asn1.git", from: "1.2.0")
Based on the swift package registry readme
I got: error: 'error: 'swift-crypto': invalid manifest (evaluation failed) Invalid package identifier: 'https://github.com/apple/swift-asn1.git'
So this does not seem to work as expected as well.

Question Description

The package has id apple.swift-asn1 based on the syntax scope.name. I have also the package metadata such as remoteUrls: [git@github.com:apple/swift-asn1.git, https://github.com/apple/swift-asn1.git].
The swift-package-registry is hosted on artifactory.

Tools versions:
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx14.0
Darwin M-FVFFG20KQ05P 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:49:46 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T8103 arm64

@Lukasa
Copy link
Contributor

Lukasa commented Nov 14, 2024

Hrm, this seems like a question for Swift Package Manager: I'm not sure how this is supposed to work. If they can give guidance we'll happily adopt it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants