Skip to content

Update to Ratatui 0.26 #1959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

joshka
Copy link

@joshka joshka commented Nov 22, 2023

This Pull Request fixes/closes #{issue_num}.

It changes the following:

  • Updates Ratatui to 0.24.0
  • Removes Backend Generic parameter pretty much everywhere it was used

I followed the checklist:

  • I added unittests (NA)
  • I ran make check without errors
    • errors in cargo deny
  • I tested the overall application
    • ran a quick check to see that things loaded OK
  • I added an appropriate item to the changelog

@joshka
Copy link
Author

joshka commented Nov 22, 2023

Cargo deny output:

warning[accepted]: license requirements satisfied
  ┌─ bwrap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index):4:12
  │
4 │ license = "MIT OR GPL-3.0-or-later"
  │            ^^^----^^^^^^^^^^^^^^^^
  │            │      │
  │            │      accepted: license is considered copyleft
  │            license expression retrieved via Cargo.toml `license`
  │            accepted: license is explicitly allowed
  │
  = bwrap v1.3.0
    └── gitui v0.24.3

error[duplicate]: found 2 duplicate entries for crate 'bitflags'
   ┌─ /Users/joshka/local/gitui/Cargo.lock:21:1
   │
21 │ ╭ bitflags 1.3.2 registry+https://github.com/rust-lang/crates.io-index
22 │ │ bitflags 2.4.1 registry+https://github.com/rust-lang/crates.io-index
   │ ╰────────────────────────────────────────────────────────────────────^ lock entries
   │
   = bitflags v1.3.2
     ├── asyncgit v0.24.3
     │   └── gitui v0.24.3
     ├── crossterm v0.26.1
     │   └── gitui v0.24.3 (*)
     ├── git2 v0.17.2
     │   └── asyncgit v0.24.3 (*)
     ├── gitui v0.24.3 (*)
     ├── inotify v0.9.6
     │   └── notify v5.2.0
     │       ├── gitui v0.24.3 (*)
     │       └── notify-debouncer-mini v0.2.1
     │           └── gitui v0.24.3 (*)
     ├── kqueue-sys v1.0.3
     │   └── kqueue v1.0.7
     │       └── notify v5.2.0 (*)
     ├── notify v5.2.0 (*)
     ├── redox_syscall v0.2.16
     │   ├── filetime v0.2.20
     │   │   └── notify v5.2.0 (*)
     │   ├── parking_lot_core v0.9.7
     │   │   ├── dashmap v5.4.0
     │   │   │   └── serial_test v1.0.0
     │   │   │       └── (dev) asyncgit v0.24.3 (*)
     │   │   └── parking_lot v0.12.1
     │   │       ├── crossterm v0.26.1 (*)
     │   │       ├── crossterm v0.27.0
     │   │       │   └── ratatui v0.24.0
     │   │       │       └── gitui v0.24.3 (*)
     │   │       └── serial_test v1.0.0 (*)
     │   ├── redox_users v0.4.3
     │   │   └── dirs-sys v0.4.1
     │   │       └── dirs v5.0.1
     │   │           ├── gitui v0.24.3 (*)
     │   │           └── shellexpand v3.1.0
     │   │               ├── asyncgit v0.24.3 (*)
     │   │               └── gitui v0.24.3 (*)
     │   └── tempfile v3.4.0
     │       ├── (dev) asyncgit v0.24.3 (*)
     │       └── (dev) gitui v0.24.3 (*)
     ├── ron v0.8.0
     │   └── gitui v0.24.3 (*)
     ├── rustix v0.36.16
     │   ├── is-terminal v0.4.3
     │   │   └── env_logger v0.10.1
     │   │       └── (dev) asyncgit v0.24.3 (*)
     │   └── tempfile v3.4.0 (*)
     └── syntect v5.1.0
         └── gitui v0.24.3 (*)
   = bitflags v2.4.1
     ├── crossterm v0.27.0
     │   └── ratatui v0.24.0
     │       └── gitui v0.24.3
     └── ratatui v0.24.0 (*)

error[duplicate]: found 2 duplicate entries for crate 'crossterm'
   ┌─ /Users/joshka/local/gitui/Cargo.lock:42:1
   │
42 │ ╭ crossterm 0.26.1 registry+https://github.com/rust-lang/crates.io-index
43 │ │ crossterm 0.27.0 registry+https://github.com/rust-lang/crates.io-index
   │ ╰──────────────────────────────────────────────────────────────────────^ lock entries
   │
   = crossterm v0.26.1
     └── gitui v0.24.3
   = crossterm v0.27.0
     └── ratatui v0.24.0
         └── gitui v0.24.3

error[duplicate]: found 2 duplicate entries for crate 'hashbrown'
   ┌─ /Users/joshka/local/gitui/Cargo.lock:80:1
   │
80 │ ╭ hashbrown 0.12.3 registry+https://github.com/rust-lang/crates.io-index
81 │ │ hashbrown 0.14.2 registry+https://github.com/rust-lang/crates.io-index
   │ ╰──────────────────────────────────────────────────────────────────────^ lock entries
   │
   = hashbrown v0.12.3
     ├── dashmap v5.4.0
     │   └── serial_test v1.0.0
     │       └── (dev) asyncgit v0.24.3
     │           └── gitui v0.24.3
     └── indexmap v1.9.3
         └── gitui v0.24.3 (*)
   = hashbrown v0.14.2
     └── lru v0.12.1
         └── ratatui v0.24.0
             └── gitui v0.24.3

error[duplicate]: found 2 duplicate entries for crate 'itertools'
   ┌─ /Users/joshka/local/gitui/Cargo.lock:96:1
   │
96 │ ╭ itertools 0.11.0 registry+https://github.com/rust-lang/crates.io-index
97 │ │ itertools 0.12.0 registry+https://github.com/rust-lang/crates.io-index
   │ ╰──────────────────────────────────────────────────────────────────────^ lock entries
   │
   = itertools v0.11.0
     └── ratatui v0.24.0
         └── gitui v0.24.3
   = itertools v0.12.0
     └── gitui v0.24.3

warning[license-not-encountered]: license was not encountered
  ┌─ /Users/joshka/local/gitui/deny.toml:7:5
  │
7 │     "BSD-3-Clause",
  │     ^^^^^^^^^^^^^^ unmatched license allowance

error[duplicate]: found 2 duplicate entries for crate 'syn'
    ┌─ /Users/joshka/local/gitui/Cargo.lock:177:1
    │
177 │ ╭ syn 1.0.107 registry+https://github.com/rust-lang/crates.io-index
178 │ │ syn 2.0.39 registry+https://github.com/rust-lang/crates.io-index
    │ ╰────────────────────────────────────────────────────────────────^ lock entries
    │
    = syn v1.0.107
      ├── cxx-build v1.0.90
      │   └── (build) iana-time-zone-haiku v0.1.1
      │       └── iana-time-zone v0.1.53
      │           └── chrono v0.4.31
      │               └── gitui v0.24.3
      ├── cxxbridge-macro v1.0.90
      │   └── cxx v1.0.90
      │       └── iana-time-zone-haiku v0.1.1 (*)
      ├── git-version-macro v0.3.5
      │   └── git-version v0.3.5
      │       └── bugreport v0.5.0
      │           └── gitui v0.24.3 (*)
      ├── proc-macro-error v1.0.4
      │   └── struct-patch-derive v0.2.3
      │       └── struct-patch v0.2.3
      │           └── gitui v0.24.3 (*)
      ├── serde_derive v1.0.156
      │   └── serde v1.0.156
      │       ├── asyncgit v0.24.3
      │       │   └── gitui v0.24.3 (*)
      │       ├── bincode v1.3.3
      │       │   └── syntect v5.1.0
      │       │       └── gitui v0.24.3 (*)
      │       ├── bitflags v2.4.1
      │       │   ├── crossterm v0.27.0
      │       │   │   └── ratatui v0.24.0
      │       │   │       └── gitui v0.24.3 (*)
      │       │   └── ratatui v0.24.0 (*)
      │       ├── crossterm v0.26.1
      │       │   └── gitui v0.24.3 (*)
      │       ├── gitui v0.24.3 (*)
      │       ├── ratatui v0.24.0 (*)
      │       ├── ron v0.8.0
      │       │   └── gitui v0.24.3 (*)
      │       ├── serde_json v1.0.93
      │       │   └── syntect v5.1.0 (*)
      │       └── syntect v5.1.0 (*)
      ├── serial_test_derive v1.0.0
      │   └── serial_test v1.0.0
      │       └── (dev) asyncgit v0.24.3 (*)
      ├── struct-patch-derive v0.2.3 (*)
      ├── thiserror-impl v1.0.39
      │   └── thiserror v1.0.39
      │       ├── asyncgit v0.24.3 (*)
      │       ├── filetreelist v0.5.0
      │       │   └── gitui v0.24.3 (*)
      │       ├── redox_users v0.4.3
      │       │   └── dirs-sys v0.4.1
      │       │       └── dirs v5.0.1
      │       │           ├── gitui v0.24.3 (*)
      │       │           └── shellexpand v3.1.0
      │       │               ├── asyncgit v0.24.3 (*)
      │       │               └── gitui v0.24.3 (*)
      │       └── syntect v5.1.0 (*)
      ├── wasm-bindgen-backend v0.2.84
      │   └── wasm-bindgen-macro-support v0.2.84
      │       └── wasm-bindgen-macro v0.2.84
      │           └── wasm-bindgen v0.2.84
      │               ├── iana-time-zone v0.1.53 (*)
      │               └── js-sys v0.3.61
      │                   └── iana-time-zone v0.1.53 (*)
      └── wasm-bindgen-macro-support v0.2.84 (*)
    = syn v2.0.39
      └── strum_macros v0.25.3
          └── strum v0.25.0
              └── ratatui v0.24.0
                  └── gitui v0.24.3

Copy link
Author

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quick review notes

Cargo.lock Outdated
Comment on lines 199 to 207
[[package]]
name = "bitflags"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
dependencies = [
"serde",
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this could be a problem as the serialization format changed in v2. We updated Ratatui to bitflags v2 a while back, so it might depend on what exactly you're serializing and which version of bitflags that gets used. I attempted to update Crossterm to v0.27.0 as well and ran into errors that were somewhat related to bitflags problems (I think).

@extrawurst
Copy link
Collaborator

extrawurst commented Feb 12, 2024

now that #1781 is closed please update and lets get this merged. bringing it up to date with master should also make the CI green

@joshka
Copy link
Author

joshka commented Feb 14, 2024

Rebased.

bringing it up to date with master

Would you mind renaming master to main to bring this project inline with the standard default git branch name at some point?

@extrawurst extrawurst changed the title Update to Ratatui 0.24.0 Update to Ratatui 0.26 Feb 20, 2024
@extrawurst
Copy link
Collaborator

superceded by #2076

@extrawurst extrawurst closed this Feb 20, 2024
@extrawurst
Copy link
Collaborator

@joshka updating to anything >0.24 is currently blocked by the introduction of stability as a dependency in ratatui which pulls in old syn 1.x

@extrawurst
Copy link
Collaborator

see ratatui/ratatui#961

@extrawurst extrawurst mentioned this pull request Feb 20, 2024
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.

2 participants