Skip to content

Merge main into release/6.2 #2162

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

Merged
merged 21 commits into from
May 22, 2025

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented May 19, 2025

Explanation: Last main -> release/6.2 merge. Skips #2159 as even though it's likely harmless, it's a very large change and touches a lot of the request/response handling - too risky at this point. The rest are all changes we want:

ahoppen and others added 20 commits May 12, 2025 15:39
This way we can log them when a sourcekitd request crashes and we can thus replay these contextual requests when diagnosing the crash.
Teach `sourcekit-lsp diagnose` how to extract contextual requests from the system log and use them to reduce sourcekitd crashes.
Generally helpful to get a hint about whether an open source toolchain is used and to help with toolchain discovery issues.
…kScheduler`

A queued task might have been cancelled after the execution ask was started but before the task was yielded to `executionTaskCreatedContinuation`. In that case the result task will simply cancel the await on the `executionTaskCreatedStream` and hence not call `valuePropagatingCancellation` on the execution task. This means that the queued task cancellation wouldn't be propagated to the execution task. To address this, check if `resultTaskCancelled` was  set and, if so, explicitly cancel the execution task here.

Fixes an issue I saw in CI during PR testing.
…down

This is what `shutDown()` is documented to do. I also remember having this check before, it might have gotten lost during a rebase when I was working on swiftlang#2081.

I noticed this while investigating swiftlang#2152: In this case `buildTarget/prepare` was cancelled because the SourceKit-LSP server was shut down but indexing of a file was still started after the shutdown now that preparation had finished (because it was cancelled).
Previously Package.swift referred a non-existent CMakeLists.txt file
and used old URLs for the swift-tools-support-core repository, leading
to the following build warnings:

    warning: 'sourcekit-lsp': Invalid Exclude '/Users/wilfred/src/sourcekit-lsp/Sources/DocCDocumentation/CMakeLists.txt': File not found.
    warning: 'swift-package-manager': 'swift-package-manager' dependency on 'https://github.com/swiftlang/swift-tools-support-core.git' conflicts with dependency on 'https://github.com/apple/swift-tools-support-core.git' which has the same identity 'swift-tools-support-core'. this will be escalated to an error in future versions of SwiftPM.
    warning: 'swift-driver': 'swift-driver' dependency on 'https://github.com/swiftlang/swift-tools-support-core.git' conflicts with dependency on 'https://github.com/apple/swift-tools-support-core.git' which has the same identity 'swift-tools-support-core'. this will be escalated to an error in future versions of SwiftPM.
Log the path that SourceKit-LSP was launched from
Fix race condition that causes task cancellation to be missed in `TaskScheduler`
Do not schedule any new tasks in `TaskScheduler` if it has been shut down
…request

Log contextual requests that affect sourcekitd’s global state
Resolve paths passed in the SwiftPM configuration to the project root
Adopt the option introduced by swiftlang/swift#81507. SourceKit-LSP uses explicit cancellation and perform any implicit cancellation inside sourcekitd.

Fixes swiftlang#2021
rdar://145871554
This became a required parameter in
swiftlang/swift-package-manager#8668, which can
be easily computed, since the host toolchain in practice is always available when `SwiftSDKBundleStore` is initialized.
…t-request

Pass `cancelOnSubsequentRequest: 0` to all requests that support it
…ners"

This reverts commit 66b20b9, reversing
changes made to 8e8016e. Codeowners are
branch managers on the release branch.
@bnbarham bnbarham requested a review from a team as a code owner May 19, 2025 22:58
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@MaxDesiatov
Copy link
Contributor

@bnbarham
Copy link
Contributor Author

…rcekitd-request"

This reverts commit 188e174, reversing
changes made to be5ae8c. Should be a
fairly harmless change, but it's also quite large. Skipping for 6.2.
@bnbarham bnbarham force-pushed the 20250519-manual-merge branch from f6ff09b to a0a8f1e Compare May 20, 2025 22:58
@bnbarham
Copy link
Contributor Author

@bnbarham
Copy link
Contributor Author

swiftlang/swift-package-manager#8692

@swift-ci please test macOS platform

@MaxDesiatov
Copy link
Contributor

swiftlang/swift-package-manager#8692
@swift-ci test windows

@MaxDesiatov
Copy link
Contributor

@bnbarham bnbarham merged commit f22e13d into swiftlang:release/6.2 May 22, 2025
3 checks passed
@bnbarham bnbarham deleted the 20250519-manual-merge branch May 22, 2025 00:00
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.

5 participants