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
disclaimer im a noob so pls bear with me. anyway, when i run cargo build my program compiles successfully but when i run anchor build i get this error output.
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...`.
according to the documentation of solana (this section corresponds to my error) https://solana.com/docs/programs/lang-rust#depending-on-rand. “Programs are constrained to run deterministically, so random numbers are not available. Sometimes a program may depend on a crate that depends itself on rand even if the program does not use any of the random number functionality. If a program depends on rand, the compilation will fail because there is no get-random support for Solana. “
and it said to add this to the program cargo.toml: getrandom = { version = "0.1.14", features = ["dummy"] }.
and getrandom = { version = "0.2.2", features = ["custom"] }.
i tried it and it did not work
givens
i dont have getrandom as a direct dependency for my program though i have rand 0.8.5 which doesnt pull in getrandom (but rand 0.7.3 does…which i have as a transitive dependency)
my program seems to be pulling in getrandom 0.1.16 and 0.2.15
i found that getrandom 0.2.15 is a required dependency of ahash 0.7.8. ahash 0.7.8 is an optional dependency for hashbrown 0.11.2. i tried disabling default features for hashbrown 0.11.2. it did not get rid of ahash 0.7.8
if you solve it drop your sol address and ill send you 20 bucks. appreciate the help!
The text was updated successfully, but these errors were encountered:
disclaimer im a noob so pls bear with me. anyway, when i run cargo build my program compiles successfully but when i run anchor build i get this error output.
according to the documentation of solana (this section corresponds to my error) https://solana.com/docs/programs/lang-rust#depending-on-rand. “Programs are constrained to run deterministically, so random numbers are not available. Sometimes a program may depend on a crate that depends itself on rand even if the program does not use any of the random number functionality. If a program depends on rand, the compilation will fail because there is no get-random support for Solana. “
and it said to add this to the program cargo.toml:
getrandom = { version = "0.1.14", features = ["dummy"] }
.and
getrandom = { version = "0.2.2", features = ["custom"] }
.i tried it and it did not work
givens
if you solve it drop your sol address and ill send you 20 bucks. appreciate the help!
The text was updated successfully, but these errors were encountered: