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

Install spl-token-cli v4.0.0 failed #7043

Closed
nealsun opened this issue Jul 23, 2024 · 7 comments · Fixed by #7084 or #7085
Closed

Install spl-token-cli v4.0.0 failed #7043

nealsun opened this issue Jul 23, 2024 · 7 comments · Fixed by #7084 or #7085

Comments

@nealsun
Copy link

nealsun commented Jul 23, 2024

I'm using cargo install spl-token-cli to install token-cli, but I got error below

Compiling spl-type-length-value v0.4.5
error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
  --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:67:99
   |
39 | ) -> Result<TlvIndices, ProgramError> {
   |      -------------------------------- expected `solana_program::program_error::ProgramError` because of this
...
67 |             pod_from_bytes::<Length>(&tlv_data[tlv_indices.length_start..tlv_indices.value_start])?;
   |             --------------------------------------------------------------------------------------^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<TlvIndices, solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
   |             |
   |             this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From<T>`:
             <solana_program::program_error::ProgramError as From<TlvError>>
             <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
             <solana_program::program_error::ProgramError as From<std::io::Error>>
             <solana_program::program_error::ProgramError as From<u64>>
   = note: required for `Result<TlvIndices, solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:109:14
    |
80  |   ) -> Result<(Vec<ArrayDiscriminator>, usize), ProgramError> {
    |        ------------------------------------------------------ expected `solana_program::program_error::ProgramError` because of this
...
107 |               let length = pod_from_bytes::<Length>(
    |  __________________________-
108 | |                 &tlv_data[tlv_indices.length_start..tlv_indices.value_start],
109 | |             )?;
    | |             -^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(Vec<ArrayDiscriminator>, usize), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    | |_____________|
    |               this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(Vec<ArrayDiscriminator>, usize), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:141:80
    |
127 | ) -> Result<&[u8], ProgramError> {
    |      --------------------------- expected `solana_program::program_error::ProgramError` because of this
...
141 |     let length = pod_from_bytes::<Length>(&tlv_data[length_start..value_start])?;
    |                  --------------------------------------------------------------^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<&[u8], solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |                  |
    |                  this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<&[u8], solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0308]: mismatched types
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:216:9
    |
214 |     ) -> Result<&V, ProgramError> {
    |          ------------------------ expected `Result<&V, solana_program::program_error::ProgramError>` because of return type
215 |         let data = get_bytes::<V>(self.get_data(), repetition_number)?;
216 |         pod_from_bytes::<V>(data)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ProgramError`, found a different `ProgramError`
    |
    = note: `ProgramError` and `ProgramError` have similar names, but are actually distinct types
note: `ProgramError` is defined in crate `solana_program`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-2.0.1/src/program_error.rs:15:1
    |
15  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
note: `ProgramError` is defined in crate `solana_program`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-1.18.19/src/program_error.rs:14:1
    |
14  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `solana_program` are being used?

error[E0308]: mismatched types
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:333:9
    |
331 |     ) -> Result<&mut V, ProgramError> {
    |          ---------------------------- expected `Result<&mut V, solana_program::program_error::ProgramError>` because of return type
332 |         let data = self.get_bytes_with_repetition_mut::<V>(repetition_number)?;
333 |         pod_from_bytes_mut::<V>(data)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ProgramError`, found a different `ProgramError`
    |
    = note: `ProgramError` and `ProgramError` have similar names, but are actually distinct types
note: `ProgramError` is defined in crate `solana_program`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-2.0.1/src/program_error.rs:15:1
    |
15  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
note: `ProgramError` is defined in crate `solana_program`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-1.18.19/src/program_error.rs:14:1
    |
14  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `solana_program` are being used?

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:362:85
    |
362 |         let length = pod_from_bytes::<Length>(&self.data[length_start..value_start])?;
    |                                                                                     ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<&mut [u8], solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<&mut [u8], solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:387:60
    |
387 |         let extension_ref = pod_from_bytes_mut::<V>(buffer)?;
    |                                                            ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(&mut V, usize), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(&mut V, usize), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:439:88
    |
439 |                 pod_from_bytes_mut::<Length>(&mut self.data[length_start..value_start])?;
    |                                                                                        ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(&mut [u8], usize), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(&mut [u8], usize), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:490:97
    |
490 |         let length_ref = pod_from_bytes_mut::<Length>(&mut self.data[length_start..value_start])?;
    |                                                                                                 ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<&mut [u8], solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<&mut [u8], solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /Users/aaron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:556:84
    |
547 | ) -> Result<(), ProgramError> {
    |      ------------------------ expected `solana_program::program_error::ProgramError` because of this
...
556 |         usize::try_from(*pod_from_bytes::<Length>(&data[length_start..value_start])?)?
    |                          ----------------------------------------------------------^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |                          |
    |                          this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `spl-type-length-value` (lib) due to 10 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `spl-token-cli v4.0.0`, intermediate artifacts can be found at `/var/folders/_r/hsj6gn5n0fvfzrxs0sw6p4f00000gn/T/cargo-installFvUmY8`.

how to fix this problem?

@joncinque
Copy link
Contributor

Thanks for reporting the issue! I confirm that I can reproduce this, something's going wrong when using all of the highest dependencies

@joncinque
Copy link
Contributor

In the meantime, if you want to build from source, you can clone this repo, go to token/cli, and run cargo build

@nealsun
Copy link
Author

nealsun commented Jul 23, 2024

In the meantime, if you want to build from source, you can clone this repo, go to token/cli, and run cargo build

Building from source is successful, thanks

@h0bb3
Copy link

h0bb3 commented Jul 31, 2024

I seem to get the same problem running cargo install spl-token-cli but on spl-token-group-interface v0.2.3

anchor-cli 0.30.1
cargo 1.79.0 (ffa9cf99a 2024-06-03)
solana-cli 1.18.21 (src:c45d0979; feat:4215500110, client:Agave)
rustc 1.79.0 (129f3b996 2024-06-10)

(building from source as per above worked)

Compiling spl-token-group-interface v0.2.3
error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
  --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:67:99
   |
39 | ) -> Result<TlvIndices, ProgramError> {
   |      -------------------------------- expected `solana_program::program_error::ProgramError` because of this
...
67 |             pod_from_bytes::<Length>(&tlv_data[tlv_indices.length_start..tlv_indices.value_start])?;
   |             --------------------------------------------------------------------------------------^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<TlvIndices, solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
   |             |
   |             this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From<T>`:
             <solana_program::program_error::ProgramError as From<TlvError>>
             <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
             <solana_program::program_error::ProgramError as From<std::io::Error>>
             <solana_program::program_error::ProgramError as From<u64>>
   = note: required for `Result<TlvIndices, solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:109:14
    |
80  |   ) -> Result<(Vec<ArrayDiscriminator>, usize), ProgramError> {
    |        ------------------------------------------------------ expected `solana_program::program_error::ProgramError` because of this
...
107 |               let length = pod_from_bytes::<Length>(
    |  __________________________-
108 | |                 &tlv_data[tlv_indices.length_start..tlv_indices.value_start],
109 | |             )?;
    | |             -^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(Vec<ArrayDiscriminator>, usize), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    | |_____________|
    |               this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(Vec<ArrayDiscriminator>, usize), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:141:80
    |
127 | ) -> Result<&[u8], ProgramError> {
    |      --------------------------- expected `solana_program::program_error::ProgramError` because of this
...
141 |     let length = pod_from_bytes::<Length>(&tlv_data[length_start..value_start])?;
    |                  --------------------------------------------------------------^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<&[u8], solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |                  |
    |                  this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<&[u8], solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0308]: mismatched types
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:216:9
    |
