swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.72k stars 1.34k forks source link

[SR-9734] SPM get stuck in an infinite loop #4734

Open 0xTim opened 5 years ago

0xTim commented 5 years ago
Previous ID SR-9734
Radar None
Original Reporter @0xTim
Type Bug
Environment macOS 10.14.2 Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1) Target: x86_64-apple-darwin18.2.0
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 82a76cb7edafea119cb7c88af560b918

Issue Description:

When running swift package resolve with the following manifest, it gets stuck in an infinite loop. The reason is that fluent-postgresql is only a major version 1, 3.0.0 doesn't exist yet.

Steps to reproduce:

  1. Create empty SPM project

  2. Set Package.swift to the following:
    // swift-tools-version:4.2
    import PackageDescription``let package = Package(
    {{ name: "name",}}
    {{ dependencies: [}}
    {{ .package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),}}
    {{ .package(url: "https://github.com/vapor/fluent-postgresql.git", from: "3.0.0"),}}
    {{ .package(url: "https://github.com/vapor/auth.git", from: "2.0.0"),}}
    {{ ],}}
    {{ targets: [}}
    {{ .target(name: "App", dependencies: ["Authentication", "FluentPostgreSQL", "Vapor"]),}}
    {{ .target(name: "Run", dependencies: ["App"]),}}
    {{ .testTarget(name: "AppTests", dependencies: ["App"])}}
    {{ ]}}
    )

  3. Run swift package resolve

Expected outcome:

Actual outcome:
SPM gets stuck in an infinite loop

weissi commented 4 years ago

@aciidb0mb3r/ @neonichu pretty sure this is fixed with pubgrub?