Skip to content

Executable target depending on executable product backed by a binary target fails to build #9222

@FranzBusch

Description

@FranzBusch

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

Related to: apple/swift-protobuf#1854 (comment)

A package with the following setup

import PackageDescription

let package = Package(
    name: "swift-proto-repro",
    products: [
        .executable(
            name: "repro",
            targets: ["repro"]),
    ],
    dependencies: [
        .package(url: "https://github.com/apple/swift-protobuf", from: "1.31.1"),
    ],
    targets: [
        .executableTarget(
            name: "repro",
            dependencies: [
                .product(name: "protoc", package: "swift-protobuf"),
            ]
        ),
    ],
)

Fails to build running swift build with the following error

error: InternalError(description: "Internal error. Please file a bug at https://github.com/swiftlang/swift-package-manager/issues with this info. No description for product: <ResolvedProduct: protoc, executable>")

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions