-
Notifications
You must be signed in to change notification settings - Fork 325
Description
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:
fatal: not a git repository (or any of the parent directories): .git
error: input file 'C:\Code\swift-composable-architecture\.build\checkouts\swift-argument-parser\Plugins\GenerateManual\GenerateManualPluginError.swift' was modified during the build
error: 'swift-benchmark': Failed to clone repository https://github.com/google/swift-benchmark:
Cloning into 'C:\Code\swift-composable-architecture\.build\checkouts\swift-benchmark'...
error: could not write config file C:/Code/swift-composable-architecture/.build/checkouts/swift-benchmark/.git/config: No such file or directory
fatal: could not set 'core.logallrefupdates' to 'true'
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 the Build 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:
sswg.swift-lang Version: 1.2.1
compnerd.org Swift version 5.9-dev (LLVM 1626c3d9b5175d1, Swift 0c0ec72255527fa)
Target: x86_64-unknown-windows-msvc
Windows 11