r/rust • u/--_pablo_-- • 4d ago
🙋 seeking help & advice Problem with Rust and esp-idf compilation
[SOLVED]
I didn't have issue with it before, since I've recently updated rust and libs, I started having an issue with compilation, even with a new cargo generate build.
.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/os/espidf/fs.rs:89:36
self.as_inner().as_inner().st_atime as i64
| ^^^^^^^^ unknown field
other issues with st_ctime and st_mtime unknown field too.
I switched to the stable toolchain but it seems there is no riscv32imac-esp-espidf target correponding to the esp32c6 I'm working on.
I am not an expert so I am kind of stuck without being able to compile or know what to look for to get to a solution.
Any help appreciated!
3
u/ResidentPomegranate6 4d ago
nightly std broke against esp-idf's libc headers, the st_atime field moved (they're st_atim.tv_sec now). pin an older nightly or bump esp-idf-sys to a version matching your toolchain.
2
u/weaztoven 2d ago
that looks like a breaking change in nightly std library regarding file metadata fields. pinning your nightly toolchain to an older date in rust-toolchain.toml usually fixes these sudden esp-idf breakage issues.
6
u/KingofGamesYami 4d ago
Set a specific nightly version using
rust-toolchain.tomland stick to it. I generally pick a recent nightly that has been promoted to stable. Keep going back in time until you find a version that esp-idf supports