solana-labs / solana-program-library

A collection of Solana programs maintained by Solana Labs
https://solanalabs.com
Apache License 2.0
3.56k stars 2.08k forks source link

Error building pl-token-2022 into a project #7479

Open GaloisField2718 opened 6 days ago

GaloisField2718 commented 6 days ago

Hi, My Cargo.toml is as follow:

   [package]
  1 name = "eclipse_token_project"
  2 version = "0.1.0"
  3 edition = "2021"
  4 
  5 [dependencies]
  6 solana-sdk = "1.10"            
  7 mpl-token-metadata = "1.2"  
  8 solana-client = "1.10"
  9 spl-token = "3.3"

When I run it (cargo run) I reach:

error[E0277]: can't compare `solana_program::pubkey::Pubkey` with `spl_memo::solana_program::pubkey::Pubkey`
 ....
...
error: could not compile `spl-token-2022` (lib) due to 4 previous errors
buffalojoec commented 5 days ago

It looks like those versions of mpl-token-metadata and spl-token depend on a solana-program version of at least 1.9, however that version of solana-client has solana-sdk pinned at 1.10.0. https://crates.io/crates/solana-client/1.10.0/dependencies

solana-client also depends on spl-token fixed at 3.2. https://crates.io/crates/solana-account-decoder/1.10.0/dependencies

I wonder if you are pulling in two versions of spl-token, and thus two versions of solana-program? Check your lockfile.

I think you should be able to fix this by changing spl-token to 3.2.