Skip to content

Commit

Permalink
third-party/rust: pin unicode-width to solve an issue with cell width…
Browse files Browse the repository at this point in the history
… in prettytable-rs when using cell containing string formatted with Colored crate.

Summary:
I have noticed that recently `metalctl` CLI started rendering table with wrong cells widths:

{F1946659102}

After looking around I found this [Issue](phsym/prettytable-rs#165) reported exactly the same problem.

In `metalos` we **do** use Colored crate:

https://www.internalfb.com/code/fbsource/[769b00238690]/fbcode/metalos/metald/if/rust/src/api.rs?lines=206-220

And this messes up with the width.
An user in that GH issue reported pinning unicode-width to 0.1.12 works around the problem hence this is what I am doing this.

This started happening after `unicode-width` got bumped in tp2 from `0.1.12` to `0.1.14` on the 21st of October: https://www.internalfb.com/phabricator/commit/FBS/7c9387478e0a3a1d1876ec4a5a17599510994711

I am aware pinning dependencies asks for trouble e.g. duplication etc.
We can remove the pin after this issue is fixed in `prettytable-rs` and I added a comment about that in Cargo.toml

Differential Revision: D64960800

fbshipit-source-id: 7fa29b15b1cae7d5a0f75a44f0d4f221e78c7a91
  • Loading branch information
pallotron authored and facebook-github-bot committed Oct 25, 2024
1 parent 2f83b19 commit 6c23118
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eden/mononoke/cmdlib/displaying/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ mercurial_types = { version = "0.1.0", path = "../../mercurial/types" }
mononoke_types = { version = "0.1.0", path = "../../mononoke_types" }
serde = { version = "1.0.185", features = ["derive", "rc"] }
unicode-truncate = "0.2"
unicode-width = "0.1"
unicode-width = "=0.1.12"
2 changes: 1 addition & 1 deletion eden/scm/lib/progress/render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2021"
progress-model = { version = "0.1.0", path = "../model" }
termwiz = { version = "0.22", features = ["widgets"] }
unicode-segmentation = "1.6.0"
unicode-width = "0.1"
unicode-width = "=0.1.12"
2 changes: 1 addition & 1 deletion eden/scm/lib/renderdag/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ serde = { version = "1.0.185", features = ["derive", "rc"], optional = true }
[dev-dependencies]
dag = { version = "0.1.0", path = "../dag", default-features = false }
nonblocking = { version = "0.1.0", path = "../nonblocking" }
unicode-width = "0.1"
unicode-width = "=0.1.12"

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/lib/third-party/streampager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ termwiz = { version = "0.22", features = ["widgets"] }
thiserror = "1.0.64"
toml = "0.8.4"
unicode-segmentation = "1.6.0"
unicode-width = "0.1"
unicode-width = "=0.1.12"
vec_map = "0.8"

0 comments on commit 6c23118

Please sign in to comment.