georgik / esp32-spooky-maze-game

Rust Bare Metal implementation of maze game for ESP32
MIT License
32 stars 7 forks source link

_SC_GETPW_R_SIZE_MAX - not found in `libc` | esp32-2432s028r #64

Closed ds2k5 closed 11 months ago

ds2k5 commented 1 year ago

Hello, what did I wrong ? Wanna build for a: esp32-2432s028r ( Chip is ESP32-D0WD-V3 (revision v3.1) ) Using Debian 12 (x86_64)

$ cargo generate --git https://github.com/esp-rs/esp-idf-template cargo ( choose esp32 ) $ . ~/export-esp.sh $ use the the file from: https://github.com/georgik/esp32-spooky-maze-game/blob/main/esp32-s2-kaluga/src/main.rs $ cargo check


error[E0425]: cannot find value `_SC_GETPW_R_SIZE_MAX` in crate `libc`
  --> /home/developer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dirs-1.0.5/src/unix.rs:27:45
   |
27 |         let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {
   |                                             ^^^^^^^^^^^^^^^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `dirs` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error[E0609]: no field `tm_gmtoff` on type `tm`
   --> /home/developer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.1.45/src/sys.rs:392:30
    |
392 |             let gmtoff = out.tm_gmtoff;
    |                              ^^^^^^^^^ unknown field
    |
    = note: available fields are: `tm_sec`, `tm_min`, `tm_hour`, `tm_mday`, `tm_mon` ... and 4 others

For more information about this error, try `rustc --explain E0609`.
error: could not compile `time` (lib) due to previous error

Cargo.toml


[package]
name = "esp32display"
version = "0.1.0"
authors = ["developer"]
edition = "2021"
resolver = "2"
rust-version = "1.71"

[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]
default = ["std", "embassy", "esp-idf-svc/native"]

pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
alloc = ["esp-idf-svc/alloc"]
nightly = ["esp-idf-svc/nightly"]
experimental = ["esp-idf-svc/experimental"]
embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"]

[dependencies]
log = { version = "0.4", default-features = false }
esp-idf-svc = { version = "0.47.1", default-features = false }
app = "0.6.5"

[build-dependencies]
embuild = "0.31.3"
georgik commented 1 year ago

Hi @ds2k5 . Spooky is buildable as Bare metal, just enter the directory with Kaluga and use cargo build --release. Details: https://github.com/georgik/esp32-spooky-maze-game#build-for-esp32-s2-kaluga-v13

From the Cargo.toml, I assume that you're trying to build Rust std + code from Spooky. This is interesting combination and you'll need to modify the code to suite the std model with ESP-IDF which is produced by the template.

BTW: Bare metal template is here: https://github.com/esp-rs/esp-template

You're getting error, because compiler is trying to build target for your local computer, instead of xtensa target. You can select esp toolchain and by adding +esp parameter on command line and ideally specify --target. Other option is to include these files:

If you'd like to see mix of std and Spooky, there is experimental branch here: Where code written as ESP-IDF application using Spooky core as a component and LVGL to render the screen. Right now it has very limited functionality, but you can get idea how the integration could work: https://github.com/georgik/esp32-spooky-maze-game/tree/feature/esp32-s3-lcd-ev-board Folder: esp32-s3-lcd-ev-board.

georgik commented 11 months ago

No response, closing the issue. Feel free to reopen with more data.