Cannot resolve the dependencies with swift package registry
- Dominant language
- Assembly
- Stars
- 1.7k
- Forks
- 223
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
Description
### Question Checklist
- [x] I'm using the latest version of Swift Crypto (main branch)
- [x] I read the [Contribution Guidelines](https://github.com/apple/swift-crypto/blob/main/CONTRIBUTING.md)
- [x] I searched for [existing GitHub issues](https://github.com/apple/swift-crypto/issues)
### 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: https://github.com/swiftlang/swift-package-manager/issues/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 ](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/PackageRegistryUsage.md#using-registry-for-source-control-dependencies)
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
Contributor guide
Research direction
Start with Package.swift and reproduce the dependency resolution command `swift package resolve --use-registry-identity-for-scm`. Compare the `swift-asn1` product reference with the package registry behavior and review the linked Swift Package Manager issue 8116; done means establishing whether this repository can resolve the dependency or documenting the external blocker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100