Skip to content

Show progress bar while downloading Swift SDK bundles #7315

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

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Feb 3, 2024

Motivation:

The download operation takes a while, and it makes users feel like SwiftPM is stuck.

Modifications:

This patch adds a progress indicator to the download operation to make it clear that SwiftPM is still working and how much work is left.

Screen.Recording.2024-02-03.at.19.48.14.mov

The download operation takes a while, and it makes users feel like
SwiftPM is stuck. This patch adds a progress indicator to the download
operation to make it clear that SwiftPM is still working and how much
work is left.
@kateinoigakukun
Copy link
Member Author

@swift-ci Please test

@@ -47,7 +49,10 @@ public struct InstallSwiftSDK: SwiftSDKSubcommand {
swiftSDKsDirectory: swiftSDKsDirectory,
fileSystem: self.fileSystem,
observabilityScope: observabilityScope,
outputHandler: { print($0.description) }
outputHandler: { print($0.description) },
downloadProgressAnimation: ThrottledProgressAnimation(
Copy link
Member Author

Choose a reason for hiding this comment

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

Progress animation is throttled by timer to avoid too flickering animation triggered by HTTPClient's too frequent progress reports.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since swift-tools-support-core is deprecated, would you mind adding this new types to the Basics module in SwiftPM instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, move it to SwiftPM repo

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Overall makes sense, but we shouldn't be adding any new code to TSC at this point.

To avoid intoroducing a new code in TSC
@kateinoigakukun
Copy link
Member Author

@swift-ci test

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Thank you 🙏

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) February 5, 2024 12:02
@kateinoigakukun
Copy link
Member Author

@swift-ci Please test

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 3bcbb67 into swiftlang:main Feb 5, 2024
@kateinoigakukun kateinoigakukun deleted the yt/show-progress-bar-sdk-install branch February 5, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants