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-6493] Cannot edit package dependencies where directoryName != identifier #4908

Open
ephemer opened this issue Nov 29, 2017 · 4 comments
Open
Labels

Comments

@ephemer
Copy link

ephemer commented Nov 29, 2017

Previous ID SR-6493
Radar rdar://problem/33693433
Original Reporter @ephemer
Type Bug
Environment

Any

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

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.

@ankitspd
Copy link
Member

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).

@swift-ci
Copy link
Contributor

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.

@ankitspd
Copy link
Member

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.

@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
@jpgrayson
Copy link

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 swift-argument-parser dependency can be made editable, but, perplexingly, the PlayingCard package cannot (even with the workaround from the original issue).

I note that another pathology is that swift package edit returns success (0) even when it fails to make

#!/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 $?

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

5 participants