swiftlang/swift-package-manager

swift package show-dependencies is failing after bumping to swift-syntax's prerelease

Closed this issue · 1 comments

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

While bumping to swif-syntax's 600.0.0-prerelease-2024-06-12

with:

swift package --scratch-path <DERIVED_DATA_PATH> update 'swift-syntax'

I'm having an error while running:

swift package --scratch-path <DERIVED_DATA_PATH> show-dependencies --format json --output-path <OUTPUT_PATH>

My first hunch was if this is not due to semver tag name: 600.0.0-prerelease-2024-06-12, but I highly doubt since that looks.

I'm seeing that I have a package that targets 601.0.0-prerelease that I can't find as of today. Could that be the issue?

Thanks.

Expected behavior

I would expect that show-depencies run without an error and output a JSON file when we run:

swift package --scratch-path <DERIVED_DATA_PATH> show-dependencies --format json --output-path <OUTPUT_PATH>

Actual behavior

It's triggering an error and telling the user to open an issue in this Github repo.

I have a warning, though:

warning: 'swift-syntax': /path-to-derived-data/SourcePackages/repositories/swift-syntax-463e60c9 is not valid git repository for 'https://github.com/apple/swift-syntax', will fetch again.

And the error is:

error:
 InternalError(
    description: 
    "Internal error. Please file a bug at https://github.com/apple/swift-package-manager/issues with this info. Expected root cause 
    
    {   swift-syntax[everything] 509.0.0..<601.0.0, swift-perception[everything] 1.1.7..<2.0.0} to almost satisfy the current partial solution:
     * [Decision 0: sources[everything] 1.0.0]
     * [Derivation: xctest-dynamic-overlay[everything] 0.2.1..<10000.0.0 ← {sources[everything] 1.0.0,   xctest-dynamic-overlay[everything] 0.2.1..<10000.0.0}]
     * [Derivation: swift-snapshot-testing[everything] 1.11.1..<10000.0.0 ← {sources[everything] 1.0.0,  swift-snapshot-testing[everything] 1.11.1..<10000.0.0}]
     ...
     * [Derivation: swift-syntax[everything] 509.0.0..<601.0.0-prerelease ← {swift-snapshot-testing[everything] 1.16.2,
          swift-syntax[everything] 509.0.0..<601.0.0-prerelease}]
     ...
    ]
    ")

The omitted lines only contain other libs that don't depend on swift-syntax, but I can add them later if required.

Steps to reproduce

  1. Bump swift-syntax to 600.0.0-prerelease-2024-06-12
  2. Run swift package --scratch-path show-dependencies
  3. An error is triggered

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.10.0-dev

Swift & OS version (output of swift --version ; uname -a)

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Darwin mac.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64

Duplicate of #7643.