Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust std build failed #351

Closed
yhw2003 opened this issue Nov 15, 2024 · 1 comment
Closed

rust std build failed #351

yhw2003 opened this issue Nov 15, 2024 · 1 comment

Comments

@yhw2003
Copy link

yhw2003 commented Nov 15, 2024

I use esp-rs/esp-idf-template to create the project.
MCU: esp32c6
log:

error[E0425]: cannot find value `LOCK_EX` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1258:58
     |
1258 |         cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_EX) })?;
     |                                                          ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `LOCK_SH` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1263:58
     |
1263 |         cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_SH) })?;
     |                                                          ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `LOCK_EX` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1268:71
     |
1268 |         let result = cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) });
     |                                                                       ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `LOCK_NB` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1268:87
     |
1268 |         let result = cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) });
     |                                                                                       ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `LOCK_SH` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1279:71
     |
1279 |         let result = cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_SH | libc::LOCK_NB) });
     |                                                                       ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `LOCK_NB` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1279:87
     |
1279 |         let result = cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_SH | libc::LOCK_NB) });
     |                                                                                       ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `LOCK_UN` in crate `libc`
    --> /home/esp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1290:58
     |
1290 |         cvt(unsafe { libc::flock(self.as_raw_fd(), libc::LOCK_UN) })?;
     |                                                          ^^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `std` (lib) due to 7 previous errors
@ivmarkov
Copy link
Collaborator

This is because of this issue.
Use a slightly older nightly compiler or the esp toolchain, as described in the esp-idf-template README.

The PR in Rust STD that fixes the problem got merged today, so tomorrow's Rust nightly will have the problem fixed.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants