error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets
--> src/lib.rs:267:9
|
267 | / compile_error!("\
268 | | target is not supported, for more information see: \
269 | | https://docs.rs/getrandom/#unsupported-targets\
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` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
What target are you building for? Your target might be the default target (run rustup default to see the default target) or defined in your Cargo configuration file or you pass it directly, i.e. by running cargo build --target=.... It is definitely a target that is not supported by getrandom. There might be workarounds to get getrandom to compile for your target though, see the link from my previous post.
Can you tell us the exact command you are running in the terminal when you get the error? We can't help you if we can't know how you tried to build it.
That's BPF as far as I can tell (never done anything related to blockchain). So bpfel-unknown-none is the exact target, as far as I can judge from this line in an example from the anchor repo. genrandom does not support that target, and there is also no fallback. So you need to use a different library, one that does support the BPF target.