Commit d478725
authored
[6.0] Write output-file-map.json atomically (#7415)
* **Explanation**: When using sourcekit-lsp with VS Code it often
happens that sourcekitd is trying to read the `output-file-map.json`
while SwiftPM is writing it non-atomically. This results in a buffer in
sourcekitd that is not null-terminated. To fix this issue, generate the
output file map atomically.
* **Scope**: Generation of `output-file-map.json`
* **Risk**: This could fail if the `FileSystem` subclass in SwiftPM does
not support atomic write operations. But I think we only really care
about the local file system here, which does support atomic operations
* **Testing**: Tests continue passing. I will verify that this fixes the
sourcekitd crashes when a new toolchain is released with the fix
* **Issue**: rdar://124727242
* **Reviewer**: @MaxDesiatov on
#74061 parent 3b8489a commit d478725
File tree
1 file changed
+2
-1
lines changed- Sources/Build/BuildDescription
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
| 783 | + | |
783 | 784 | | |
784 | 785 | | |
785 | 786 | | |
| |||
0 commit comments