Skip to content

swift package describe fails when package contains a product backed by a binary target #9221

@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

Raised here apple/swift-protobuf#1854 (comment)

Summary

Running xcrun swift package describe --type json on the latest swift-protobuf main branch fails because the executable product protoc is authored as an executable target without a main.swift entry point.

Steps to Reproduce

  1. git clone https://github.com/apple/swift-protobuf.git
  2. cd swift-protobuf
  3. Ensure you are on the current main branch
  4. Run xcrun swift package describe --type json

Expected Result

The command succeeds and emits the package description.

Actual Result

error: 'swift-protobuf': executable product 'protoc' expects target 'protoc' to be executable; an executable target requires a 'main.swift' file

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