migueldeicaza / SwiftGodot

New Godot bindings for Swift
https://migueldeicaza.github.io/SwiftGodotDocs/tutorials/swiftgodot-tutorials/
MIT License
1.06k stars 65 forks source link

Fix build command execution on Windows using Swift 5.10 #423

Closed tishin closed 5 months ago

tishin commented 5 months ago

Fixes #418

We have two build commands here:

  1. prebuildCommand which works as a source generator on Windows, but shouldn't work by design (on macOS it throws a prebuild command cannot use executables built from source, including executable target 'Generator'). On Swift 5.9 this command also added sources from outputFilesDirectory to the build, which does not happen on Swift 5.10. Not sure if we should report this, as our use case is wrong to begin with.
  2. buildCommand which does not generate sources on Windows (the .exe never gets called), but works as a source provider through outputFiles. I have already reported the issue at https://github.com/apple/swift-package-manager/issues/6962

So combining the two broken things makes the build work again on Swift 5.10 toolchain. ~This shouldn't affect 5.9 builds, as buildCommand does not add any actual workload to the build.~ I wish there was a less hacky solution.

tishin commented 5 months ago

Disabled buildCommand on Swift 5.9 for Windows since 5.9 github action got stuck.

migueldeicaza commented 5 months ago

I merged the request- I hope this doesn't break the 5.9 folks for now, but hopefully we will all love to 5.10 soon

tishin commented 5 months ago

5.9 still uses original prebuildCommand hack without additional buildCommand. It shouldn't break.