bkirwi / armrest

UI / HWR library for the reMarkable tablet
Apache License 2.0
28 stars 2 forks source link

Problems when running build-rm.sh #2

Open alex-bratu opened 2 years ago

alex-bratu commented 2 years ago

hello! After I build with the cargo command i try to run the build-rm.sh script and I receive some errors. Here is the output of the script when i build it:

  Compiling armrest v0.1.0 (/home/remarkable/armrest)
error[E0433]: failed to resolve: could not find `input` in `libremarkable`
  --> src/app.rs:10:20
   |
10 | use libremarkable::input::ev::EvDevContext;
   |                    ^^^^^ could not find `input` in `libremarkable`

error[E0432]: unresolved import `libremarkable::framebuffer::FramebufferDraw`
 --> src/app.rs:9:5
  |
9 | use libremarkable::framebuffer::FramebufferDraw;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------
  |     |                           |
  |     |                           help: a similar name exists in the module: `FramebufferIO`
  |     no `FramebufferDraw` in `framebuffer`

error[E0433]: failed to resolve: could not find `input` in `libremarkable`
 --> src/input.rs:4:20
  |
4 | use libremarkable::input::multitouch::MultitouchEvent;
  |                    ^^^^^ could not find `input` in `libremarkable`

error[E0433]: failed to resolve: could not find `input` in `libremarkable`
 --> src/input.rs:5:20
  |
5 | use libremarkable::input::wacom::{WacomEvent, WacomPen};
  |                    ^^^^^ could not find `input` in `libremarkable`

error[E0432]: unresolved import `libremarkable::input`
  --> src/app.rs:11:20
   |
11 | use libremarkable::input::{InputDevice, InputEvent};
   |                    ^^^^^ could not find `input` in `libremarkable`

error[E0432]: unresolved import `libremarkable::input`
 --> src/input.rs:6:20
  |
6 | use libremarkable::input::InputEvent;
  |                    ^^^^^ could not find `input` in `libremarkable`

error[E0432]: unresolved import `libremarkable::framebuffer::FramebufferDraw`
 --> src/ui/canvas.rs:7:34
  |
7 | use libremarkable::framebuffer::{FramebufferDraw, FramebufferIO};
  |                                  ^^^^^^^^^^^^^^^
  |                                  |
  |                                  no `FramebufferDraw` in `framebuffer`
  |                                  help: a similar name exists in the module: `FramebufferIO`

error[E0432]: unresolved import `libremarkable::framebuffer::FramebufferDraw`
  --> src/ui/screen.rs:11:34
   |
11 | use libremarkable::framebuffer::{FramebufferDraw, FramebufferRefresh};
   |                                  ^^^^^^^^^^^^^^^
   |                                  |
   |                                  no `FramebufferDraw` in `framebuffer`
   |                                  help: a similar name exists in the module: `FramebufferIO`

error[E0432]: unresolved import `libremarkable::framebuffer::FramebufferDraw`
 --> src/ui/widget.rs:7:5
  |
7 | use libremarkable::framebuffer::FramebufferDraw;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------
  |     |                           |
  |     |                           help: a similar name exists in the module: `FramebufferIO`
  |     no `FramebufferDraw` in `framebuffer`

error[E0603]: enum `PartialRefreshMode` is private
  --> src/ui/screen.rs:10:42
   |
10 | use libremarkable::framebuffer::refresh::PartialRefreshMode;
   |                                          ^^^^^^^^^^^^^^^^^^ private enum
   |
note: the enum `PartialRefreshMode` is defined here
  --> /root/.cargo/git/checkouts/libremarkable-e1fa5419bec94e16/7ec11d2/src/framebuffer/refresh.rs:10:34
   |
10 | use crate::framebuffer::{common, PartialRefreshMode};
   |                                  ^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::ui::Region`
 --> src/dollar.rs:5:5
  |
5 | use crate::ui::Region;
  |     ^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `Point`
 --> src/ui/text.rs:6:29
  |
6 | use rusttype::{point, Font, Point, PositionedGlyph, Scale};
  |                             ^^^^^

error[E0282]: type annotations needed
  --> src/app.rs:56:23
   |
56 |         let (tx, _) = mpsc::channel();
   |                       ^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `channel`
   |
help: consider specifying the generic argument
   |
56 |         let (tx, _) = mpsc::channel::<T>();
   |                                    +++++

error[E0282]: type annotations needed
  --> src/app.rs:77:36
   |
77 |         let (input_tx, input_rx) = mpsc::channel();
   |                                    ^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `channel`
   |
help: consider specifying the generic argument
   |
77 |         let (input_tx, input_rx) = mpsc::channel::<T>();
   |                                                 +++++

error[E0599]: no method named `draw_line` found for mutable reference `&mut Framebuffer` in the current scope
   --> src/app.rs:161:51
    |
161 |                         screen.quick_draw(|fb| fb.draw_line(from, to, 3, color::BLACK));
    |                                                   ^^^^^^^^^ method not found in `&mut Framebuffer`

error[E0599]: no method named `fill_circle` found for mutable reference `&mut Framebuffer` in the current scope
   --> src/app.rs:165:51
    |
165 |                         screen.quick_draw(|fb| fb.fill_circle(to, 20, color::WHITE));
    |                                                   ^^^^^^^^^^^ method not found in `&mut Framebuffer`

error[E0599]: no method named `draw_line` found for mutable reference `&mut Framebuffer` in the current scope
  --> src/ui/canvas.rs:51:30
   |
51 |         canvas.framebuffer().draw_line(
   |                              ^^^^^^^^^ method not found in `&mut Framebuffer`

error[E0599]: no method named `draw_line` found for mutable reference `&mut Framebuffer` in the current scope
  --> src/ui/screen.rs:62:16
   |
62 |             fb.draw_line(
   |                ^^^^^^^^^ method not found in `&mut Framebuffer`

error[E0599]: no method named `clear` found for struct `Framebuffer` in the current scope
   --> src/ui/screen.rs:212:17
    |
212 |         self.fb.clear();
    |                 ^^^^^ method not found in `Framebuffer`

error[E0599]: no method named `fill_rect` found for mutable reference `&'a mut Framebuffer` in the current scope
   --> src/ui/screen.rs:346:21
    |
346 |             self.fb.fill_rect(
    |                     ^^^^^^^^^ method not found in `&'a mut Framebuffer`

warning: an associated function with this name may be added to the standard library in the future
   --> src/ui/text.rs:379:52
    |
379 |         for token in text.split_ascii_whitespace().intersperse(" ") {
    |                                                    ^^^^^^^^^^^
    |
    = note: `#[warn(unstable_name_collisions)]` on by default
    = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
    = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
    = help: call with fully qualified syntax `itertools::Itertools::intersperse(...)` to keep using the current method

warning: unused import: `std::hash::Hasher`
  --> src/ui/widget.rs:10:5
   |
10 | use std::hash::Hasher;
   |     ^^^^^^^^^^^^^^^^^

warning: unused import: `Coordinate3D`
  --> src/ml.rs:10:30
   |
10 | use flo_curves::{Coordinate, Coordinate3D};
   |                              ^^^^^^^^^^^^

Some errors have detailed explanations: E0282, E0432, E0433, E0599, E0603.
For more information about an error, try `rustc --explain E0282`.
warning: `armrest` (lib) generated 5 warnings
error: could not compile `armrest` due to 18 previous errors; 5 warnings emitted
bkirwi commented 2 years ago

Odd! Those errors look like you're pulling an incorrect version of the libremarkable library somehow, though if you're building armrest the version should be specified by Cargo.lock.

After I build with the cargo command

Which cargo commands have you tried? Do they run successfully?

i try to run the build-rm.sh script and I receive some errors.

Are you running it in this directory? Or have you added armrest as a dep in your own app?

alex-bratu commented 2 years ago

Hello! The cargo command I tried is : " cargo build --release --target armv7-unknown-linux-gnueabihf $@ " and has ran successfully. I ran the build-rm.sh script in its directory. Regarding the libremarkable version I checked it and in the Cargo.lock the version specified is "0.6.1" and the same version is in Cargo.toml file in ../libremarkable directory.

bkirwi commented 2 years ago

Hmm, it's odd that those two commands would give you different behaviour.

In any case, I've been able to reproduce some of the errors you're seeing! I've pushed a few more changes to master... mind pulling those down and trying again?