Skip to content

Add progress reports for bridging header compilation. #8103

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

Conversation

adrian-prantl
Copy link

@adrian-prantl adrian-prantl commented Feb 1, 2024

Requires swiftlang/swift#71318

I needed to cherry-pick a dependency from upstream and also make a drive-by fix in TypeSystemSwiftTypeRef so the test doesn't assert.

adrian-prantl and others added 3 commits February 1, 2024 11:13
to report Size/Align info and continue with the Swift language
runtime.

This would otherwise cause a fallback to SwiftASTContext and
a TypeSystemSwiftTypeRef/SwiftASTContext verification error.
…vm#79912)

The `total` parameter for the constructor for Progress was changed to a
std::optional in llvm#77547. It was originally set to 1 to indicate non-determinisitic progress, but this commit changes this. First, `UINT64_MAX` will again be used for non-deterministic progress, and `Progress` now has a static variable set to this value so that we can use this instead of a magic number.

The member variable `m_total` could be changed to a std::optional as
well, but this means that the `ProgressEventData::GetTotal()` (which is
used for the public API) would
either need to return a std::optional value or it would return some
specific integer to represent non-deterministic progress if `m_total` is
std::nullopt.

(cherry picked from commit 733b86d)
@adrian-prantl
Copy link
Author

test with swiftlang/swift#71318
@swift-ci test

Copy link

@medismailben medismailben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some comments.

: module_name.str()));
[&progress](llvm::StringRef module_name,
swift::ASTContext::ModuleImportKind kind) {
progress.Increment(1, (kind == swift::ASTContext::Overlay

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a switch here now that we have 3 kinds of module imports ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I think even the overlay case makes no sense here since the stdlib is always a pure Swift module. I just left it in because it was there before.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair

: module_name.str()));
[&progress](llvm::StringRef module_name,
swift::ASTContext::ModuleImportKind kind) {
progress.Increment(1, (kind == swift::ASTContext::Overlay

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines +3642 to +3651
case swift::ASTContext::Module:
progress.Increment(1, module_name.str());
break;
case swift::ASTContext::Overlay:
progress.Increment(1, module_name.str() + " (overlay)");
break;
case swift::ASTContext::BridgingHeader:
progress.Increment(1,
"Compiling bridging header: " + module_name.str());
break;
Copy link

@medismailben medismailben Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the swift::ASTContext::Module case, we only put the name of the module, if it's an overlay, we show both the name and (overlay) annotation, but if it's a bridging header, we now show Compiling bridging header: with the module name.

I don't have any preference but let's stay consistent across all the Increment updated_detail string.

@adrian-prantl adrian-prantl merged commit 87fe0d0 into swiftlang:stable/20230725 Feb 2, 2024
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.

4 participants