Compile a Single Swift File Against the Argument Parser Package (Without Using SwiftPM for the Executable)

Hello,

I'm having a terrible time figuring out how to compile a single .swift file using swiftc against a downloaded & locally-built copy of ArgumentParser, without using SPM for the executable.


For background on why I want to do this seemingly-strange thing:

I'm not a professional programmer, but rather an advanced AppleScript user, who's bumping his head against the ceiling of what is possible in ASObjC (namely: blocks, completion handlers).

For this, I have many small (1 - 20 line) compiled helper executables that I can run from AppleScript, which let me use the methods unavailable in ASObjC. I initially wrote these in Objective-C, but have transitioned to Swift. Right now, I am manually parsing the command-line arguments to these executables, but would really like to use swift-argument-parser.

These executables don't require any other 3rd-party packages, as they're only used to access macOS APIs. For several reasons, it's not currently feasible to have these executables be swift packages, nor is something like the excellent swift-sh the right solution.

I've done some extensive googling on the subject, but haven't found any workable solutions after many evenings spent on this. There's some mention of being able to bundle a SPM package into an XCFramework, but I wasn't able to get this to work either.


I've taken the following general steps:

  1. Download & build the ArgumentParser module.

    mkdir ~/Desktop/SPMDownload
    cd ~/Desktop/SPMDownload
    git clone https://github.com/apple/swift-argument-parser
    cd swift-argument-parser
    swift build -c release
    
  2. Import & use ArgumentParser in the desired source file, here ~/Desktop/example.swift:

    import ArgumentParser
    
    struct Greet: ParsableCommand {
        @Argument(help: "The thing to greet.")
        var name: String = "World"
    
        mutating func run() throws {
            print("Hello, \(name)!")
        }
    }
    
    Greet.main()
    
  3. Compile example.swift against ArgumentParser (not working):

    xcrun -sdk macosx swiftc -o ~/Desktop/example ~/Desktop/example.swift
    

    I've tried multiple command-line options here (both with & without trailing whitespace)...
    -I
    -L
    -l

    ...with various paths in the built ArgumentParser release folder located at...

    ~/Desktop/SPMDownload/swift-argument-parser/.build/release
    

    ...with no success.

What am I missing to be able to link example.swift against ArgumentParser?

I don't have a direct answer and someone here may have a more direct answer to your question.

But it might help to do the following to figure out how to do this on the command line:

  • Create a Swift package that has an executable target and product, includes your single file in its sources, and adds Argument Parser as a dependency.

  • Build the package with verbose logging and see how the package manager is invoking the compiler. (Or the build log if you do this in Xcode).

That should give you the incantation passed to the compiler.

1 Like

Thanks James – that's an excellent suggestion.

If I follow your suggestion & temporarily compile the example as a package:

mkdir example_package
cd example_package
swift package init --type tool
swift build -v -c release 2> ~/Desktop/example_package_log.txt

I get the following output to stderr from swift build:

Build Log
warning: 'example_package': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/Package.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.zWJtz9/vfs.yaml -swift-version 5 -package-description-version 5.10.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.m77zaY/Package-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.m77zaY/Package-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk --target=x86_64-apple-macosx13.0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.isRpud/example_package-manifest
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: x86_64-apple-macosx13.0
Running resolver because the following dependencies were added: 'swift-argument-parser' (https://github.com/apple/swift-argument-parser.git)
Fetching https://github.com/apple/swift-argument-parser.git from cache
Fetched https://github.com/apple/swift-argument-parser.git from cache (0.22s)
Computing version for https://github.com/apple/swift-argument-parser.git
warning: 'swift-argument-parser': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Package@swift-5.8.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.smIlSf/vfs.yaml -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.l4ZjrA/Package@swift-5.8-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.l4ZjrA/Package@swift-5.8-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk --target=x86_64-apple-macosx13.0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.QD1uPF/swift-argument-parser-manifest
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: x86_64-apple-macosx13.0
Computed https://github.com/apple/swift-argument-parser.git at 1.4.0 (0.33s)
Creating working copy for https://github.com/apple/swift-argument-parser.git
Working copy of https://github.com/apple/swift-argument-parser.git resolved at 1.4.0
warning: 'swift-argument-parser': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Package@swift-5.8.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.wkOQjP/vfs.yaml -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.2L848X/Package@swift-5.8-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.2L848X/Package@swift-5.8-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk --target=x86_64-apple-macosx13.0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.fpIpRS/swift-argument-parser-manifest
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: x86_64-apple-macosx13.0
info: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPlugin.swift /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPluginError.swift /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/PackagePlugin+Helpers.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/PluginAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-diagnostics-path /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual.dia -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -module-name GenerateManual -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -emit-module-doc-path /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManual-1.swiftdoc -emit-module-source-info-path /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManual-1.swiftsourceinfo -parse-as-library -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManual-1.swiftmodule -emit-abi-descriptor-path /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManual-1.abi.json
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPlugin.swift /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPluginError.swift /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/PackagePlugin+Helpers.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/PluginAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-diagnostics-path /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual.dia -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -module-name GenerateManual -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManualPlugin-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPlugin.swift -primary-file /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPluginError.swift /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/PackagePlugin+Helpers.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/PluginAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-diagnostics-path /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual.dia -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -module-name GenerateManual -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManualPluginError-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPlugin.swift /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/GenerateManualPluginError.swift -primary-file /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/checkouts/swift-argument-parser/Plugins/GenerateManual/PackagePlugin+Helpers.swift -target x86_64-apple-macosx13.0 -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/PluginAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-diagnostics-path /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual.dia -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -module-name GenerateManual -disable-clang-spi -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/PackagePlugin+Helpers-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Wl,-add_ast_path,/var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManual-1.swiftmodule /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManualPlugin-1.o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/GenerateManualPluginError-1.o /var/folders/qb/v4207vy10dsgkg11hwtq3ynw0000gn/T/TemporaryDirectory.lmKJja/PackagePlugin+Helpers-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk --target=x86_64-apple-macosx13.0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/PluginAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackagePlugin -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/PluginAPI -o /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual -o /Users/__USERNAME__/Desktop/SPMDownload/swift-argument-parser/example_package/.build/plugins/cache/GenerateManual.dSYM
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: x86_64-apple-macosx13.0

Hopefully this can help someone direct me on how to use swiftc directly on example.swift – I'm unfortunately not much further ahead after reading through the above log. I think it's not helped by the fact that ArgumentParser is a more complicated package with multiple build products.