Fix build command execution on Windows using Swift 5.10 #423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #418
We have two build commands here:
prebuildCommand
which works as a source generator on Windows, but shouldn't work by design (on macOS it throwsa prebuild command cannot use executables built from source, including executable target 'Generator'
). On Swift 5.9 this command also added sources fromoutputFilesDirectory
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.buildCommand
which does not generate sources on Windows (the.exe
never gets called), but works as a source provider throughoutputFiles
. I have already reported the issue at Build command doesn't get executed on Windows swiftlang/swift-package-manager#6962So combining the two broken things makes the build work again on Swift 5.10 toolchain.
This shouldn't affect 5.9 builds, asbuildCommand
does not add any actual workload to the build.I wish there was a less hacky solution.