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

Error with compilling on "anchor test" #5

Open
t3dkich opened this issue Feb 13, 2024 · 2 comments
Open

Error with compilling on "anchor test" #5

t3dkich opened this issue Feb 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@t3dkich
Copy link

t3dkich commented Feb 13, 2024

Hi there, I'm trying to run and test the project but on "anchor test" receive to following error:

image

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...

Steps to reproduce:

  • clone repository
  • yarn install
  • anchor test

Versions
Yarn: 1.22.19
Anchor: tried on 0.21.0 and 0.29.0
Node: v16.20.2

Environment:
WSL Ubuntu-20.04

@t3dkich t3dkich changed the title Error with compiling on "anchor test" Error with compilling on "anchor test" Feb 13, 2024
@GuidoDipietro
Copy link
Owner

Hello! Can't reproduce your error using same Yarn version and Anchor CLI 0.29.0.

Please check that your Solana versions are also updated (I'm using 1.16.12). Here's a perhaps related issue on Solana stack exchange in case it might help.

Some users have solved this by importing a specific version of getrandom. In case you manage to solve the build for your system please let me know which version works.

@t3dkich
Copy link
Author

t3dkich commented Feb 14, 2024

Ok, thank you for the fast reply. I will do some more digging to find the issue and if I do - will let you know.

@GuidoDipietro GuidoDipietro added the bug Something isn't working label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants