Issues trying to run cargo-build-sbf

has any one solved this problem or knows how to solve it

Blockquote
$ cargo-build-sbf
info: uninstalling toolchain 'sbf'
info: toolchain 'sbf' uninstalled
error: target is not supported, for more information see: getrandom - Rust
--> src\lib.rs:267:9
|
267 | / compile_error!("
268 | | target is not supported, for more information see:
269 | | getrandom - Rust
270 | | ");
| |__________^
error[E0433]: failed to resolve: use of undeclared crate or module imp
--> src\lib.rs:291:5
|
291 | imp::getrandom_inner(dest)
| ^^^ use of undeclared crate or module imp
For more information about this error, try rustc --explain E0433.
error: could not compile getrandom due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

1 Like

You are trying to build for solana, right? AFAIK solana doesn't support getting any source of randomness. Is it possible for you to rewrite your program to not depend on rand or any other crate depending on getrandom?

3 Likes