What are the reasons why `package edit` fails?

I am trying to put a package in an edit mode (Swift 6.0)

The following command fails:

% swift package edit PoieticCore --path ../poietic-core
warning: dependency 'PoieticCore' was not found

The package dependency is there, the local directory (../poietic-core) is there as well, the package names PoieticCore match.

When I try to use the identity/folder name poietic-core as the package name it results in:

% swift package edit poietic-core --path ../poietic-core
error: 'poietic-core': package at '/…/poietic-core' is PoieticCore but was expecting poietic-core

I also tried clean, purge-cache and reset as well as removing all swift package manager folders in the project.

Relevant part from the swift package describe output:

Name: poietic
Manifest display name: poietic
Path: /…/poietic-tool
Tools version: 6.0
Dependencies:
...

    Type:
        sourceControl
    Identity:
        poietic-core
    Url: https://github.com/openpoiesis/poietic-core
    Requirement:
        Branch:
            main
...

Where else should I look for potential issues that prevent me to put the package(s) in edit mode?

I found the following:

  • an issue that prevents editing (when the package display name doesn't match the package identity).

  • a forums post and pull request that might fix the issue (when Swift 6.1 is released next year).

Can you change the package display name?

 let package = Package(
-    name: "PoieticCore",
+    name: "poietic-core",
1 Like

Changing the package display name to the same name as the directory helped. thank you!