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

Programs:test script is failing on 'main' branch #56

Open
geoshak opened this issue Dec 22, 2024 · 1 comment
Open

Programs:test script is failing on 'main' branch #56

geoshak opened this issue Dec 22, 2024 · 1 comment

Comments

@geoshak
Copy link

geoshak commented Dec 22, 2024

I'm using Linux Mint 21.1.

I have cloned the repo, was able to run pnpm run programs:build
But when running pnpm run programs:test I get:
Besides some other type errors.

error[E0282]: type annotations needed for `Box<_>`
  --> /home/st/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`

Any pointers?

@geoshak
Copy link
Author

geoshak commented Dec 22, 2024

When I run cargo update in the programs/lighthouse dir, I get this:

error: failed to select a version for the requirement `bytemuck = "=1.14.3"`
candidate versions found which didn't match: 1.21.0, 1.20.0, 1.19.0, ...
location searched: crates.io index
required by package `lighthouse-program v2.0.0 (/media/st/Rígido/perion/lighthouse/programs/lighthouse)`
if you are looking for the prerelease package it needs to be specified explicitly
    bytemuck = { version = "1.2.0-alpha.1" }

I tried to edit Cargo.toml, added patches as below:

[dependencies]
...
bytemuck = "1.14.3"
...

[patch.crates-io]
solana_rbpf = { git = "https://github.com/solana-labs/rbpf", tag = "v0.8.0" }
spl-pod = { git = "https://github.com/solana-labs/solana-program-library", rev = "950efde" }
spl-transfer-hook-interface = { git = "https://github.com/solana-labs/solana-program-library", rev = "950efde" }
spl-type-length-value = { git = "https://github.com/solana-labs/solana-program-library", rev = "2883813" }

Then Cargo update will run ok.
But Cargo build will fail (same for programs:test), with a bunch of errors like:

error[E0277]: the trait bound `T: spl_discriminator::discriminator::SplDiscriminate` is not satisfied
   --> /home/st/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-tlv-account-resolution-0.5.1/src/state.rs:286:45
    |
286 |         let bytes = state.get_first_bytes::<T>()?;
    |                           ---------------   ^ the trait `spl_discriminator::discriminator::SplDiscriminate` is not implemented for `T`
    |                           |
    |                           required by a bound introduced by this call
    |
note: required by a bound in `get_first_bytes`
   --> /home/st/.cargo/git/checkouts/solana-program-library-dad8d98b86bb61bf/950efde/libraries/type-length-value/src/state.rs:252:27
    |
252 |     fn get_first_bytes<V: SplDiscriminate>(&self) -> Result<&[u8], ProgramError> {
    |                           ^^^^^^^^^^^^^^^ required by this bound in `TlvState::get_first_bytes`
help: consider further restricting this bound
    |
276 |     pub async fn add_to_instruction<T: SplDiscriminate + spl_discriminator::discriminator::SplDiscriminate, F, Fut>(
    |                                                        +++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `T: spl_discriminator::discriminator::SplDiscriminate` is not satisfied
   --> /home/st/.cargo/registry/src/index.crates.io-6f17d22bba15001f/spl-tlv-account-resolution-0.5.1/src/state.rs:177:40
    |
177 |         let (bytes, _) = state.alloc::<T>(tlv_size, false)?;
    |                                -----   ^ the trait `spl_discriminator::discriminator::SplDiscriminate` is not implemented for `T`
    |                                |
    |                                required by a bound introduced by this call
    |
note: required by a bound in `TlvStateMut::<'data>::alloc`

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

No branches or pull requests

1 participant