Skip to content

Plugin not working with package built using swift build and Xcode 16.3 #27

@TomaszLizer

Description

@TomaszLizer

I have a package in which I wanted to use asset catalog in typesafe way, tried ColorResource yet it was not working with swift build.
At that point I tried converting it to leverage SwiftGen instead and it worked just fine in xcode, yet failed with swift build...
Turns out this seems to be incompatibility with Xcode 16.3.
Not sure if this is issue of the plugin or bug in xcode 16.3 (Tbh I bet this is the latter case, yet maybe someone can help).
Issue manifests with this error:

error: a prebuild command cannot use executables built from source, including executable target 'swiftgen'
error: build planning stopped due to build-tool plugin failures
[0/1] Planning build
error: a prebuild command cannot use executables built from source, including executable target 'swiftgen'
error: build planning stopped due to build-tool plugin failures

It is particularly interresting that it says executables built from source whereas swiftgen executable is a binaryTarget...

Turns out that when dropping back to Xcode 16.2 it works just fine with swift build as well:

Image

Issue can be reproduced using this example project: https://github.com/TomaszLizer/TestSwiftGenPlugin
converting plugin package to local and using local binary (by path) did not helped as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions