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-6493] Cannot edit package dependencies where directoryName != identifier #4908
Comments
This will be fixed when we provide an API to express the package identity of a dependency. That API is expected to be only used when a dependency basename is not equal to the dependency name (identity). |
Comment by Shawn Morel (JIRA) Any update on this? I just got bit by this. Along with a handful of other ergonomic issues, SPM continues to be painful to use. |
Starting Swift 4.1, the edit command can take either the package name or the dependency's basename, unless the dependency couldn't be resolved at all. I'd love to know about the other issues you're facing. |
This still remains an issue, but it seems that the workaround no longer works. Tested with SPM from Swift 5.9, 5.8, and HEAD of SPM. Here is a simple reproducer script. It demonstrates that the I note that another pathology is that #!/usr/bin/env bash
set -x
git clone https://github.com/apple/example-package-dealer.git dealer
git clone https://github.com/apple/example-package-playingcard.git
git clone https://github.com/apple/swift-argument-parser.git
cd dealer
# This succeeds in making swift-argument-parser editable
swift package edit --path ../swift-argument-parser swift-argument-parser
# This fails to make PlayingCard editable
swift package edit --path ../example-package-playingcard PlayingCard
# warning: dependency 'PlayingCard' was not found
# Attempt the workaround of making a symlink with the same name as the package
ln -s example-package-playingcard ../PlayingCard
# Still fails
swift package edit --path ../PlayingCard PlayingCard
# warning: dependency 'PlayingCard' was not found
# Success exit code even though package was not made editable.
echo $? |
Environment
Any
Additional Detail from JIRA
md5: 5685ffeadfa5ada920e1ac453fbb487d
Issue Description:
in Package.swift:
dependencies: [
.package(url: "./swift-examplePackage", .branch("master")) // exposes "examplePackage"
]
swift package edit examplePackage --path swift-examplePackage
error: Could not find dependency 'examplePackage'
Creating a symlink from swift-examplePackage to examplePackage and running the command again with
swift package edit examplePackage --path examplePackage
works.
The text was updated successfully, but these errors were encountered: