Skip to content
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

building on Pinebook Pro running Manjaro ARM #2283

Open
skyfaller opened this issue Jun 30, 2024 · 7 comments
Open

building on Pinebook Pro running Manjaro ARM #2283

skyfaller opened this issue Jun 30, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@skyfaller
Copy link

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):

  • OS/Distro + Version: Manjaro ARM Linux DISTRIB_RELEASE=24.03
  • GitUI Version: gitui nightly 2024-06-30 (3229c5d)
  • Rust version: rustc 1.76.0 (07dca489a 2024-02-04) (Arch Linux rust 1:1.76.0-1)
  • Cargo version: cargo 1.76.0

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

@skyfaller skyfaller added the bug Something isn't working label Jun 30, 2024
@egorenar
Copy link

egorenar commented Jul 3, 2024

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

@ghost
Copy link

ghost commented Jul 10, 2024

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

@dkarter
Copy link

dkarter commented Jul 15, 2024

Same when running cargo install on ARM macOS

@extrawurst
Copy link
Owner

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
Copy link

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
Copy link
Owner

@egorenar i went down this path before. its not as easy as that: #2098

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

@joshka
Copy link

joshka commented Jul 23, 2024

Tui-textarea's version specifier was wrong - it specified >0.23, which picks up whatever the latest 0.x.y version, but that's not semver compatible with 0.x-1.y and hence the compilation issue. This should have been fixed in the latest version of tui-textarea (0.5.y) though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants