Closed tristanlabelle closed 1 year ago
Tracked in Apple’s issue tracker as rdar://108670689
This is not really a SourceKit-LSP issue. It is a combination of a SwiftPM and VSCode extension issue.
As an aside, you should be able to fix up your project by running a swift package update
instead of completely deleting your .build
folder.
@adam-fowler Thanks for the details. It makes sense that this is not the best place to track the issue, and I understand the solution not obvious. Would it still help for me to file issues on the two repos you mention (and then close this)?
Yes go ahead and add the issues. It would be good if you could verify if this is specific to Windows as well.
@tristanlabelle do you want to close this here as vscode-swift is the best place for this issue.
Not really vscode-swift
more than here. I expect a fix would be in swift-corelibs-dispatch
. Whatever makes your tracking easier.
Not sure how building on top of a resolve is the fault of swift-corelibs-dispatch
. You could point the finger at SwiftPM for not dealing with this situation. But I do have a solution on the way which will make build tasks unavailable while a resolve or update is running.
Oh sorry! I thought we were in a different issue. Ignore my reply and yes let's close this. I have a note to file the SwiftPM bug as well. Thanks!
Open a Swift project with several git dependencies (such as https://github.com/pointfreeco/swift-composable-architecture.git) in VSCode and immediately start a build.
With high likelihood, you will hit errors like:
The checkout might now be in a bad state where there will be compilation errors in dependencies because of missing files or similar issues. The workaround is to delete
.build
and rebuild.The issue is that the
Resolve Package Dependencies
task started by the Swift extension and theBuild All
task started by the user run concurrently and both try to checkout git repositories at once, resulting in corrupt checkouts. SourceKit-LSP should enforce mutual exclusion of those two tasks because it is fairly easy for a user to get into this state and hard to diagnose.Using: