Comments (9)
What target are you compiling your project for? As I wrote in my previous comment, the ESP IDF backend will work only for *-espidf
targets.
Since it looks like you are only starting with ESP, I strongly suggest asking help in the esp-rs Matrix server.
For my understanding so far for the no_std environments makes no point using the getrandom library since we have no advantage using it, right?
Depends on whether a dependency in your project uses getrandom
or not. If you don't have such dependencies, then you can skip it.
from getrandom.
As explicitly written in the docs, rdrand
has effect only on x86 and x86-64 targets.
For WASM targets you either have to use the js
feature (and thus depend on wasm-bindgen
), or introduce your own custom backend.
from getrandom.
ESP32 systems do not use x86 CPUs and WASM even less relevant. If you are just starting with embedded programming, it may be easier for you to start with ESP IDF, getrandom
supports *-espidf
targets out of box. If you want to target *-none-elf
targets, then you have to write your own custom backend based on the HAL.
from getrandom.
Our target is "riscv32imac-esp-espidf".
Weird. As you can see here compiling for this target should enable backend which uses esp_fill_random
.
Double check that your code is indeed compiled for this target. You also could try the following code:
#[cfg(target_os = "espidf")]
compile_error!("Target OS is ESP IDF");
#[cfg(not(target_os = "espidf"))]
compile_error!("Target OS is not ESP IDF");
As you can see here, compiling this code for riscv32imac-esp-espidf
should emit the first error message.
from getrandom.
What do you get for the snippet in my previous comment?
It looks like something is wrong with your build configuration. Enabling the custom
feature should make the "target is not supported" compilation error impossible.
from getrandom.
Duh. I've missed the crucial part: the error is for getrandom v0.1
, not for v0.2. No wonders that setting features for v0.2 had no effect. The best solution would be to update (or patch) dependencies which pull v0.1 to work with v0.2.
from getrandom.
You still depend on getrandom v0.1
as can be clearly seen in the path on your last screenshot. You should find which dependency in your project pulls getrandom v0.1
and patch it to use v0.2 (you can do it by inspecting Cargo.lock
or by using cargo tree
). If getrandom v0.1
is pulled through an older version of rand
, then you should patch dependency which uses it to use rand v0.8
.
from getrandom.
Closing this issue since it is caused by getrandom v0.1
.
from getrandom.
This issue tracker is probably not the best place to discuss unrelated build issues. Those should generally be brought up on the project specific issue trackers. If there are issues related to getrandom 0.2
, feel free to open another issue.
from getrandom.
Related Issues (20)
- Broken link to sys_read_entropy HOT 4
- Don't fall back to file I/O on Linux when Rust only supports kernels guaranteed to have it HOT 5
- Potential undefined behavior in hermit implementation. HOT 3
- Cannot use synchronous feature in node 18 HOT 7
- Add support for targets without atomic operations
- Support for UEFI HOT 3
- Failed to build for wasm32-unknown-unknown with no_std HOT 1
- Is the ESPIDF implementation actually correct? HOT 3
- Spurious failures of Web tests on Windows HOT 1
- Port from libc to rustix HOT 7
- Remove file-based RNG fallback on DragonflyBSD HOT 1
- man7 link should be replaced
- The newly updated version "0.2.13" cannot run on mipsel HOT 7
- Error: target is not supported (cargo build-bpf) HOT 2
- Remove fallback logic for FreeBSD
- Investigate removing fallback logic for Solaris/Illumos HOT 1
- Windows: Switch to using ProcessPRNG by default. HOT 31
- `libc` `v0.2.154` yanked HOT 2
- Support `x86_64-unknown-linux-none` HOT 32
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getrandom.