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

Better progress report #3448

Closed
Yamakaky opened this issue Dec 23, 2016 · 3 comments
Closed

Better progress report #3448

Yamakaky opened this issue Dec 23, 2016 · 3 comments
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@Yamakaky
Copy link

Currently, cargo only outputs "Compiling xxx" when starting a job. I propose using ANSI control sequences to have a more finer progress report while keeping the same number of line output.
PoC with jobs in WiP or done state:

#!/usr/bin/env bash

a=(10 4 3 2 5 7 8 1 6 9)

for i in $(seq 1 10); do
    echo "doing $i"
done

for i in $(seq 1 10); do
    # \033[nA moves the cursor up n lines
    printf "\033[$((11 - i))A"
    # Print done jobs. \033[K clears the current line
    printf "\033[Kdone $i\n"
    # Print jobs still running
    for x in "${a[@]}"; do
        if [[ $x -gt $i ]]; then
            printf "\033[Kdoing $x\n"
        fi
    done
    sleep 1
done

The basic idea is with n jobs running, when a job finishes we erase the n previous lines, print the finished jobs then print the jobs still working.
When this setup is working, we can expand it to show a more finer progress report for each job.
Windows seems to support it, MacOS and Linux does.
See #833, maybe also others.

@est31
Copy link
Member

est31 commented Dec 28, 2016

(somewhat) related: #2536

@carols10cents carols10cents added A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Sep 29, 2017
bors added a commit that referenced this issue Jun 29, 2018
Displays a one line progress of what crates are currently built.

cc #2536, #3448.

The change is based on #3451, but uses the progress bar introduced in #4646 instead. The percentage is simply the number of crates processed ÷ total crates count, which is inaccurate but better than nothing.

Output looks like:
[![asciicast](https://asciinema.org/a/YTiBAz4K4vfidNTAnehtyH46l.png)](https://asciinema.org/a/YTiBAz4K4vfidNTAnehtyH46l)
@eminence
Copy link
Contributor

Triage: Cargo these days has a more advanced progress output than it did 5 years ago. Unless there's some specific deficiency in the current output, I think this issue can be closed

@ehuss
Copy link
Contributor

ehuss commented Nov 23, 2022

I think we're still interested in improving Cargo's progress output. #8889 contains the most recent discussion along with some examples. I'm going to close this as a duplicate of #8889 since it has the most recent information.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

5 participants