bkirwi / armrest

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

Getting `fatal error: 'memory' file not found` while building #1

Open UKnowWhoIm opened 2 years ago

UKnowWhoIm commented 2 years ago

Hey I setup libremarkable in my system with cargo and tried running build_rm.sh. It is producing an error

   Compiling tflite v0.9.4 (https://github.com/bkirwi/tflite-rs?rev=7d5a0d8a51378313dbe017c32299a51e002c06b5#7d5a0d8a)
error: failed to run custom build command for `tflite v0.9.4 (https://github.com/bkirwi/tflite-rs?rev=7d5a0d8a51378313dbe017c32299a51e002c06b5#7d5a0d8a)`

Caused by:
  process didn't exit successfully: `/code/armrest/target/release/build/tflite-b383ef880b7d6fea/build-script-build` (exit status: 101)
  --- stderr
  csrc/stl_wrapper.hpp:1:10: fatal error: 'memory' file not found
  csrc/stl_wrapper.hpp:1:10: fatal error: 'memory' file not found, err: true
  thread 'main' panicked at 'Unable to generate STL bindings: ()', /home/uknowwhoim/.cargo/git/checkouts/tflite-rs-2a5bed998891ab30/7d5a0d8/build.rs:299:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Here's the full backtrace

Compiling tflite v0.9.4 (https://github.com/bkirwi/tflite-rs?rev=7d5a0d8a51378313dbe017c32299a51e002c06b5#7d5a0d8a)
error: failed to run custom build command for `tflite v0.9.4 (https://github.com/bkirwi/tflite-rs?rev=7d5a0d8a51378313dbe017c32299a51e002c06b5#7d5a0d8a)`

Caused by:
  process didn't exit successfully: `/code/armrest/target/release/build/tflite-b383ef880b7d6fea/build-script-build` (exit status: 101)
  --- stderr
  csrc/stl_wrapper.hpp:1:10: fatal error: 'memory' file not found
  csrc/stl_wrapper.hpp:1:10: fatal error: 'memory' file not found, err: true
  thread 'main' panicked at 'Unable to generate STL bindings: ()', /home/uknowwhoim/.cargo/git/checkouts/tflite-rs-2a5bed998891ab30/7d5a0d8/build.rs:299:10
  stack backtrace:
     0:     0x5627f272a81c - std::backtrace_rs::backtrace::libunwind::trace::h3fea1eb2e0ba2ac9
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
     1:     0x5627f272a81c - std::backtrace_rs::backtrace::trace_unsynchronized::h849d83492cbc0d59
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:     0x5627f272a81c - std::sys_common::backtrace::_print_fmt::he3179d37290f23d3
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:67:5
     3:     0x5627f272a81c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h140f6925cad14324
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:46:22
     4:     0x5627f275215c - core::fmt::write::h31b9cd1bedd7ea38
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/fmt/mod.rs:1150:17
     5:     0x5627f2726a55 - std::io::Write::write_fmt::h1fdf66f83f70913e
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/io/mod.rs:1667:15
     6:     0x5627f272cb40 - std::sys_common::backtrace::_print::he7ac492cd19c3189
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:49:5
     7:     0x5627f272cb40 - std::sys_common::backtrace::print::hba20f8920229d8e8
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:36:9
     8:     0x5627f272cb40 - std::panicking::default_hook::{{closure}}::h714d63979ae18678
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:210:50
     9:     0x5627f272c6f7 - std::panicking::default_hook::hf1afb64e69563ca8
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:227:9
    10:     0x5627f272d1f4 - std::panicking::rust_panic_with_hook::h02231a501e274a13
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:624:17
    11:     0x5627f272ccd0 - std::panicking::begin_panic_handler::{{closure}}::h5b5e738edf361af7
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:521:13
    12:     0x5627f272ace4 - std::sys_common::backtrace::__rust_end_short_backtrace::h601a115def7987b1
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:141:18
    13:     0x5627f272cc39 - rust_begin_unwind
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5
    14:     0x5627f20889c1 - core::panicking::panic_fmt::h7a58c8fffc5559a4
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14
    15:     0x5627f2088ab3 - core::result::unwrap_failed::h1036b5c6eb8030dd
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/result.rs:1617:5
    16:     0x5627f2095e4b - core::result::Result<T,E>::expect::ha552cd2300bb4b0a
    17:     0x5627f20920c3 - build_script_build::import_stl_types::h07e25936bc715fb3
    18:     0x5627f20922d6 - build_script_build::main::h053b825a8b5b6ffa
    19:     0x5627f20939f3 - core::ops::function::FnOnce::call_once::hc61767a61008a7cc
    20:     0x5627f2093859 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3c70b12dbfac8c3d
    21:     0x5627f20938d9 - std::rt::lang_start::{{closure}}::h07bb11784299af3e
    22:     0x5627f272d7fa - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2790017aba790142
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:259:13
    23:     0x5627f272d7fa - std::panicking::try::do_call::hd5d0fbb7d2d2d85d
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
    24:     0x5627f272d7fa - std::panicking::try::h675520ee37b0fdf7
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
    25:     0x5627f272d7fa - std::panic::catch_unwind::h803430ea0284ce79
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
    26:     0x5627f272d7fa - std::rt::lang_start_internal::{{closure}}::h3a398a8154de3106
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:45:48
    27:     0x5627f272d7fa - std::panicking::try::do_call::hf60f106700df94b2
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
    28:     0x5627f272d7fa - std::panicking::try::hb2022d2bc87a9867
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
    29:     0x5627f272d7fa - std::panic::catch_unwind::hbf801c9d61f0c2fb
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
    30:     0x5627f272d7fa - std::rt::lang_start_internal::hdd488b91dc742b96
                                 at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:45:20
    31:     0x5627f20938b1 - std::rt::lang_start::hf37c24187c7b6132
    32:     0x5627f2092303 - main
    33:     0x7f03656330b3 - __libc_start_main
    34:     0x5627f20891be - _start
    35:                0x0 - <unknown>

I just setup Rust for this project, I've no prior experience in it, any help would be greatly appreciated.

bkirwi commented 2 years ago

Hi!

Unfortunately you've picked a somewhat challenging first Rust project to build... getting the toolchain working to build tflite can be a pain.

This is very likely an issue with your remarkable toolchain setup. (In particular, tflite is not finding the toolchain-provided libraries correctly.) Some questions to answer:

UKnowWhoIm commented 2 years ago
warning: an associated function with this name may be added to the standard library in the future --> src/ui/text.rs:324:52 324 for token in text.split_ascii_whitespace().intersperse(" ") { ^^^^^^^^^^^
= note: `#[warn(unstable_name_collisions)]` on by default
warning: unused import: Coordinate3D --> src/ml.rs:10:30 10 use flo_curves::{Coordinate, Coordinate3D}; ^^^^^^^^^^^^

= note: #[warn(unused_imports)] on by default

bkirwi commented 2 years ago

Mmm... looks like the latest versions of the toolchain have moved some things around, which breaks the helper script. I'll look into it.

bkirwi commented 2 years ago

I've pulled down the latest available toolchain and got the build script working again... does that work any better?

(I notice you're using the rm10x toolchain... I assume that's the Remarkable 1 version? Shouldn't make a difference...)