Skip to content
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

Extra "Updating index" messages after publishing a crate #11304

Closed
epage opened this issue Oct 27, 2022 · 3 comments · Fixed by #11713
Closed

Extra "Updating index" messages after publishing a crate #11304

epage opened this issue Oct 27, 2022 · 3 comments · Fixed by #11713
Labels

Comments

@epage
Copy link
Contributor

epage commented Oct 27, 2022

Problem

This is split out of #11062

When we poll for the crate having been published, it reports "Updating index" for each iteration

One thing we may want to look at separately is the UI while it is waiting. Cargo just keeps repeating Updating crates.io index. I'm wondering if it might be better to suppress the Updating message? That could maybe be implemented by temporarily enabling quiet mode. I'm also wondering about maybe showing some kind of busy indicator (maybe a progress bar that ticks forward for each second)?

Steps

With the latest cargo, publish a crate

Possible Solution(s)

Temporarily turn on quiet in the code

Notes

No response

Version

No response

@epage epage added C-bug Category: bug Command-publish labels Oct 27, 2022
@epage
Copy link
Contributor Author

epage commented Oct 27, 2022

I think this only happens with git registries, so the problem will diminish over time.

There is the potential for multiple exit points, so RAII would be the most robust way of handling this. At first, I thought lifetimes made that impossible due conflicting access to Shell but instead of the Drop struct holding onto Shell, it can hold onto Config, so it shouldn't be too hard to implement.

@mitsuhiko
Copy link
Contributor

I think this only happens with git registries, so the problem will diminish over time.

From my experience it happens on crates.io so that seems pretty widespread. Since cargo is already capable of showing progress bars I wonder if something like that could be used here instead. It almost looks like a bug now.

@epage
Copy link
Contributor Author

epage commented Dec 27, 2022

Yes, it does happen with crates.io when used via git. I believe in my testing, we don't see that when accessing crates.io via the soon-to-stablize sparse api. Granted, when I wrote this, I thought sparse registry support would have been stablized by now.

bors added a commit that referenced this issue Mar 15, 2023
Add more information to wait-for-publish

This reworks the console output when waiting for a publish to be available:

* Shows a "Published" status to try to make it clear that the publish is complete, and that Cargo is moving to a separate phase.
* Removes the repeated status bars and updating messages, and uses a single progress bar to track the publish.
* Provides more of a description of why Cargo is waiting to try to make it clearer what is happening.
* Provides more information when a timeout happens to try to explain what might be happening.
* Shows a "Completed" message at the end to let the user know that everything is complete.

Comparing the output:

Before (with git):

```
    Updating crates.io index
   Packaging delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Packaged 3 files, 761.0B (569.0B compressed)
   Uploading delay v0.4.27 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Updating crates.io index
     Waiting on `delay` to propagate to crates.io index (ctrl-c to wait asynchronously)
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
```

Before (with sparse):

```
    Updating crates.io index
   Packaging delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Packaged 3 files, 761.0B (569.0B compressed)
   Uploading delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Updating crates.io index
     Waiting on `delay` to propagate to crates.io index (ctrl-c to wait asynchronously)
       Fetch [=============================>   ] 36 complete; 1 pending
```

New (git or sparse):

```
    Updating crates.io index
   Packaging delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Packaged 3 files, 761.0B (569.0B compressed)
   Uploading delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
    Uploaded delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo)
note: Waiting for `delay@0.0.2` to be available at registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
     Waiting [===>                       ] 11/60
   Published delay v0.0.2 (/Users/eric/Proj/rust/cargo/target/tmp/cit/t0/foo) has been successfully published to registry `crates-io`
```

(Note: In the last two cases the progress bar disappears when it is done, I have just included it here to illustrate.)

Fixes #11304
@bors bors closed this as completed in 2b901be Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants