cargo test-sbfすると「is not supported by the following packages」エラー

現象

以下のエラーが発生。

% cargo test-sbf --features test-sbf

    Finished `release` profile [optimized] target(s) in 0.26s
error: rustc 1.79.0 is not supported by the following packages:
  litemap@0.7.5 requires rustc 1.81
  zerofrom@0.1.6 requires rustc 1.81
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.79.0

rustcのバージョンがあっていないため、rustcを最新バージョンにする。

% rustup update

info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: syncing channel updates for 'nightly-aarch64-apple-darwin'

   stable-aarch64-apple-darwin unchanged - rustc 1.86.0 (05f9846f8 2025-03-31)
  nightly-aarch64-apple-darwin unchanged - rustc 1.88.0-nightly (9ffde4b08 2025-04-12)

info: cleaning up downloads & tmp directories
info: self-update is disabled for this build of rustup
info: any updates to rustup will need to be fetched with your system package manager

1.86.0 が最新バージョンだが古いままになっている。

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

原因

rustup showでなにが使われているか(activeか)を確認すると、1.79.0が指定されていた。

% rustup show

Default host: aarch64-apple-darwin
rustup home:  /Users/256hax/.rustup

installed toolchains
--------------------
stable-aarch64-apple-darwin
nightly-aarch64-apple-darwin
1.76.0-aarch64-apple-darwin
1.79.0-aarch64-apple-darwin (active, default)
solana

active toolchain

対策

最新のstableを指定する。

% rustup default stable

info: using existing install for 'stable-aarch64-apple-darwin'
info: default toolchain set to 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin unchanged - rustc 1.86.0 (05f9846f8 2025-03-31)

設定を再確認する。

% rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/256hax/.rustup

installed toolchains
--------------------
stable-aarch64-apple-darwin (active, default)
nightly-aarch64-apple-darwin
1.76.0-aarch64-apple-darwin
1.79.0-aarch64-apple-darwin
solana

active toolchain
----------------
name: stable-aarch64-apple-darwin
active because: it's the default toolchain
installed targets:
  aarch64-apple-darwin


% rustc --version
rustc 1.86.0 (05f9846f8 2025-03-31)