-
Notifications
You must be signed in to change notification settings - Fork 314
Merge main
into release/6.0
#1364
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
ahoppen
merged 35 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-05-28
May 29, 2024
Merged
Merge main
into release/6.0
#1364
ahoppen
merged 35 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-05-28
May 29, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We used to only watch for file creation and deletion because that might modify build settings but for background indexing, we also need to watch for changes to the files, so we can invalidate the up-to-date status of the target.
Turns out that some of logging from task scheduler would have been useful to debug a recent test failure. This adds some logging into `TaskScheduler` again and, most importantly, adds log messages to `ClosureTaskDescription` in `TaskSchedulerTests`.
…heduler` We need this function anyway to escalate process priorities when we set `nice`ness values for them. It also simplifies the task scheduler and I’m hoping that it fixes a non-deterministic failure that causes task priority elevation to not work properly.
… doesn’t support task priority elevation
…changes Watch for changes to source files
…rce files we need to re-index Waiting for the indexstore-db to be updated is cheaper than potentially not knowing about unit files, which causes the corresponding source files to be re-indexed. rdar://128645743
Otherwise, we will never show the progress again.
Removes a step to copy paste the bundle path to find it in Finder.
…efore-deciding-what-to-index Ensure that the indexstore-db is up-to-date before deciding which source files we need to re-index
…-state Reset the state of `WorkDoneProgressState` when the progress has ended
…ild graph Rebuilding the build graph can take a while (initial loading of the build graph takes ~7s for sourcekit-lsp) and it’s good to show some progress during this time.
The signposts aren’t easily visible in the log (you need to add `--signpost` to `log show`) and don’t get logged on non-Darwin platforms at all. Add logging for it.
On macOS, reveal diagnostic bundle in Finder after it has been created
Add some logging to `TaskScheduler` again
Swift packages can have source files that we can’t index (like assembly files). When re-opening, we schedule indexing for those files, which requires the targets to be re-prepared. We skip them earlier. rdar://128711633
Set `cancelBuilds` to 0 on close instead of open
…he SourceKitLSPServer are modified `IndexProgressManager` iterates over all workspaces in the SourceKitLSPServer. Modifying workspaces might thus update the index progress status.
…tor functionality While `SemanticIndexManager.inProgressPrepareForEditorTask` is not `nil`, show a work done progress in the editor that the current file is being prepared for editor functionality. I decided to use the indexing progress indicator for this for now because I think it’s too spammy if SourceKit-LSP has two different progress indicators for preparation and indexing. I’ll need to see how this feels like in practice. rdar://128722609
Fix two issue: 1. If a task’s priority got elevated, we would emit the `Elevating priority` log message repeatedly until the elevated priority is propagated to the underlying task via `withTaskPriorityChangedHandler` 2. Explicitly set the priority of `QueuedTask`, which ensures that we create the detached `resultTask` inside of it with that priority. I’m not sure if this was an actual issue but seems like a good cleanup regardless.
Don’t re-index files in languages that cannot be indexed
The file was a little large and contained multiple types that can easily be split off. Now you can scroll to the top of the file and see the members of `SourceKitLSPServer`.
Time out updating of the index store after 2 minutes. We don't expect any single file compilation to take longer than 2 minutes in practice, so this indicates that the compiler has entered some kind of loop. We will try indexing the file again when it is edited or when the project is re-opened. rdar://128732571
Diagnostics are usually not helpful if the file’s target hasn’t been prepared yet. We should await the target’s preparation before returning diagnostics. rdar://128645617
…ments A couple minor priority elevation bug fixes in `TaskScheduler`
Split SourceKitLSPServer.swift into multiple files
…rent-file-preparation Show work done progress while a source file is being prepared for editor functionality
Time out updating the index store after 2 minutes
…cit workspace for a file When looking for a workspace that can handle a file, we were creating full-fledged workspaces along the way, which we would then discard if they couldn’t handle the file being opened. This had multiple problems: 1. When background indexing is enabled, it caused semantic indexing of the workspace, which wrote files to a `.index-build` directory and was a waste of work 2. When background indexing is enabled, it caused package resolution, which also created a `.index-build` folder to be created 3. It caused a syntactic test index of the workspace, which was a waste of work. To fix this, do multiple things: 1. When creating a workspace, add a check right after build system creation. This allows us to early exit if the build system can’t handle the file and prevents us from generating the `Workspace`, fixing (1) and (3) 2. Don’t call `reloadPackage` when creating a `SwiftPMWorkspace`. Instead, explicitly call `generateBuildGraph` once we committed to creating the workspace.
…efore-diags Wait for target to be prepared before returning diagnostics
…earching-for-workspace Don’t cause any file system file effects when trying to find an implicit workspace for a file
Fix a test build issue due to PRs racing
# Conflicts: # Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift
@swift-ci Please test |
bnbarham
approved these changes
May 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge the following PRs into
release/6.0
:WorkDoneProgressState
when the progress has ended #1345TaskScheduler
again #1335cancelBuilds
to 0 on close instead of open #1347TaskScheduler
#1357