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 --idl fails with Solana 1.17 and Anchor 0.30 #2984

Open
lorisleiva opened this issue May 24, 2024 · 10 comments
Open

anchor build --idl fails with Solana 1.17 and Anchor 0.30 #2984

lorisleiva opened this issue May 24, 2024 · 10 comments
Labels
cli compile error Issues related to compile errors idl related to the IDL, either program or client side

Comments

@lorisleiva
Copy link
Contributor

lorisleiva commented May 24, 2024

Hi there,

Anchor 0.30.0 doesn't seem to be compatible with Solana 1.17 anymore.

Steps to reproduce

  1. Use Solana 1.17.34. (sh -c "$(curl -sSfL https://release.solana.com/v1.17.34/install)").
  2. Use Anchor 0.30.0. (avm install latest).
  3. Run anchor init my-project and cd into it.
  4. Add solana-program = "=1.17.34" to your program dependencies.
  5. Run anchor build. The first build works but the second (for the IDL) fails with the following error:
error[E0635]: unknown feature `stdsimd`
  --> /Users/loris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.8.5/src/lib.rs:99:42
   |
99 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]

Potential reason

Having seen this PR (#2893), my guess is that, unpinning the nightly version made it work for 1.18 but broke it for 1.17.

@acheroncrypto acheroncrypto added cli idl related to the IDL, either program or client side compile error Issues related to compile errors labels May 24, 2024
@acheroncrypto
Copy link
Collaborator

Solana CLI version is irrelevant to the IDL build process. What is your Rust version?

@lorisleiva
Copy link
Contributor Author

1.75.0

@acheroncrypto
Copy link
Collaborator

Do you still have the error if you update Rust with rustup update?

@lorisleiva
Copy link
Contributor Author

Unfortunately yes, I get the same error with Rust 1.78.0.

CleanShot 2024-05-27 at 09 44 42@2x

@acheroncrypto
Copy link
Collaborator

Solana 1.17 crates have ahash version pinned:

https://github.com/anza-xyz/agave/blob/4a70bc1e00c572857546d44f059b8b6406539587/Cargo.toml#L135

and combined with tkaitchuck/aHash#200, the crates don't get built with the nightly compiler.

I've created an issue in the Agave repo anza-xyz/agave#1572 describing the problem, and included a fix in anza-xyz/agave#1573.

@nabeel99
Copy link
Contributor

nabeel99 commented Jun 4, 2024

is there any work around this to build the idl ?

@Burning-Tiger
Copy link

cargo update --package ahash did it for me.

@acheroncrypto
Copy link
Collaborator

is there any work around this to build the idl ?

@nabeel99 You can use solana-program 1.18 which doesn't have this problem.

@nabeel99
Copy link
Contributor

nabeel99 commented Jun 4, 2024

is there any work around this to build the idl ?

@nabeel99 You can use solana-program 1.18 which doesn't have this problem.

I was integrating the mpl-core crate which use 1.17, as you pointed out ahash js pinned in 1.17.

@acheroncrypto
Copy link
Collaborator

I was integrating the mpl-core crate which use 1.17, as you pointed out ahash js pinned in 1.17.

Looks like there isn't going to be another v1.17 release (anza-xyz/agave#1573 (comment)).

You can, however, apply this patch to your root Cargo.toml:

[patch.crates-io]
solana-program = { git = "https://github.com/acheroncrypto/solana", branch = "v1.17-unpin-ahash-version" }

If you have an existing lock file, you might also need to run:

cargo update -p [email protected] --precise 0.8.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli compile error Issues related to compile errors idl related to the IDL, either program or client side
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants