Failed to parse manifest

Hi!
Do somebody know if this is something I can fix or is the problem located elsewhere?
Any input is appreciated! It doesn't seem to be related to

error: failed to parse manifest at /home/snkdb/rust/projects/try_lvgl-rs/Cargo.toml

Caused by:
Dependency 'lvgl' has different source paths depending on the build target. Each dependency must have a single canonical source path irrespective of build target.

Could you share the contents of that Cargo.toml?

Absolutely! From

[dev-dependencies]
lvgl = { path = "../lvgl" }
lvgl-sys = { path = "../lvgl-sys" }
embedded-graphics = "0.6"
embedded-graphics-simulator = "0.2.0"
heapless = "0.5.5"
cstr_core = { version = "0.2.0", features = ["alloc"] }

[[example]]
name = "demo"
path = "demo.rs"

[[example]]
name = "bar"
path = "bar.rs"

[[example]]
name = "button_click"
path = "button_click.rs"

[[example]]
name = "gauge"
path = "gauge.rs"

[[example]]
name = "arc"

Forgot this, added by me (from the crate)

[dependencies]
lvgl = "0.5.2"

The problem is that you have the lvgl crate listed as a dependency in two different ways: first, as

[dev-dependencies]
lvgl = { path = "../lvgl" }

and second, as

[dependencies]
lvgl = "0.5.2"

which is not allowed. Are you running this within a checkout of the lvgl-rs repository? If so, you should use the { path = "../lvgl" } form under [dependencies] as well. If you're not running in a checkout of that repo then you shouldn't be copying the project's Cargo.toml in the first place.

1 Like

Aha! I'm a newbie, that might explain it. Thank you very much!
/p

Could you describe how you created the Cargo project where this error is occuring? (e.g. running cargo new or git clone https://github.com/rafaelcaricio/lvgl-rs or something else.) I think I don't fully understand the context and I might be giving you less-than-helpful advice as a result...

cargo new,
added
[dependencies]
lvgl = "0.5.2,
got a lot of errors about unresolved bits &pieces,
thought they were accessible in the Cargo.toml on the site from where it came,
added everything from [dev-dependencies] and below from it

1 Like

Got it—yeah, copying the [dev-dependencies] from the Cargo.toml in that repo is probably not the way to fix your issues. If you share the build errors you mentioned:

we can help you find a solution!

With my Cargo.toml looking like:
[package]
name = "try_lvgl-rs"
version = "0.1.0"
authors = ["snkdb"]
edition = "2018"

[dependencies]
lvgl = "0.5.2"

...I got an error like this. I ought to try to take care of it before engaging ppl around me.
Perhaps I should put some more of my own work into it first?

thread 'main' panicked at The environment variable DEP_LV_CONFIG_PATH is required to be defined'

1 Like

The lvgl-rs README says:

The build requires the environment variable bellow to be set:

  • DEP_LV_CONFIG_PATH : Path to the directory containing the lv_conf.h header file used for configuration of LittlevGL library.

We recommend the lv_conf.h file to be in your project's root directory. If so, the command to build your project would be:

$ DEP_LV_CONFIG_PATH=`pwd` cargo build

The repository also has an example lv_conf.h file, albeit a bit hidden away:

Don't worry about it, we're all here to help :‌)

"The lvgl-rs README says:" I really should have tried some more, but honestly I didn't get this error until just now. Errors earlier was in red. Let's not delve into why :0)

Bowing deeply!
Then $ DEP_LV_CONFIG_PATH will be the next thing tomorrow. Time runs fast here.
Thanks again!
/p

1 Like