The release of Swift 5.3 supports @main as an entry point for for applications, including command line. It looks like SPM does not support this.
I started a simple executable using swift package init --type executable and implemented print("Hello World") in main.swift. At that point swift run` executes fine.
Executes fine from Xcode, but results in " error: no executable product available" from swift run. Checking the output of both variants from swift run -v shows that swiftc is never executing for the @main version of the implementation.
I feel like both the CLI and Xcode should result in the same behavior.
Edit: Sorry, @wowbagger. Your post first appeared on my screen after I posted. I had no intention of stomping your answer. Had I seen it first, I would not have posted.
Parts of the implementation of @main were ready in time for 5.3, others weren’t. SwiftPM’s support fell in the second category. At the cutoff, SwiftPM still determined what was and wasn’t an executable based on the presence or absence of a file named main.swift. That has changed since.