Can't seem to compile #1

Closed
opened 2020-09-21 18:33:42 +00:00 by embeddedt · 11 comments
embeddedt commented 2020-09-21 18:33:42 +00:00 (Migrated from github.com)

Rust newbie here. 🙂

I figured out that cargo-web needs to be installed, based on the presence of Web.toml. However, when I run cargo web build, I get this error:

error: error: failed to get `lvgl` as a dependency of package `lvgl-example v0.1.0 (/tmp/lvgl-rs-wasm)`

Caused by:
  failed to load source for dependency `lvgl`

Caused by:
  Unable to update /tmp/lvgl-rs/lvgl

Caused by:
  failed to read `/tmp/lvgl-rs/lvgl/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
Rust newbie here. :slightly_smiling_face: I figured out that `cargo-web` needs to be installed, based on the presence of `Web.toml`. However, when I run `cargo web build`, I get this error: ``` error: error: failed to get `lvgl` as a dependency of package `lvgl-example v0.1.0 (/tmp/lvgl-rs-wasm)` Caused by: failed to load source for dependency `lvgl` Caused by: Unable to update /tmp/lvgl-rs/lvgl Caused by: failed to read `/tmp/lvgl-rs/lvgl/Cargo.toml` Caused by: No such file or directory (os error 2) ```
rafaelcaricio commented 2020-09-21 18:48:22 +00:00 (Migrated from github.com)

@embeddedt Hey!
Try this command:

cargo +nightly web start

I forgot to include that you need the nightly version of Rust.

Also you need to clone this version of lvgl-rs: https://github.com/rafaelcaricio/lvgl-rs/pull/31 next to this repo, because of this https://github.com/rafaelcaricio/lvgl-rs-wasm/blob/master/Cargo.toml#L15

@embeddedt Hey! Try this command: ``` cargo +nightly web start ``` I forgot to include that you need the nightly version of Rust. Also you need to clone this version of lvgl-rs: https://github.com/rafaelcaricio/lvgl-rs/pull/31 next to this repo, because of this https://github.com/rafaelcaricio/lvgl-rs-wasm/blob/master/Cargo.toml#L15
rafaelcaricio commented 2020-09-21 18:55:19 +00:00 (Migrated from github.com)

Ok, I've updated the code here to make it easier. Please follow the README to install emscripten compiler and then run:

cargo +nightly build --target=wasm32-unknown-emscripten
Ok, I've updated the code here to make it easier. Please follow the README to install emscripten compiler and then run: ``` cargo +nightly build --target=wasm32-unknown-emscripten ```
embeddedt commented 2020-09-21 19:01:21 +00:00 (Migrated from github.com)

It went further this time. I did need to run rustup target add wasm32-unknown-emscripten --toolchain nightly first.

   Compiling lvgl-sys v0.4.0 (https://github.com/rafaelcaricio/lvgl-rs.git?branch=emscripten#76d485b6)
error: failed to run custom build command for `lvgl-sys v0.4.0 (https://github.com/rafaelcaricio/lvgl-rs.git?branch=emscripten#76d485b6)`

Caused by:
  process didn't exit successfully: `/tmp/lvgl-rs-wasm/target/debug/build/lvgl-sys-4625ae5c299b8762/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'The environment variable DEP_LV_CONFIG_PATH is required to be defined', .cargo/git/checkouts/lvgl-rs-27f20f23afade818/76d485b/lvgl-sys/build.rs:16:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
It went further this time. I did need to run `rustup target add wasm32-unknown-emscripten --toolchain nightly` first. ``` Compiling lvgl-sys v0.4.0 (https://github.com/rafaelcaricio/lvgl-rs.git?branch=emscripten#76d485b6) error: failed to run custom build command for `lvgl-sys v0.4.0 (https://github.com/rafaelcaricio/lvgl-rs.git?branch=emscripten#76d485b6)` Caused by: process didn't exit successfully: `/tmp/lvgl-rs-wasm/target/debug/build/lvgl-sys-4625ae5c299b8762/build-script-build` (exit code: 101) --- stderr thread 'main' panicked at 'The environment variable DEP_LV_CONFIG_PATH is required to be defined', .cargo/git/checkouts/lvgl-rs-27f20f23afade818/76d485b/lvgl-sys/build.rs:16:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed ```
rafaelcaricio commented 2020-09-21 19:08:21 +00:00 (Migrated from github.com)

You need to set this environment variable:

The environment variable DEP_LV_CONFIG_PATH is required to be defined

For that, you can run:

export DEP_LV_CONFIG_PATH=`pwd`/include

In the /lvgl-rs-wasm project root.

You need to set this environment variable: > The environment variable DEP_LV_CONFIG_PATH is required to be defined For that, you can run: ``` export DEP_LV_CONFIG_PATH=`pwd`/include ``` In the `/lvgl-rs-wasm` project root.
embeddedt commented 2020-09-21 20:34:49 +00:00 (Migrated from github.com)

Okay; that got it even further. Now I get:

.cargo/git/checkouts/lvgl-rs-27f20f23afade818/76d485b/lvgl-sys/vendor/lvgl/src/lv_hal/../lv_misc/lv_task.h:20:10: fatal error: 'stdbool.h' file not found
.cargo/git/checkouts/lvgl-rs-27f20f23afade818/76d485b/lvgl-sys/vendor/lvgl/src/lv_hal/../lv_misc/lv_task.h:20:10: fatal error: 'stdbool.h' file not found, err: true

I've seen this error before on a non-Rust project; I often have to fight Emscripten/Clang to get standard headers to appear properly. Hopefully I can figure it out.

Okay; that got it even further. Now I get: ``` .cargo/git/checkouts/lvgl-rs-27f20f23afade818/76d485b/lvgl-sys/vendor/lvgl/src/lv_hal/../lv_misc/lv_task.h:20:10: fatal error: 'stdbool.h' file not found .cargo/git/checkouts/lvgl-rs-27f20f23afade818/76d485b/lvgl-sys/vendor/lvgl/src/lv_hal/../lv_misc/lv_task.h:20:10: fatal error: 'stdbool.h' file not found, err: true ``` I've seen this error before on a non-Rust project; I often have to fight Emscripten/Clang to get standard headers to appear properly. Hopefully I can figure it out.
rafaelcaricio commented 2020-09-22 08:30:01 +00:00 (Migrated from github.com)

Hey @embeddedt ! Please pull the latest version and try again. I have updated the README with more instructions, may be easier now.

Could you please share what commands you're running to get this error?

Hey @embeddedt ! Please pull the latest version and try again. I have updated the README with more instructions, may be easier now. Could you please share what commands you're running to get this error?
embeddedt commented 2020-09-22 11:50:56 +00:00 (Migrated from github.com)

Unfortunately, it still doesn't work with the latest version. These are the commands I ran:

source <path to emsdk>/emsdk_env.sh
make web # failed because I forgot to set `DEP_LV_CONFIG_PATH`
export DEP_LV_CONFIG_PATH=`pwd`/include
make web

I get the same error as my last post.

When I was working on the Emscripten port of MicroPython, I ran into issues with needing to install Emscripten's Clang package as well. Newer Emscripten versions seemed to give me more trouble (I ended up sticking with a 1.38 version). Do you know what Emscripten version you have installed?

Unfortunately, it still doesn't work with the latest version. These are the commands I ran: ``` source <path to emsdk>/emsdk_env.sh make web # failed because I forgot to set `DEP_LV_CONFIG_PATH` export DEP_LV_CONFIG_PATH=`pwd`/include make web ``` I get the same error as my last post. When I was working on the Emscripten port of MicroPython, I ran into issues with needing to install Emscripten's Clang package as well. Newer Emscripten versions seemed to give me more trouble (I ended up sticking with a 1.38 version). Do you know what Emscripten version you have installed?
rafaelcaricio commented 2020-09-22 12:01:24 +00:00 (Migrated from github.com)
❯ emcc --version
emcc (Emscripten gcc/clang-like replacement) 2.0.4 (3047b77ed244ea8f3cb3ee7b18c0f89079ae6554)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
``` ❯ emcc --version emcc (Emscripten gcc/clang-like replacement) 2.0.4 (3047b77ed244ea8f3cb3ee7b18c0f89079ae6554) Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt) This is free and open source software under the MIT license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
embeddedt commented 2020-09-22 12:02:17 +00:00 (Migrated from github.com)

I'll give that version a try.

I'll give that version a try.
embeddedt commented 2020-09-22 12:29:28 +00:00 (Migrated from github.com)

Alright; it works with Emscripten 2.0.4. That was the problem.

Alright; it works with Emscripten 2.0.4. That was the problem.
rafaelcaricio commented 2020-09-22 13:09:17 +00:00 (Migrated from github.com)

Awesome! 🥳

Awesome! 🥳
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: rafaelcaricio/lvgl-rs-wasm#1
No description provided.