Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into release/6.0 #1438

Merged
merged 21 commits into from
Jun 6, 2024

Conversation

plemarquand and others added 21 commits June 3, 2024 11:40
Backticks in TestItem IDs should be sanitized. Use the new
TokenSyntax.identifier when building up the TestItem IDs.
Mostly just removing outdated information, merging files and pointing to the new tools page from swiftlang/swift-org-website#679 with instructions on how to set up editors.
…est-ids

Filter backticks in TestItem IDs
Instead of logging to `stderr`, write log messages to files in `.sourcekit-lsp/logs/sourcekit-lsp-<pid>.<log index>.log`.

This allows us to retrieve the log messages from `sourcekit-lsp diagnose`.

Fixes swiftlang#1286
rdar://127138318
…nose bundle

This allows VS Code to provide a command in the command palette that gathers sourcekit-lsp diagnostics alongside some VS Code Swift extension diagnostics.
The comment on `LocalConnection` assumed that all mutable state was guarded by `queue` but `state` and `handler` actually weren’t. This was found by the thread sanitizer.
…-path

Allow specification of where `sourcekit-lsp diagnose` writes its diagnose bundle
Write log messages to files on non-Darwin platforms
Turns out that sourcekitd test hooks were a bad idea because of the following comment that I wrote:

```
`testHooks` are only considered when an instance is being created. If a sourcekitd instance at the given path already exists, its test hooks will be used.
```

During test execution in Xcode, we generate a bunch of `SourceKitServer` instances in the same process that all call `DynamicallyLoadedSourceKitD.getOrCreate`. Now, if `testDontReturnEmptyDiagnosticsIfDiagnosticRequestIsCancelled` is not the first test being executed in the process (which usually it is not), the test hooks in it won’t get used.

Switch back to using the preparation hooks, essentially reverting swiftlang#1412 and keeping the following snippet to fix the underlying issue

```swift
// Poll until the `CancelRequestNotification` has been propagated to the request handling.
for _ in 0..<Int(defaultTimeout * 100) {
  if Task.isCancelled {
    break
  }
  usleep(10_000)
}
```
…condition

Fix a race condition in `LocalConnection`
…’ve made meaningful progress

Especially when we didn’t have a redrawing progress indicator, we would spam the output with out making progress that was visible to the user because the overall progress just shows a percentage without any decimal digits. To fix this, only report progress when we’ve made at least 1% of progress in log collection.
Only report log collection progress in `sourcekit-lsp diagnose` if we’ve made meaningful progress
We used C atomics but these were allocated as Swift variables. Even thought they were atomic, concurrent accesses to them could violate Swift’s exclusivity laws, raising thread sanitizer errors.

Allocate the C atomics using malloc to fix this problem.

rdar://129170128
@ahoppen ahoppen requested a review from bnbarham June 6, 2024 16:56
@ahoppen ahoppen requested a review from benlangmuir as a code owner June 6, 2024 16:56
@ahoppen
Copy link
Member Author

ahoppen commented Jun 6, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit 047c914 into swiftlang:release/6.0 Jun 6, 2024
3 checks passed
@ahoppen ahoppen deleted the 6.0/merge-main-2024-06-06 branch June 6, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants