Skip to content

PR #414 broke displaying packages with different name from id #425

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

Closed
adam-fowler opened this issue Sep 28, 2022 · 10 comments
Closed

PR #414 broke displaying packages with different name from id #425

adam-fowler opened this issue Sep 28, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@adam-fowler
Copy link
Contributor

Describe the bug
SwiftPM versions using Package.resolved format version 1 (ie 5.5 or earlier) do not deal with packages that have the different name and id. This appears to have been caused by PR#414

To Reproduce
This package does not show the realm dependencies

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "my-package",
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(name: "my-package", targets: ["my-package"]),
    ],
    dependencies: [
        .package(url: "https://github.com/realm/realm-swift", .upToNextMajor(from: "10.28.0")),
    ],
    targets: [
        .target(name: "my-package", dependencies: ["realm-swift"])
    ]
)

cc @stevapple

@adam-fowler adam-fowler added the bug Something isn't working label Sep 28, 2022
@stevapple
Copy link
Contributor

I supposed #414 to only allow more package to be displayed, and didn’t expect this.

Will take some time to look into it.

@adam-fowler
Copy link
Contributor Author

It is related to the Package.resolved v1 not having an identity field and it assuming it can use name instead as the identity. I was pretty sure this was working before #414 but maybe it was never working.

@adam-fowler
Copy link
Contributor Author

See #435

@stevapple
Copy link
Contributor

Given the fix I believe the real cause is #382 – hopefully we can avoid this being broken by adding a new test case.

@adam-fowler
Copy link
Contributor Author

@stevapple Can you think of a package I can use to test this with though? Needs to be something fairly small, but heavily used. Don't really want to use Realm as it takes ages to download.

@stevapple
Copy link
Contributor

@adam-fowler Do you think apple/swift-syntax is a better choice? (~10MB download)

@stevapple
Copy link
Contributor

I was a bit hesitated because SwiftSyntax is under heavy development and this is subject to change. SwiftProtobuf is another choice with ~25MB download.

@stevapple
Copy link
Contributor

Wait, we need to support Swift 5.4 CI, right? Then SwiftSyntax and AsyncAlgorithms aren't applicable. Is SwiftProtobuf something acceptable?

@adam-fowler
Copy link
Contributor Author

swift-cmark is fairly small. I'll use that

@adam-fowler
Copy link
Contributor Author

Fixed with #435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants