ctron / rust-esp32-hono

HTTP with Rust on ESP32
19 stars 1 forks source link

Linking with the docker image failed #3

Open prisme60 opened 4 years ago

prisme60 commented 4 years ago

I don't know what I did wrong, but the linking step fails on my computer.

christian@COOLMASTER:~/rust-esp32/rust-esp32-hono$ docker image ls
REPOSITORY                                                      TAG                           IMAGE ID            CREATED             SIZE
quay.io/ctron/rust-esp                                          latest                        18e836fc4fa3        2 months ago        12.7GB

Do you have the copy error message (intermittent IO error)?

christian@COOLMASTER:~/rust-esp32/rust-esp32-hono$ docker run -v $PWD:/home/project:z --rm -ti quay.io/ctron/rust-esp xbuild-project
    Updating crates.io index
  Downloaded compiler_builtins v0.1.23
   Compiling core v0.0.0 (/home/esp32-toolchain/rustc/rust_xtensa/src/libcore)
   Compiling compiler_builtins v0.1.23
   Compiling rustc-std-workspace-core v1.0.0 (/home/esp32-toolchain/rustc/rust_xtensa/src/tools/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/tmp/xargo.doZWdd4RF8U5)
    Finished release [optimized] target(s) in 43.47s
Unable to copy the directory 'bin' from sysroot: intermittent IO error while iterating directory `/home/esp32-toolchain/rustc/rust_build/lib/rustlib/x86_64-unknown-linux-gnu/bin`
    Updating git repository `https://github.com/ctron/serde-json-core`
  Downloaded memchr v2.2.1
  Downloaded serde v1.0.104
  Downloaded generic-array v0.11.1
  Downloaded serde_derive v1.0.104
  Downloaded cty v0.2.1
  Downloaded heapless v0.4.4
  Downloaded proc-macro2 v1.0.6
  Downloaded quote v1.0.2
  Downloaded syn v1.0.11
  Downloaded typenum v1.11.2
  Downloaded unicode-xid v0.2.0
  Downloaded as-slice v0.1.2
  Downloaded stable_deref_trait v1.1.1
  Downloaded generic-array v0.12.3
  Downloaded generic-array v0.13.2
  Downloaded hash32 v0.1.1
  Downloaded byteorder v1.3.2
   Compiling proc-macro2 v1.0.6
   Compiling unicode-xid v0.2.0
   Compiling typenum v1.11.2
   Compiling syn v1.0.11
   Compiling byteorder v1.3.2
   Compiling memchr v2.2.1
   Compiling serde v1.0.104
   Compiling heapless v0.4.4
   Compiling stable_deref_trait v1.1.1
   Compiling cty v0.2.1
   Compiling esp-idf-alloc v0.1.1 (/home/project/esp-idf-alloc)
   Compiling esp32-sys v0.1.0 (/home/project/esp32-sys)
   Compiling cstr_core v0.1.2 (/home/project/cstr_core)
warning: `...` range patterns are deprecated
   --> cstr_core/src/lib.rs:134:20
    |
134 |             b'\x20'...b'\x7e' => ([c, 0, 0, 0], 1),
    |                    ^^^ help: use `..=` for an inclusive range
    |
    = note: #[warn(ellipsis_inclusive_range_patterns)] on by default

warning: `...` range patterns are deprecated
   --> cstr_core/src/lib.rs:145:18
    |
145 |                 0...9 => b'0' + b,
    |                  ^^^ help: use `..=` for an inclusive range

   Compiling hash32 v0.1.1
warning: the feature `alloc` has been stable since 1.36.0 and no longer requires an attribute to enable
  --> cstr_core/src/lib.rs:12:40
   |
12 | #![cfg_attr(feature = "alloc", feature(alloc))]
   |                                        ^^^^^
   |
   = note: #[warn(stable_features)] on by default

   Compiling generic-array v0.12.3
   Compiling generic-array v0.13.2
   Compiling generic-array v0.11.1
   Compiling as-slice v0.1.2
   Compiling quote v1.0.2
   Compiling serde_derive v1.0.104
   Compiling serde-json-core v0.0.1 (https://github.com/ctron/serde-json-core?branch=feature/support_floats_1#2e8de9e4)
   Compiling esp-app v0.1.0 (/home/project)
warning: trait objects without an explicit `dyn` are deprecated
  --> src/timer.rs:13:19
   |
13 |     callback: Box<FnMut()>,
   |                   ^^^^^^^ help: use `dyn`: `dyn FnMut()`
   |
   = note: #[warn(bare_trait_objects)] on by default

warning: function is never used: `err_to_str`
  --> src/error.rs:60:1
   |
60 | pub fn err_to_str(err: esp_err_t) -> &'static str {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(dead_code)] on by default

warning: variant is never constructed: `PUT`
  --> src/http/config.rs:22:5
   |
22 |     PUT,
   |     ^^^

warning: variant is never constructed: `HEAD`
  --> src/http/config.rs:24:5
   |
24 |     HEAD,
   |     ^^^^

warning: variant is never constructed: `DELETE`
  --> src/http/config.rs:25:5
   |
25 |     DELETE,
   |     ^^^^^^

warning: variant is never constructed: `PATCH`
  --> src/http/config.rs:26:5
   |
26 |     PATCH,
   |     ^^^^^

warning: variant is never constructed: `DIGEST`
  --> src/http/config.rs:39:5
   |
39 |     DIGEST,
   |     ^^^^^^

warning: field is never used: `username`
  --> src/http/mod.rs:26:5
   |
26 |     username: Option<CString>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `http_config`
  --> src/http/mod.rs:34:5
   |
34 |     http_config: esp_http_client_config_t,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: method is never used: `send`
   --> src/http/mod.rs:129:5
    |
129 |     pub fn send(&mut self) -> Result<Response> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: struct is never constructed: `Uart`
 --> src/uart/mod.rs:5:1
  |
5 | pub struct Uart {
  | ^^^^^^^^^^^^^^^

warning: constant item is never used: `HONO_DEVICE_AUTH_ID`
  --> src/main.rs:65:1
   |
65 | const HONO_DEVICE_AUTH_ID: &str = "xx@rhte2019.iot";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant item is never used: `HONO_DEVICE_PASSWORD`
  --> src/main.rs:66:1
   |
66 | const HONO_DEVICE_PASSWORD: &str = "xx";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: linking with `xtensa-esp32-elf-gcc` failed: exit code: 1
  |
  = note: "xtensa-esp32-elf-gcc" "-L" "/home/project/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib" "/home/project/target/xtensa-esp32-none-elf/release/deps/esp_app-fa9529185948592b.esp_app.8tmh4ge1-cgu.0.rcgu.o" "-o" "/home/project/target/xtensa-esp32-none-elf/release/deps/esp_app-fa9529185948592b" "/home/project/target/xtensa-esp32-none-elf/release/deps/esp_app-fa9529185948592b.oywlhcgau5l703w.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/project/target/xtensa-esp32-none-elf/release/deps" "-L" "/home/project/target/release/deps" "-L" "/home/project/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib" "-Wl,-Bstatic" "/home/project/target/xtensa-esp32-none-elf/release/deps/libserde_json_core-ac6529134c8a6964.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libheapless-90caaa3eb4e8d68b.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libhash32-adffda0bb3bddf38.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libbyteorder-efe31f4b0b5faffb.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libas_slice-b9d238419c1919a3.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libstable_deref_trait-79fc6aff6cfa3a58.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libgeneric_array-98a0be9688534657.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libgeneric_array-c8805399998d229e.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libserde-be1113215fc334c3.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libgeneric_array-8d0cffa36f680d32.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libtypenum-fbd4607fe34cba95.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libesp_idf_alloc-ffb6fcccc3b11759.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libesp32_sys-196e2fe4b1a51441.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libcstr_core-083c526ea6aa5d8d.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libmemchr-d5a57d4c8d7a7c68.rlib" "/home/project/target/xtensa-esp32-none-elf/release/deps/libcty-43e11738a1a7ec41.rlib" "/home/project/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/liballoc-062ea13f6490a225.rlib" "/home/project/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/librustc_std_workspace_core-8ea3a6513b6bace6.rlib" "/home/project/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/libcore-2af382d919dfc800.rlib" "/home/project/target/sysroot/lib/rustlib/xtensa-esp32-none-elf/lib/libcompiler_builtins-2aefa22c95b0ff87.rlib" "-nostdlib" "-ucall_user_start_cpu0" "-u__cxa_guard_dummy" "-u__cxx_fatal_exception" "-uld_include_panic_highint_hdl" "-uesp_app_desc" "-Wl,--gc-sections" "-Wl,-static" "-Wl,--start-group" "-Lbuild/app_update" "-lapp_update" "-Lbuild/driver" "-ldriver" "-Lbuild/esp-tls" "-lesp-tls" "esp-idf/components/esp32/libhal.a" "-Lesp-idf/components/esp32/ld" "-Tesp32_out.ld" "-Tbuild/esp32/esp32.project.ld" "-Tesp32.rom.ld" "-Tesp32.peripherals.ld" "-Tesp32.rom.libgcc.ld" "-Tesp32.rom.spiram_incompatible_fns.ld" "-Lbuild/esp_ringbuf" "-lesp_ringbuf" "-Lbuild/esp_event" "-lesp_event" "-Lbuild/efuse" "-lefuse" "-Lbuild/freertos" "-lfreertos" "-Wl,--undefined=uxTopUsedPriority" "-Lbuild/heap" "-lheap" "-Lbuild/log" "-llog" "esp-idf/components/newlib/lib/libc.a" "esp-idf/components/newlib/lib/libm.a" "-Lbuild/newlib" "-lnewlib" "-Lbuild/pthread" "-lpthread" "-Lbuild/soc" "-lsoc" "-Lbuild/spi_flash" "-lspi_flash" "-Lbuild/vfs" "-lvfs" "-Lbuild/esp_http_client" "-lesp_http_client" "-Lbuild/esp-tls" "-lesp-tls" "-Lbuild/mbedtls" "-lmbedtls" "-Lbuild/tcp_transport" "-ltcp_transport" "-Lbuild/lwip" "-llwip" "-Lbuild/nghttp" "-lnghttp" "-Lbuild/wpa_supplicant" "-lwpa_supplicant" "-Lbuild/nvs_flash" "-lnvs_flash" "-Lbuild/tcpip_adapter" "-ltcpip_adapter" "-Lbuild/tcp_transport" "-ltcp_transport" "-Lbuild/wifi_provisioning" "-lwifi_provisioning" "-Lbuild/xtensa-debug-module" "-lxtensa-debug-module" "-Lbuild/smartconfig_ack" "-lsmartconfig_ack" "-Lbuild/esp32" "-lesp32" "-Lesp-idf/components/esp32/lib" "-lcore" "-lphy" "-lnet80211" "-lwps" "-lwpa" "-lwpa2" "-lpp" "-lcoexist" "-lrtc" "-lsmartconfig" "-lgcc" "-lstdc++" "-lgcov" "-Wl,--end-group" "-Wl,-EL" "-Wl,-Bdynamic"
  = note: xtensa-esp32-elf-gcc: error: esp-idf/components/esp32/libhal.a: No such file or directory
          xtensa-esp32-elf-gcc: error: esp-idf/components/newlib/lib/libc.a: No such file or directory
          xtensa-esp32-elf-gcc: error: esp-idf/components/newlib/lib/libm.a: No such file or directory

error: aborting due to previous error

error: Could not compile `esp-app`.

To learn more, run the command again with --verbose.

Thanks you for your help. ESP32 with Rust-lang is not really straight-forward for the moment (a little bit of hack).

ctron commented 4 years ago

I think you didn't build the esp stuff yet. Normally you do a make -j app before. Take a look at the main build script: https://github.com/ctron/rust-esp-container/blob/master/build-project