From cdf189e15a09b68656b4d9ba4b49d286c5beec44 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 19 Jul 2025 15:23:20 -0700 Subject: [PATCH] build(deps): allow using ratatui with unicode-width 0.2.1 (#1999) According to the issue linked from Cargo.toml, the intention has been to manually upgrade unicode-width every now and then, after verifying that the new version does not disrupt Ratatui. See https://github.com/ratatui/ratatui/issues/1271#issuecomment-2373917195. This PR unblocks using Ratatui in a dependency graph where some other crate requires some of the fixes that landed in unicode-width 0.2.1. Without this PR, Cargo blocks Ratatui from being used. ```console error: failed to select a version for `unicode-width`. ... required by package `ratatui v0.29.0` ... which satisfies dependency `ratatui = "^0.29"` of package `cargo v0.91.0` ... which satisfies path dependency `cargo` (locked to 0.91.0) of package `repro v0.0.0` versions that meet the requirements `=0.2.0` are: 0.2.0 all possible versions conflict with previously selected packages. previously selected package `unicode-width v0.2.1` ... which satisfies dependency `unicode-width = "^0.2.1"` of package `cargo v0.91.0` ... which satisfies path dependency `cargo` (locked to 0.91.0) of package `repro v0.0.0` failed to select a version for `unicode-width` which could resolve this conflict ``` --- BREAKING-CHANGES.md | 12 ++++++++++++ Cargo.lock | 4 ++-- Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/BREAKING-CHANGES.md b/BREAKING-CHANGES.md index 475a8ee3..0fb54446 100644 --- a/BREAKING-CHANGES.md +++ b/BREAKING-CHANGES.md @@ -26,6 +26,7 @@ This is a quick summary of the sections below: feature is enabled - Disabling `default-features` suppresses the error message if `show_cursor()` fails when dropping `Terminal` + - Support a broader range for `unicode-width` version - [v0.29.0](#v0290) - `Sparkline::data` takes `IntoIterator` instead of `&[u64]` and is no longer const @@ -377,6 +378,17 @@ The `termwiz` backend is upgraded from 0.22.0 to 0.23.0. This release has a few fixes for hyperlinks and input handling, plus some dependency updates. See the [commits](https://github.com/wezterm/wezterm/commits/main/termwiz) for more details. +### Support a broader range for `unicode-width` version ([#1999]) + +[#1999]: https://github.com/ratatui/ratatui/pull/1999 + +Ratatui's dependency on `unicode-width`, previously pinned to 0.2.0, has +expanded to allow version 0.2.1. This comes with 2 behavior changes described in +[unicode-width#61] and [unicode-width#74]. + +[unicode-width#61]: https://github.com/unicode-rs/unicode-width/pull/61 +[unicode-width#74]: https://github.com/unicode-rs/unicode-width/pull/74 + ## [v0.29.0](https://github.com/ratatui/ratatui/releases/tag/v0.29.0) ### `Sparkline::data` takes `IntoIterator` instead of `&[u64]` and is no longer const ([#1326]) diff --git a/Cargo.lock b/Cargo.lock index c2ff1d07..126d0346 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3732,9 +3732,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "untrusted" diff --git a/Cargo.toml b/Cargo.toml index f1aa8ea4..07aa1b8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,7 +71,7 @@ trybuild = "1" unicode-segmentation = "1" unicode-truncate = { version = "2", default-features = false } # See for information about why we pin unicode-width -unicode-width = "=0.2.0" +unicode-width = ">=0.2.0, <=0.2.1" # Improve benchmark consistency [profile.bench]