Skip to content

[lldb][progress] Mitigate non-specific LLDB progress reports in Swift #8664

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

Conversation

chelcassanova
Copy link

When LLDB reports progress on importing Swift modules, it was delivering non-specific progress reports with only the title of "Importing Swift modules" and no details. To report progress on activity within Swift, LLDB first creates a progress report then updates that progress report using a callback that LLDB sets and the Swift compiler invokes when performing a full import.

When LLDB triggers Swift to import modules that were already imported before, Swift will not perform a full import. Since the progress report would've already been displayed, but the callback is never invoked, this leads to the non-specific messages that were being displayed when importing Swift modules.

This commit sets a unique pointer to create a progress report from within the callback function instead of creating the report before setting the callback. It also clears the callback on scope exit instead of setting it to a new progress report.

(cherry picked from commit 84e7e51)

When LLDB reports progress on importing Swift modules, it was delivering
non-specific progress reports with only the title of "Importing Swift
modules" and no details. To report progress on activity within Swift,
LLDB first creates a progress report then updates that progress report
using a callback that LLDB sets and the Swift compiler invokes when
performing a full import.

When LLDB triggers Swift to import modules that were already imported before,
Swift will not perform a full import. Since the progress report would've
already been displayed, but the callback is never invoked, this leads
to the non-specific messages that were being displayed when importing
Swift modules.

This commit sets a unique pointer to create a progress report from
within the callback function instead of creating the report before
setting the callback. It also clears the callback on scope exit instead
of setting it to a new progress report.

(cherry picked from commit 84e7e51)
Updates the test for Swift progress reporting by checking that the
"Importing Swift modules" message only appears twice on its own as the
rest of the reports for this category will have details attached.

(cherry picked from commit 21e9d75)
@chelcassanova chelcassanova merged commit 2cf0120 into swiftlang:next Apr 30, 2024
@chelcassanova chelcassanova deleted the cherrypick-next/mitigate-swift-progress-reports branch April 30, 2024 20:05
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.

1 participant