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

Product required by package not found. Did you mean .product(name: "Foo", package: "bar")? #7732

Open
1 task done
alicerunsonfedora opened this issue Jun 29, 2024 · 1 comment

Comments

@alicerunsonfedora
Copy link

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

In my livestream today, I attempted to expose a product (CPlaydate) from a dependent package (PlaydateKit):

products: [
        .library(name: "PlaydateKit", targets: ["PlaydateKit"]),
        .library(name: "CPlaydate", targets: ["CPlaydate"])],

However, upon doing so, I ended up receiving this odd error:

$ swift build -c release
error: 'packageresolved': product 'CPlaydate' required by package 'packageresolved' target 'PackageResolved' not found in package 'playdatekit'. Did you mean '.product(name: "CPlaydate", package: "playdatekit")'?
error: ExitCode(rawValue: 1)

Even though my code was defined as:

.target(
            name: "PackageResolved",
            dependencies: [
                .product(name: "CPlaydate", package: "PlaydateKit"),
                .product(name: "PlaydateKit", package: "PlaydateKit"),
                "Charolette",
                "KDL"
            ],
            swiftSettings: swiftSettingsSimulator
        ),

Livestream clip here: https://www.youtube.com/live/vVdejfuPlHc?si=HFln50UoRPCT2u8M&t=3650

@rauhul also noticed this error on the livestream.

Expected behavior

The command swift build -c release works as expected.

Actual behavior

However, upon doing so, I ended up receiving this odd error:

$ swift build -c release
error: 'packageresolved': product 'CPlaydate' required by package 'packageresolved' target 'PackageResolved' not found in package 'playdatekit'. Did you mean '.product(name: "CPlaydate", package: "playdatekit")'?
error: ExitCode(rawValue: 1)

Steps to reproduce

No response

Swift Package Manager version/commit hash

Swift Package Manager - Swift 6.0.0-dev

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

Swift version 6.0-dev (LLVM ed26ccb500109e5, Swift b3b2f37262690ca)
Target: x86_64-unknown-linux-gnu
Linux ForestSurface 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

@MaxDesiatov
Copy link
Contributor

MaxDesiatov commented Jul 2, 2024

Please provide a self-contained sample archive or package to reproduce this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants