hyperledger / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
433 stars 276 forks source link

`iroha_wasm_builder` progress-bar #3237

Closed Arjentix closed 11 months ago

Arjentix commented 1 year ago

It will be nice to have a way to get information about current progress of build from iroha_wasm_builder.

As an example of current implementation you can run kagami validator and will see, that it looks like it's stucked.

I believe, there is a way to provide this info from iroha_wasm_builder crate and the display it on user side.

Arjentix commented 1 year ago

Blocked by #2152

0x009922 commented 1 year ago

I use a spinner in kagami swarm during the building of the validator:

We can probably reuse it in kagami genesis and in iroha_wasm_builder itself. If the PR will be merged, ofc.

0x009922 commented 1 year ago

This issue is partially addressed by

That PR introduces iroha_wasm_builder_cli, which displays spinners while building & optimizing. However, it is not a progress bar. I guess this issue is about displaying a precise progression, e.g. how many crates were already checked/built.

DCNick3 commented 11 months ago
  1. exposing cargo's output: this will use the native cargo implementation of the progress bar. no longer capturing stdout, so diagnostics go to the console too
  2. parsing cargo's progress bar. possible, but requires special handling for the diagnostics: they have to somehow be separated from the progress bar
  3. cargo json output: AFAIU it doesn't provide enough information to build the progress bar (we need the total # of jobs)
  4. cargo as a library: doesn't help, cargo exposes basically the same API surface as the console API. will either require parsing or reimplementing large parts of the cargo itself. the progress bar is buried in non-public part of the API: https://docs.rs/cargo/latest/src/cargo/core/compiler/job_queue/mod.rs.html#469

I've decided to go with option 1, with possibly switching to 2 if some limitations are to be found