coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

Compilation error: `ArithmeticOverflow` not found in `ProgramError` in anchor-lang v0.30.0 #2953

Closed theghostmac closed 1 month ago

theghostmac commented 1 month ago

Description

While attempting to compile my project using anchor-lang version 0.30.0, I encountered an error related to ProgramError. Specifically, the compiler cannot find the variant ArithmeticOverflow in ProgramError.

This issue arises when trying to compile the dependencies for my project, which also includes Solana libraries with specific version constraints due to other dependencies like raydium-library.

Error Message

image

Steps to Reproduce

  1. Set up a Rust project with the following dependencies in Cargo.toml:
    • anchor-lang = "0.30.0"
    • Solana dependencies as specified (include other relevant dependencies).
  2. Run cargo build.

Additional Context

Anchor isn't a dependency in my project, instead it is a dependency of a dependency, so I reckon it is affecting more than just me.

acheroncrypto commented 1 month ago

Hey, thank you for the comprehensive explanation and reporting the issue.

Please see https://github.com/coral-xyz/anchor/issues/2949#issuecomment-2098915818 as this is duplicate of https://github.com/coral-xyz/anchor/issues/2949.

Solana dependencies as specified (include other relevant dependencies).

For now, you can upgrade Solana dependencies to 1.18 or 1.17 to fix this error.