Skip to content

📌 chore(deps): hold unicode-width below 0.2.3 for cargo install (#725) - #727

Closed
kbrdn1 wants to merge 3 commits into
devfrom
chore/#725-hold-unicode-width
Closed

kbrdn1 wants to merge 3 commits into
devfrom
chore/#725-hold-unicode-width

Conversation

@kbrdn1

@kbrdn1 kbrdn1 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Description

Caps unicode-width below 0.2.3 in [dependencies] so that cargo install gwm-cli without --locked stops resolving the pair that double-counts halfwidth sound marks, until ratatui-core releases ratatui/ratatui#2892 (#721).

Closes #725
Refs #721 (stays open: it takes both crates together and deletes this hold)

Type of change

  • ✨ Feature (new functionality)
  • 🐛 Fix (bug fix)
  • 🚑️ Hotfix (critical production fix)
  • ♻️ Refactor (no behaviour change)
  • 📝 Docs
  • ✅ Tests
  • ⚡ Perf
  • 🔧 Chore / CI / build

Changes

  • Cargo.toml: unicode-width = ">=0.2.0, <0.2.3" under [dependencies], unused by src/, with the removal condition in its comment. The dev-dependency entry is untouched, so lifting the hold is one entry and one test.
  • tests/tui_ui_helpers_tests.rs: unicode_width_is_held_below_0_2_3_until_ratatui_core_ships_the_fix, next to UNDERCOUNTED. It reads the requirement from [dependencies], in the source form or the [dependencies.unicode-width] table cargo package writes (the suite also runs from the downloaded crate), and evaluates it with semver, the crate cargo matches with.
  • semver = "1" dev-dependency. It is already in the graph (1.0.28); Cargo.lock gains one line in gwm-cli's dependency list and no package.
  • CHANGELOG entry under Fixed.

Why [dependencies] and not the existing dev-dependency

cargo install resolves without dev-dependencies: make_ws_rustc_target in cargo's src/ops/cargo_install.rs calls ws.set_require_optional_deps(false), and cargo's install::dev_dependencies_no_check test installs a package whose dev-dependency does not exist. Measured on a lockless cargo install --path of the cargo package output, with CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=allow to match a registry install:

Manifest unicode-width compiled
origin/dev as is 0.2.3
cap on the dev-dependency only 0.2.3
this branch (cap in [dependencies]) 0.2.2 (Adding unicode-width v0.2.2 (available: v0.2.3))

ratatui-core 0.1.2 requires unicode-width >=0.2.0, so it shares the 0.2 slot and follows the cap.

Tests

  • cargo test passes locally (3590 passed, 0 failed)
  • cargo fmt --check passes
  • cargo clippy -- -D warnings passes (--all-targets)
  • New tests added under tests/ (TDD: a PR adding behaviour without tests is sent back)

Proof of red, one assertion at a time, reading which one panicked:

  1. no [dependencies] entry (dev-dependency only): [dependencies] must cap unicode-width below 0.2.3 for cargo install (a dev-dependency is not resolved there), found None
  2. [dependencies] unicode-width = "0.2": ... admits 0.2.3, which ratatui-core 0.1.2 double-counts
  3. unicode-width = { version = "0.2" } (table form): ... admits 0.2.3, ...; the capped table form passes.

cargo audit --deny warnings is clean on the branch lockfile.

Screenshots / TUI captures

None: no rendering change.

Checklist

  • Branch follows <type>/#<issue>-<description>
  • Commits follow Gitmoji + Conventional Commits (see CONTRIBUTING.md)
  • CHANGELOG.md updated under ## [Unreleased]
  • README updated if CLI surface changed (n/a)
  • examples/gwm.toml.example updated if config schema changed (n/a)
  • No unwrap() on user-facing paths (return GwmError instead)
  • No println! in TUI render code (status bar only)

Linked issues / docs

Notes for reviewers

  • Upstream state on 2026-11-12: ratatui-core 0.1.2 (2026-06-19) is still the latest release. The fix is build(deps): bump unicode-width from 0.2.2 to 0.2.3 ratatui/ratatui#2892 (merged on main 2026-11-02): it drops the compensation and raises ratatui-core's requirement to unicode-width >=0.2.3. fix(core): avoid double-counting halfwidth sound marks ratatui/ratatui#2887 only adds tests. The only open release-plz PR (chore: release ratatui/ratatui#2609) is the June one that predates both.
  • No tripwire: under the cap cargo stays on ratatui-core 0.1.2 even once the fixed release exists (it needs >=0.2.3), so nothing in the repo goes red when it ships. A first version tested the locked ratatui-core version; review showed it could never fire, and it was removed. [Task]: take unicode-width 0.2.3 together with the ratatui-core release that stops double-counting sound marks #721 stays open as the trigger to lift the hold.
  • Once the fixed ratatui-core is published, uncapped releases heal by themselves (ratatui 0.30.2 asks for ratatui-core ^0.1.2, so a lockless install picks the fixed core with unicode-width 0.2.3), while a capped release stays on 0.1.2 + 0.2.2: correct rendering, older core. So the hold should be lifted promptly.
  • Limits: the cap only protects releases published after it lands, so 1.11.0 on crates.io stays exposed. It holds the 0.2 slot only: a unicode-width 0.3 would reach ratatui-core (>=0.2.0) in a slot of its own, and nothing in this manifest can stop that.
  • Side effect, intended: a blanket cargo update no longer pulls 0.2.3 into the lockfile either.

`cargo install gwm-cli` without `--locked` ignores the committed lockfile
and resolved unicode-width 0.2.3 next to ratatui-core 0.1.2, the pair that
counts each halfwidth sound mark twice (#721). Cargo skips dev-dependencies
when it resolves an install (`set_require_optional_deps(false)`), so the
existing dev-dependency held nothing there: the cap sits in
[dependencies], unused by src/.

Measured on a lockless `cargo install --path` of the packaged crate:
unicode-width 0.2.3 without the cap, 0.2.3 with the cap on the
dev-dependency only, 0.2.2 with the cap in [dependencies].

The test evaluates the requirement with `semver` and turns red once the
locked ratatui-core moves past 0.1.2, so the hold cannot outlive the
upstream fix.

Refs #721
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a8cb849d-56f1-4e7f-aad5-306fe100fc23

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…re (#725)

`cargo package` rewrites `unicode-width = "req"` as a
`[dependencies.unicode-width]` table, so the guard panicked on a valid
cap when the suite runs from the downloaded crate. It now reads the
`version` key of a table too.

The ratatui-core tripwire could never fire: the fix is
ratatui/ratatui#2892, not #2887 (tests only), and it makes ratatui-core
require `unicode-width >=0.2.3`. Under the cap cargo stays on
ratatui-core 0.1.2, so the locked version never moves. Removed, and the
comments say plainly that #721 is what lifts the hold.

Refs #721
@kbrdn1

kbrdn1 commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Closing unmerged. The cap works (measured below), but it stopped being a clean guard during review:

A narrow and shrinking protection, paid for by suppressing the only signal that the hold can be lifted. Details and measurements are on #721. The branch stays for reference; CI was green on f0956f6 and 9db1219.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant