Skip to content

Conversation

djc
Copy link
Contributor

@djc djc commented Oct 13, 2025

Followup from:

Sorry @FranciscoTGouveia, here are some more changes which IMO make things a bunch cleaner. I haven't done any testing yet (would be great if you want to do some of that) but I think the changes here are relatively straightforward?

@djc djc requested review from ChrisDenton and rami3l October 13, 2025 10:49
@djc djc force-pushed the download-cleanup branch from 3664131 to 360dd06 Compare October 13, 2025 11:40
Copy link
Member

@rami3l rami3l left a comment

Choose a reason for hiding this comment

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

LGTM modulo some questions :)

src/utils/mod.rs Outdated
pub(crate) struct FileReaderWithProgress<'a> {
pub(crate) struct FileReaderWithProgress {
fh: io::BufReader<File>,
tracker: &'a DownloadTracker,
Copy link
Member

@rami3l rami3l Oct 13, 2025

Choose a reason for hiding this comment

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

Question: If I'm reading this right, you are completely removing the progress bar during installation? Why?

Copy link
Contributor Author

@djc djc Oct 13, 2025

Choose a reason for hiding this comment

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

Before this PR, calling handle() on a Notification would do nothing unless a Notification::DownloadingComponent value had been handled first, which would internally call create_progress_bar() and added an entry into the file_progress_bar HashMap. For Notifications with a None URL field, calling these methods actually did nothing. Thus, I removed all DownloadTracker method calls passing None as the url argument, which made the DownloadTracker unused in a bunch of places.

Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies for joining this conversation uninvited, but I would like to note that I have rebased my current PR on top of this one, and the progress bars are not appearing when downloading components -- the only notification shown is when the installation has already completed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to apologize, any feedback is very welcome!

What is your test scenario? Can you use git bisect to see which commit breaks it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I ran rustup toolchain install beta (also testing with different values for RUSTUP_CONCURRENT_DOWNLOADS) and consistently observed the same behavior.

I have already performed a bisect, which pointed to commit b42b6b2b, the second one of this PR.

After reviewing and testing this commit, I confirmed that the DownloadTracker methods are being called correctly.
However, the ProgressBars are hidden (as verified using the .is_hidden() method), which explains the lack of visible progress reporting.

I traced this issue to the creation of the DownloadTracker, where it appears that the display_progress boolean variable is inverted, causing the ProgressDrawTarget to be hidden.

Copy link
Contributor Author

@djc djc Oct 14, 2025

Choose a reason for hiding this comment

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

@FranciscoTGouveia great work! Fixed in my latest push.

Can't reiterate enough -- please always feel free to give feedback on any rustup PRs.

might be an unexpected regression introduced by previous changes,

Yeah, I think that's what happened -- anyway, I think these changes also make it easier to reintroduce progress bars for any other downloads we think are worth tracking.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have just fetched your branch and confirmed that the progress bars are still not appearing.
This time the issue was introduced in 2050503 (not related with cfg.quiet this time).

Copy link
Contributor

Choose a reason for hiding this comment

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

After a quick inspection, the ProgressBars are correctly created and added to the MultiProgress, but the notifications (e.g. DownloadContentLengthReceived) are not actually being sent.

This is due to the fact that status is None here.

If I am not mistaken, we cannot pass None here.

Copy link
Contributor Author

@djc djc Oct 14, 2025

Choose a reason for hiding this comment

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

Great catch! Pushed another update, and going to do another careful self review as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confirmed that the progress bars show up for me now, although there's a lot of flickering involved.

@rami3l
Copy link
Member

rami3l commented Oct 13, 2025

Please note that since this PR is related to more subtle changes in the user behavior that is not fully covered by the test suite, more attention should be paid to ensure the necessary preservation of original semantics.

@djc djc force-pushed the download-cleanup branch from 360dd06 to b96b51e Compare October 13, 2025 14:37
@djc djc force-pushed the download-cleanup branch from b96b51e to 9364884 Compare October 14, 2025 08:54
@djc djc force-pushed the download-cleanup branch from 9364884 to cc732d2 Compare October 14, 2025 11:07
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.

3 participants