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

anchor build: getrandom target not supported #2523

Closed
ShaunSHamilton opened this issue Jun 7, 2023 · 4 comments
Closed

anchor build: getrandom target not supported #2523

ShaunSHamilton opened this issue Jun 7, 2023 · 4 comments
Labels
compile error Issues related to compile errors

Comments

@ShaunSHamilton
Copy link

Error

anchor test
error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets
   --> src/lib.rs:290:9
    |
290 | /         compile_error!("target is not supported, for more information see: \
291 | |                         https://docs.rs/getrandom/#unsupported-targets");
    | |________________________________________________________________________^

error[E0433]: failed to resolve: use of undeclared crate or module `imp`
   --> src/lib.rs:341:9
    |
341 |         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...

OS

cat /etc/os-release
root $ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

anchor --version: anchor-cli 0.27.0
solana --version: solana-cli 1.16.0 (src:e0fcdbb0; feat:2891131721, client:SolanaLabs)1
rustc --version: rustc 1.70.0 (90c541806 2023-05-31)

I am not sure if this is an issue with my setup, but my setup has not changed recently (Docker container on the same machine as what previously worked), and this is a brand new anchor project. All, I have is what comes with:

anchor init --no-git <project>

anchor keys list works.

Footnotes

  1. Also tried stable with the same result

@acheroncrypto
Copy link
Collaborator

This is an issue with the latest Solana 1.16.0 release.

Either specify 1.14.17 like in #2511 (comment) or you can also use the latest git version:

anchor-lang = { git = "https://github.com/coral-xyz/anchor" }
anchor-spl = { git = "https://github.com/coral-xyz/anchor" }

@ShaunSHamilton
Copy link
Author

This is an issue with the latest Solana 1.16.0 release.

Also tried stable with the same result

@beeman
Copy link

beeman commented Jun 8, 2023

I ran into this same error and found the fix here in the Anchor Discord.

@acheroncrypto acheroncrypto added the compile error Issues related to compile errors label Jun 12, 2023
@acheroncrypto
Copy link
Collaborator

This is fixed in 0.28.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile error Issues related to compile errors
Projects
None yet
Development

No branches or pull requests

3 participants