coral-xyz / anchor

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

Incorrect load rustc version #3028

Closed duongvansang closed 2 weeks ago

duongvansang commented 2 weeks ago

My rustc is latest one

% rustc -V rustc 1.79.0 (129f3b996 2024-06-10)

but when I run anchor test for project I just init through command:

anchor init day1

It shows I am using rustc version 1.68.0-dev

$anchor test --skip-local-validator error: package solana-program v1.18.16 cannot be built because it requires rustc 1.75.0 or newer, while the currently active rustc version is 1.68.0-dev Either upgrade to rustc 1.75.0 or newer, or use cargo update -p solana-program@1.18.16 --precise ver where ver is the latest version of solana-program supporting rustc 1.68.0-dev

duongvansang commented 2 weeks ago

btw, I use anchor version 0.30 % anchor -V anchor-cli 0.30.0 and run on mac

acheroncrypto commented 2 weeks ago

This was answered here https://github.com/coral-xyz/anchor/issues/3012#issuecomment-2155844957. You'll also get a better error message with the newer Solana versions.