214 |     ) -> Result<&V, ProgramError> {
    |          ------------------------ expected `Result<&V, solana_program::program_error::ProgramError>` because of return type
215 |         let data = get_bytes::<V>(self.get_data(), repetition_number)?;
216 |         pod_from_bytes::<V>(data)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ProgramError`, found a different `ProgramError`
    |
    = note: `ProgramError` and `ProgramError` have similar names, but are actually distinct types
note: `ProgramError` is defined in crate `solana_program`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-2.0.1/src/program_error.rs:15:1
    |
15  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
note: `ProgramError` is defined in crate `solana_program`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-1.18.20/src/program_error.rs:14:1
    |
14  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `solana_program` are being used?

error[E0308]: mismatched types
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:333:9
    |
331 |     ) -> Result<&mut V, ProgramError> {
    |          ---------------------------- expected `Result<&mut V, solana_program::program_error::ProgramError>` because of return type
332 |         let data = self.get_bytes_with_repetition_mut::<V>(repetition_number)?;
333 |         pod_from_bytes_mut::<V>(data)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ProgramError`, found a different `ProgramError`
    |
    = note: `ProgramError` and `ProgramError` have similar names, but are actually distinct types
note: `ProgramError` is defined in crate `solana_program`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-2.0.1/src/program_error.rs:15:1
    |
15  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
note: `ProgramError` is defined in crate `solana_program`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-1.18.20/src/program_error.rs:14:1
    |
14  | pub enum ProgramError {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `solana_program` are being used?

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:362:85
    |
362 |         let length = pod_from_bytes::<Length>(&self.data[length_start..value_start])?;
    |                                                                                     ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<&mut [u8], solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<&mut [u8], solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:387:60
    |
387 |         let extension_ref = pod_from_bytes_mut::<V>(buffer)?;
    |                                                            ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(&mut V, usize), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(&mut V, usize), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:439:88
    |
439 |                 pod_from_bytes_mut::<Length>(&mut self.data[length_start..value_start])?;
    |                                                                                        ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(&mut [u8], usize), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(&mut [u8], usize), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:490:97
    |
490 |         let length_ref = pod_from_bytes_mut::<Length>(&mut self.data[length_start..value_start])?;
    |                                                                                                 ^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<&mut [u8], solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<&mut [u8], solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

error[E0277]: `?` couldn't convert the error to `solana_program::program_error::ProgramError`
   --> /home/h0bb3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-type-length-value-0.4.5/src/state.rs:556:84
    |
547 | ) -> Result<(), ProgramError> {
    |      ------------------------ expected `solana_program::program_error::ProgramError` because of this
...
556 |         usize::try_from(*pod_from_bytes::<Length>(&data[length_start..value_start])?)?
    |                          ----------------------------------------------------------^ the trait `From<spl_pod::solana_program::program_error::ProgramError>` is not implemented for `solana_program::program_error::ProgramError`, which is required by `Result<(), solana_program::program_error::ProgramError>: FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`
    |                          |
    |                          this can't be annotated with `?` because it has type `Result<_, spl_pod::solana_program::program_error::ProgramError>`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <solana_program::program_error::ProgramError as From<TlvError>>
              <solana_program::program_error::ProgramError as From<solana_program::pubkey::PubkeyError>>
              <solana_program::program_error::ProgramError as From<std::io::Error>>
              <solana_program::program_error::ProgramError as From<u64>>
    = note: required for `Result<(), solana_program::program_error::ProgramError>` to implement `FromResidual<Result<Infallible, spl_pod::solana_program::program_error::ProgramError>>`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `spl-type-length-value` (lib) due to 10 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `spl-token-cli v4.0.0`, intermediate artifacts can be found at `/tmp/cargo-installn9PEvB`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@buffalojoec
Copy link
Contributor

I seem to get the same problem running cargo install spl-token-cli but on spl-token-group-interface v0.2.3

anchor-cli 0.30.1 cargo 1.79.0 (ffa9cf99a 2024-06-03) solana-cli 1.18.21 (src:c45d0979; feat:4215500110, client:Agave) rustc 1.79.0 (129f3b996 2024-06-10)

This is strange, since the latest version (4.0.0) for SPL Token CLI uses SPL Token Group Interface 0.3.0. This shouldn't be pulling in 0.2.3 of the interface.

Can you try with Agave/Solana CLI > 2.0? SPL Token CLI 4.0.0 is technically not compatible with 1.18.

@joncinque
Copy link
Contributor

I spent a little time on this, and I was able to get it to work when explicitly specifying the 2.0.3 versions of the Solana crates, so I'm going to bump spl-token-cli to a new patch version and publish it, which should fix the issue. I'll update here when that's done

@joncinque
Copy link
Contributor

joncinque commented Jul 31, 2024

This should work now, thanks for your patience!

Edit: with spl-token-cli 4.0.1, I mean. 4.0.0 is still broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants