coral-xyz / anchor

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

`anchor build -v` with anchor 0.29 fails becaues `toml_edit v0.21.1` requires rustc 1.69 or newer #3024

Closed ARKN-SOL closed 2 weeks ago

ARKN-SOL commented 2 weeks ago

Creating a verifiable build of my Solana program fails because of toml_edit v0.21.1:

error: package `toml_edit v0.21.1` cannot be built because it requires rustc 1.69 or newer, while the currently active rustc version is 1.68.0-dev
Either upgrade to rustc 1.69 or newer, or use
cargo update -p toml_edit@0.21.1 --precise ver
where `ver` is the latest version of `toml_edit` supporting rustc 1.68.0-dev

This cargo tree output shows the version is a dependency of spl-token-2022:

│   │   ├── spl-token-2022 v0.9.0
│   │   │   ├── num_enum v0.7.2
│   │   │   │   └── num_enum_derive v0.7.2 (proc-macro)
│   │   │   │       ├── proc-macro-crate v3.1.0
│   │   │   │       │   └── toml_edit v0.21.1

I saw a similar error mentioned in #3012, but I don't know how to apply the resolution to this issue.

acheroncrypto commented 2 weeks ago

You need a lock file that has compatible toml_edit version to make older versions build. You can manually try downgrading dependencies in your lock file until it works, or upgrade to latest Solana and Anchor version which doesn't have this problem.

ARKN-SOL commented 2 weeks ago

Thanks! I've managed to make it work by pinning the num_enum crate to version 0.7.1 in my cargo.toml

[dependencies]
num_enum = "=0.7.1"