You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
When I call swift package describe on a package which has an executable product which is just a proxy to a binaryTarget, the command fails because executable product is identified as missing an executable target.
ex:
error: 'bugrepro': executable product 'ForwardedSourcery' expects target 'SourceryTool' to be executable; an executable target requires a 'main.swift' file
If I then add an explicit main.swift file, I get a conflicting error when resolving the package graph: the executable product has two executable targets, and should only have one.
ex:
executable product 'ForwardedSourcery' should not have more than one executable target
These two errors are at odds with each other - is a binaryTarget an executable target or not?
Expected behavior
binaryTarget should be appropriately identified as an executable target, or have the ability to opt-in/out to being identified as an executable target if automatic detection is impossible.
Actual behavior
binaryTarget counting as an executable target will change depending on context.
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0
Darwin US-PA-A-MCORN 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 arm64
The text was updated successfully, but these errors were encountered:
sleepygarden
changed the title
Conflicting detection of executable targets on when using a binaryTarget on a executable product
Conflicting detection of executable targets on when using a binaryTarget on an executable product
Nov 5, 2024
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
When I call
swift package describe
on a package which has anexecutable
product which is just a proxy to abinaryTarget
, the command fails because executable product is identified as missing an executable target.ex:
error: 'bugrepro': executable product 'ForwardedSourcery' expects target 'SourceryTool' to be executable; an executable target requires a 'main.swift' file
If I then add an explicit main.swift file, I get a conflicting error when resolving the package graph: the executable product has two executable targets, and should only have one.
ex:
executable product 'ForwardedSourcery' should not have more than one executable target
These two errors are at odds with each other - is a
binaryTarget
an executable target or not?Expected behavior
binaryTarget
should be appropriately identified as an executable target, or have the ability to opt-in/out to being identified as an executable target if automatic detection is impossible.Actual behavior
binaryTarget
counting as an executable target will change depending on context.Steps to reproduce
Sample project attached
BugRepro.zip
Swift Package Manager version/commit hash
Swift Package Manager - Swift 6.0.0-dev
Swift & OS version (output of
swift --version ; uname -a
)swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0
Darwin US-PA-A-MCORN 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 arm64
The text was updated successfully, but these errors were encountered: