Skip to content

[lldb/swift] Add swift type-system progress reporting #4085

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 4 commits into from
Mar 19, 2022

Conversation

medismailben
Copy link

@medismailben medismailben commented Mar 17, 2022

This patch reports progress events specific to the swift type-system.

Currently, it covers 3 long-running operations:

  • Setting up the runtime reflection context
  • Loading implicit modules from the compile unit
  • Caching them in the expression persistent state

It also includes a test a will listen for swift progress events and make
sure it we receive them when fetching a swift variable.

rdar://75803015

Signed-off-by: Med Ismail Bennani [email protected]

@medismailben
Copy link
Author

@swift-ci test

@medismailben
Copy link
Author

@swift-ci test macOS platform

@medismailben
Copy link
Author

@swift-ci test

@medismailben medismailben force-pushed the stable/20211026 branch 2 times, most recently from 5cd7e27 to d1bfff8 Compare March 18, 2022 01:19
@medismailben
Copy link
Author

@swift-ci test linux platform

@medismailben
Copy link
Author

@swift-ci test macOS platform

This patch introduces a generic helper class that will listen for
event in a background thread and match it against a source broadcaster.

If the event received matches the source broadcaster, the event is
queued up in a list that the user can access later on.

The motivation behind this is to easily test new kinds of events
(i.e. Swift type-system progress events). However, this patch also
updates `TestProgressReporting.py` and `TestDiagnosticReporting.py`
to make use of this new helper class.

Differential Revision: https://reviews.llvm.org/D121977

Signed-off-by: Med Ismail Bennani <[email protected]>
This patch reports progress events specific to the swift type-system.

Currently, it covers 3 long-running operations:
- Setting up the runtime reflection context
- Loading implicit modules from the compile unit
- Caching them in the expression persistent state

It also includes a test a will listen for swift progress events and make
sure it we receive them when fetching a swift variable.

rdar://75803015

Signed-off-by: Med Ismail Bennani <[email protected]>
This patch simplifies the inferior for TestSwiftProgressReporting, by
creating a variable using a type defined in an imported module.

It also improve the test by making sure it receives each kind of
expected swift progress events.

Signed-off-by: Med Ismail Bennani <[email protected]>
@medismailben
Copy link
Author

@swift-ci test

@medismailben medismailben merged commit 1e67b30 into swiftlang:stable/20211026 Mar 19, 2022
@dduan
Copy link

dduan commented Mar 19, 2022

TestSwiftProgressReporting.py seems to be sporadically failing on apple/swift's main branch. See examples 1 and 2

@medismailben
Copy link
Author

There is a race happening only in the test which cause it to fail randomly. I'm working on a fix on llvm.org, will cherry-pick the fix afterwards.

Since this only concerns the test, I don't think we should revert all the patches.

@medismailben
Copy link
Author

This discussion is happening on Phab, should be landing the fix today or tomorrow https://reviews.llvm.org/D122193

@medismailben
Copy link
Author

Should be fix with #4109

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