You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 19, 2026. It is now read-only.
When I start a new project based on the RISCV/nightly rust toolchain, I get an error about a missing symbol from libc in the build of std (exact message below). I think the origin of this is rust-lang/rust@9c46cdb, which introduced the use of O_NOFOLLOW in std. A workaround that fixes it is to use nightly-2025-08-19 as the toolchain, which is the last one before the offending commit was merged.
The catch is: I don't really understand why this is failing, which is why I'm reporting it here instead of upstream. It still might be an upstream bug of course, but if I make a non-esp-idf-sys-based project everything works fine even on the latest nightly. That said, I really don't understand the std-building process well enough to know for sure how widespread this problem. Happy to try some more troubleshooting if someone offers guidance, though.
exact error message
error[E0425]: cannot find value `O_NOFOLLOW` in crate `libc`
--> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/fs/mod.rs:122:43
|
122 | OpenOptions::new().custom_flags(libc::O_NOFOLLOW).open(path)?.set_permissions(perm)
| ^^^^^^^^^^ not found in `libc`
For more information about this error, try `rustc --explain E0425`.
Would you like to work on a fix? maybe
To Reproduce
use the esp-idf-template to make a esp-idf-sys/std-based esp crate
set everything up following the default instructions in the rust on esp book (I used the devcontainer, but I got identical results on a system set up similarly)
run cargo check
Expected behavior
The build should succeed
Environment
Crate (esp-idf-sys) version: master
ESP-IDF branch or tag: 5.3
Target device (MCU): esp32c6 or probably anything RISCV that uses nightly
Bug description
When I start a new project based on the RISCV/nightly rust toolchain, I get an error about a missing symbol from
libcin the build ofstd(exact message below). I think the origin of this is rust-lang/rust@9c46cdb, which introduced the use ofO_NOFOLLOWinstd. A workaround that fixes it is to use nightly-2025-08-19 as the toolchain, which is the last one before the offending commit was merged.The catch is: I don't really understand why this is failing, which is why I'm reporting it here instead of upstream. It still might be an upstream bug of course, but if I make a non-esp-idf-sys-based project everything works fine even on the latest nightly. That said, I really don't understand the std-building process well enough to know for sure how widespread this problem. Happy to try some more troubleshooting if someone offers guidance, though.
exact error message
To Reproduce
cargo checkExpected behavior
The build should succeed
Environment
esp-idf-sys) version: master