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

library dependency of solana-frozen-abi 1.17.13 breaks build-sbf #34609

Open
marshallr12 opened this issue Dec 31, 2023 · 8 comments · Fixed by me-foundation/mmm#79
Open

library dependency of solana-frozen-abi 1.17.13 breaks build-sbf #34609

marshallr12 opened this issue Dec 31, 2023 · 8 comments · Fixed by me-foundation/mmm#79
Labels
community Community contribution

Comments

@marshallr12
Copy link

marshallr12 commented Dec 31, 2023

Problem

ahash v0.8.7 uses an unstable feature which breaks cargo build-sbf on Solana v1.17.13. ahash is a dependency of solana-frozen-abi.

/rust on development via v1.75.0 
🕙20:04❯ cargo build-sbf
   Compiling serde_derive v1.0.193
   Compiling cc v1.0.83
   Compiling thiserror v1.0.53
   Compiling ahash v0.7.7
   Compiling ahash v0.8.7
   Compiling num-traits v0.2.17
error[E0658]: use of unstable library feature 'build_hasher_simple_hash_one'
   --> src/random_state.rs:463:5
    |
463 | /     fn hash_one<T: Hash>(&self, x: T) -> u64 {
464 | |         RandomState::hash_one(self, x)
465 | |     }
    | |_____^
    |
    = note: see issue #86161 <https://github.com/rust-lang/rust/issues/86161> for more information
    = help: add `#![feature(build_hasher_simple_hash_one)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0658`.

Proposed Solution

Not sure. Maybe ahash needs to be fixed by adding the crate attribute.

@marshallr12 marshallr12 added the community Community contribution label Dec 31, 2023
@nilpferdschaefer
Copy link

I'm hitting the same issue (OSX)

# solana --version
solana-cli 1.17.13 (src:ef1fb9ec; feat:4006346914, client:SolanaLabs)

cargo build-sbf                      
   Compiling ahash v0.8.7
error[E0658]: use of unstable library feature 'build_hasher_simple_hash_one'
   --> src/random_state.rs:463:5
    |
463 | /     fn hash_one<T: Hash>(&self, x: T) -> u64 {
464 | |         RandomState::hash_one(self, x)
465 | |     }
    | |_____^
    |

@acheroncrypto
Copy link
Contributor

The easiest way to fix this problem is to add:

ahash = "=0.8.6"

to your dependency list in Cargo.toml

or run:

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

More details in: https://solana.stackexchange.com/a/8805

@marshallr12
Copy link
Author

marshallr12 commented Dec 31, 2023

Neither of those solutions worked for me with Rust 1.75.0 .

@acheroncrypto
Copy link
Contributor

What do you get if you run cargo tree -i ahash?

Also, your Rust version is irrelevant because rustc in cargo-build-sbf is coming from Solana's fork (#31428).

@marshallr12
Copy link
Author

After running cargo tree and getting 0.8.7, I realized I made a mistake and added ahash="=0.8.6" to my workspace Cargo.toml dependencies instead of my solana program's Cargo.toml. After I fixed that, I got things to compile correctly.

Also, your Rust version is irrelevant because rustc in cargo-build-sbf is coming from Solana's fork (#31428).

Well, that makes sense since cargo build worked fine. Thanks for your help!

@acheroncrypto
Copy link
Contributor

Looks like this got fixed in #34636 and #34650 so this issue can be closed.

@bhutta03
Copy link

The easiest way to fix this problem is to add:

ahash = "=0.8.6"

to your dependency list in Cargo.toml

or run:

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

More details in: https://solana.stackexchange.com/a/8805

@bhutta03
Copy link

nicely done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants