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-12210] [5.2] Target depends on an unknown package #4593

Open
swift-ci opened this issue Feb 15, 2020 · 4 comments
Open

[SR-12210] [5.2] Target depends on an unknown package #4593

swift-ci opened this issue Feb 15, 2020 · 4 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-12210
Radar rdar://problem/59496049
Original Reporter tannernelson (JIRA User)
Type Bug
Environment

Apple Swift version 5.2 (swiftlang-1103.0.22 clang-1103.0.22)
Target: x86_64-apple-darwin19.2.0

https://swift.org/builds/swift-5.2-branch/xcode/swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-14-a/swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-14-a-osx.pkg

Version 11.4 beta (11N111s)
Toolchain: Swift 5.2 Snapshot 2020-02-14 (a)

macOS 10.15.2

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

md5: 8ed4f7d56eceb94fbbf6b4ed97820af7

Issue Description:

I'm getting the following error when upgrading my `swift-tools-version` from 5.1 to 5.2:

/Users/tanner/dev/vapor/fluent-kit/Package.swift: manifest parse error: target 'FluentKit' depends on an unknown package 'NIO'

Here's the Package.swift file:

// swift-tools-version:5.2
import PackageDescription

let package = Package(
    name: "fluent-kit",
    platforms: [
       .macOS(.v10_14)
    ],
    products: [
        .library(name: "FluentKit", targets: ["FluentKit"]),
        .library(name: "FluentBenchmark", targets: ["FluentBenchmark"]),
        .library(name: "FluentSQL", targets: ["FluentSQL"]),
    ],
    dependencies: [
        .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
        .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
        .package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0-beta.6.1"),
    ],
    targets: [
        .target(name: "FluentKit", dependencies: ["NIO", "Logging"]),
        .target(name: "FluentBenchmark", dependencies: ["FluentKit", "FluentSQL"]),
        .target(name: "FluentSQL", dependencies: ["FluentKit", "SQLKit"]),
        .testTarget(name: "FluentKitTests", dependencies: ["FluentBenchmark", "FluentSQL"]),
    ]
)
@beccadax
Copy link
Contributor

@swift-ci create

@ankitspd
Copy link
Member

Can you try with the latest snapshot? We've fixed some bugs in this area and improved the diagnostics.

@swift-ci
Copy link
Contributor Author

Comment by Jonny (JIRA)

Im also getting this with 5.2 but slightly different package:

import PackageDescription
let package = Package(
     name: "app",
     platforms: [
         .macOS(.v10_14)
     ],
      products: [
         .executable(name: "Run", targets: ["Run"]),
         .library(name: "App", targets: ["App"]),
     ],
     dependencies: [
         // � A server-side Swift web framework.
         .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0-beta.2"),
         .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0-beta.2"),
         .package(url: "https://github.com/vapor/fluent-postgres-driver.git", from: "2.0.0-beta.3"),
     ],
     targets: [
         .target(name: "App", dependencies: ["Fluent", "FluentPostgresDriver", "Vapor"]),
          .target(name: "Run", dependencies: ["App"]),
          .testTarget(name: "AppTests", dependencies: ["App", "XCTVapor"])
     ]
 )

manifest parse error: Unknown package 'Fluent' in dependencies of target 'App'

I don't think anything is mis-configured as it builds with 5.1 tools. This is using 11.4 beta 2 (11N123K) 🙂

@swift-ci
Copy link
Contributor Author

Comment by Ellen Shapiro (JIRA)

This is still happening on the final released version of Swift 5.2 in Xcode 11.4.

Swift forums thread: https://forums.swift.org/t/package-names-in-swift-5-2/34886

Bug on my library: apollographql/apollo-ios#1102

I attempted to change the `name` of the package on a branch, and while the `Package.resolved` picked up that name, I'm still getting the `unknown package in dependencies of target` error message

@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
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

4 participants