Skip to content

Commit

Permalink
Bump console_ui dependencies and simplify code (pantsbuild#19931)
Browse files Browse the repository at this point in the history
Dove into this for some other tasks, and it was quite large and hard to
navigate due to handling the indicatif/prodash branching inline. As I
needed to bump indicatif and console for what I originally wanted to do,
I took the liberty of cleaning it up a bit while at it.

* Bump `console` to `0.15.7`
* Bump `indicatif` to `0.17.7`
* Remove custom `lib.path` for `console_ui` crate
* Split `console_ui.rs` into `lib.rs` for the public parts, then
`instance.rs` and `instance/indicatif.rs` + `instance/prodash.rs` for
supported flavors
* Removed a TODO at (now) line 110 of `indicatif.rs` about removing
`pbar.tick()` after upgrading `indicatif` beyond 0.17.0. There's
`ProgressBar::enable_steady_tick` but that spawns one thread per bar.
That is... A bit of noise, and led to some desync over time (spinners
weren't at same state).
* cc @stuhood -- it wasn't super clear what you expected, but removing
the `pbar.tick()` still freezes the spinner
* `ConsoleUI::with_console_ui_disabled` did the `f.await` in both
branches; so simplified that a bit.
* Updated TODO at now line 41 in `indicatif.rs` that it there's no
`WeakMultiProgress`, so it's not likely a good fit to do that change to
avoid potential ownership issues.
  • Loading branch information
tgolsson authored Oct 11, 2023
1 parent 3442d4d commit 05e89ec
Show file tree
Hide file tree
Showing 8 changed files with 564 additions and 458 deletions.
20 changes: 13 additions & 7 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/rust/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ bytes = "1.2"
chrono = "0.4.22"
clap = "3"
colored = "2.0.0"
console = "0.15.2"
console = "0.15.7"
criterion = "0.4"
crossbeam-channel = "0.5"
# TODO: Waiting on https://github.com/Aeledfyr/deepsize/pull/{30,31,32}.
Expand Down Expand Up @@ -323,3 +323,6 @@ webpki = "0.22"
tree-sitter = "0.20.10"
tree-sitter-javascript = "0.20.0"
tree-sitter-python = "0.20.4"

[patch.crates-io]
console = { version = "0.15.7", git = "https://github.com/tgolsson/console.git", rev = "5483880905f384679d322e83c37180f122951995" }
3 changes: 0 additions & 3 deletions src/rust/engine/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ version = "0.0.1"
edition = "2021"
authors = ["Pants Build <[email protected]>"]

[lib]
path = "src/console_ui.rs"

[dependencies]
console = { workspace = true }
futures = { workspace = true }
Expand Down
Loading

0 comments on commit 05e89ec

Please sign in to comment.