esp-rs / esp-idf-template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.
373 stars 44 forks source link

Template under workspace #117

Closed anslex closed 1 year ago

anslex commented 1 year ago

Hello,

I am new to Rust and I would like to have a clean setup from the beginning with a workspace containing packages for desktop and esp32.

Here my root toml:

[workspace]

members = [
    "esp32-s3",
]

Here esp32-s3 toml created with esp template:

[package]
name = "esp32-s3"
version = "0.1.0"
edition = "2021"
resolver = "2"

[profile.release]
opt-level = "s"

[profile.dev]
debug = true    # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
pio = ["esp-idf-sys/pio"]

[dependencies]
esp-idf-sys = { version = "0.32.1", features = ["binstart"] }
esp-idf-hal = { version = "0.40.1"}
esp-idf-svc = { version = "0.45.0"}

[build-dependencies]
embuild = "0.31.1"

'cargo build' works in esp32-s3 package but not in the root workspace and I get:

   Compiling embuild v0.31.1
   Compiling cargo_metadata v0.15.4
   Compiling embedded-svc v0.24.0
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /Users/x/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-svc-0.24.0/src/lib.rs:2:1
  |
2 | #![feature(cfg_version)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^

Thank you !

Vollbrecht commented 1 year ago

please make sure to read https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html and understand how you can work with workspaces. also notice the extra config files we have inside the generated project that influences the usage of cargo build.

anslex commented 1 year ago

thanks!