extrawurst / gitui

Blazing šŸ’„ fast terminal-ui for git written in rust šŸ¦€
MIT License
17.92k stars 547 forks source link

building on Pinebook Pro running Manjaro ARM #2283

Open skyfaller opened 3 weeks ago

skyfaller commented 3 weeks ago

Describe the bug The latest version of gitui available as a binary on Manjaro ARM is 0.21.0-2, which is too old for me, given the latest release is v0.26.3. So I want to compile the latest version from source.

I have had trouble building gitui on my Pinebook Pro running Manjaro ARM, which is the default Linux distro the laptops ship with (and therefore I assume the best-supported distro, the Pine64 wiki says "The Pinebook Pro is officially supported by the Manjaro ARM project").

I managed to install aur/gitui-git with yay gitui-git, which of course installs the latest VCS version rather than a stable release. In order to make it compile however, I have to run export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=gcc first. I don't know how/why this helps. If I skip that step and run it normally, I get the error:

error: linker `aarch64-linux-gnu-gcc` not found
  |
  = note: No such file or directory (os error 2)

error: could not compile `proc-macro2` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `libc` (build script) due to 1 previous error
error: could not compile `typenum` (build script) due to 1 previous error
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: gitui-git-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
gitui-git - exit status 4

If I run cargo install gitui to compile the latest stable release, it fails with the error:

error[E0308]: mismatched types
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:157:28
     |
157  |                 .set_cursor_line_style(self.theme.text(true, false));
     |                  --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |                  |
     |                  arguments to this method are incorrect
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1770:12
     |
1770 |     pub fn set_cursor_line_style(&mut self, style: Style) {
     |            ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:160:5
     |
159  |               text_area.set_placeholder_style(
     |                         --------------------- arguments to this method are incorrect
160  | /                 self.theme
161  | |                     .text(self.selected.unwrap_or_default(), false),
     | |___________________________________________________________________^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1850:12
     |
1850 |     pub fn set_placeholder_style(&mut self, style: Style) {
     |            ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:164:5
     |
163  |             text_area.set_style(
     |                       --------- arguments to this method are incorrect
164  |                 self.theme.text(self.selected.unwrap_or(true), false),
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1629:12
     |
1629 |     pub fn set_style(&mut self, style: Style) {
     |            ^^^^^^^^^

error[E0308]: mismatched types
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:169:6
     |
168  |                   text_area.set_block(
     |                             --------- arguments to this method are incorrect
169  | /                     Block::default()
170  | |                         .borders(Borders::ALL)
171  | |                         .border_style(
172  | |                             ratatui::style::Style::default()
...    |
176  | |                         )
177  | |                         .title(self.title.clone()),
     | |__________________________________________________^ expected `ratatui::widgets::block::Block<'_>`, found `ratatui::widgets::Block<'_>`
     |
     = note: `ratatui::widgets::Block<'_>` and `ratatui::widgets::block::Block<'_>` have similar names, but are actually distinct types
note: `ratatui::widgets::Block<'_>` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/widgets/block.rs:64:1
     |
64   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
note: `ratatui::widgets::block::Block<'_>` is defined in crate `ratatui`
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/widgets/block.rs:67:1
     |
67   | pub struct Block<'a> {
     | ^^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1648:12
     |
1648 |     pub fn set_block(&mut self, block: Block<'a>) {
     |            ^^^^^^^^^

error[E0277]: the trait bound `impl ratatui::widgets::Widget + '_: Widget` is not satisfied
   --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gitui-0.26.3/src/components/textinput.rs:644:20
    |
644 |             f.render_widget(ta.widget(), area);
    |               ------------- ^^^^^^^^^^^ the trait `Widget` is not implemented for `impl ratatui::widgets::Widget + '_`
    |               |
    |               required by a bound introduced by this call
    |
    = help: the following other types implement trait `Widget`:
              ratatui::text::Line<'_>
              Span<'_>
              ratatui::text::Text<'_>
              BarChart<'_>
              ratatui::widgets::Block<'_>
              Canvas<'_, F>
              Chart<'_>
              ratatui::widgets::Clear
            and 10 others
note: required by a bound in `ratatui::Frame::<'_>::render_widget`
   --> /home/nelson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/terminal/frame.rs:74:29
    |
74  |     pub fn render_widget<W: Widget>(&mut self, widget: W, area: Rect) {
    |                             ^^^^^^ required by this bound in `Frame::<'_>::render_widget`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
The following warnings were emitted during compilation:

warning: gitui@0.26.3: buildname 'nightly 2024-06-30 ()'

error: could not compile `gitui` (bin "gitui") due to 5 previous errors
error: failed to compile `gitui v0.26.3`, intermediate artifacts can be found at `/tmp/cargo-installVPKyKO`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
āŽ                                                                                                         

Context (please complete the following information):

neofetch --off OS: Manjaro ARM Linux aarch64 Host: Pine64 Pinebook Pro Kernel: 6.7.9-1-MANJARO-ARM Uptime: 7 mins Packages: 1169 (pacman) Shell: fish 3.7.0 Resolution: 1920x1080 WM: sway Theme: Breath-Dark [GTK2/3] Icons: breath2 [GTK2/3] Terminal: alacritty Terminal Font: Ubuntu Mono CPU: (6) @ 1.416GHz Memory: 974MiB / 3862MiB

egorenar commented 2 weeks ago

I have the same error when trying to cross-compile gitui for OpenWRT ARM.

therealolie commented 1 week ago

getting the same issue when trying to install on arch (btw) x86_64

dkarter commented 6 days ago

Same when running cargo install on ARM macOS

extrawurst commented 13 hours ago

building via cargo makes it eagerly update dependencies which will lead to incompatibilities. Please see https://github.com/extrawurst/gitui?tab=readme-ov-file#cargo-install and build via cargo install gitui --locked

egorenar commented 10 hours ago

hmm, in my opinion cargo does everything right, if your Cargo.toml allows such dependency updates. why not correct it in Cargo.toml, apparently you specified your dependency versions not strict enough ?

extrawurst commented 5 hours ago

@egorenar i went down this path before. its not as easy as that: https://github.com/extrawurst/gitui/issues/2098

@skyfaller let me know if you are able to build via --locked - it should fix your problem