Skip to content

Commit 2082b86

Browse files
committed
solana-labs is now agave-xyz, latest agave-geyser-plugin-interface is using 1.84.1, add helperscript to keep rust version consistent
1 parent e5b5b8c commit 2082b86

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
path: |
5151
~/.cargo/registry
5252
~/.cargo/git
53-
key: ${{ matrix.os }}-cargo-build-${{ hashFiles('**/Cargo.lock', 'rust-toolchain') }}-${{ env.RUST_STABLE }}
53+
key: ${{ matrix.os }}-cargo-build-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}-${{ env.RUST_STABLE }}
5454

5555
- name: cargo fmt
5656
uses: actions-rs/cargo@v1

rust-toolchain

Lines changed: 0 additions & 4 deletions
This file was deleted.

rust-toolchain.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# see also upstream solana/rust-toolchain.toml
2+
# https://github.com/anza-xyz/agave/blob/master/rust-toolchain.toml
3+
[toolchain]
4+
channel = "1.84.1"

scripts/update-rust-toolchain.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# Get agave-geyser-plugin-interface version from Cargo.lock
4+
AGAVE_VERSION=$(grep -A 1 'name = "agave-geyser-plugin-interface"' Cargo.lock | grep version | cut -d'"' -f2)
5+
echo "Found agave-geyser-plugin-interface version: $AGAVE_VERSION"
6+
7+
# Get Agave's rust-toolchain.toml version based on the agave-geyser-plugin-interface version
8+
VERSION=$(curl -s "https://raw.githubusercontent.com/anza-xyz/agave/v$AGAVE_VERSION/rust-toolchain.toml" | grep channel | cut -d'"' -f2)
9+
echo "Found Agave's rust-toolchain.toml version: $VERSION"
10+
11+
# Check current version
12+
CURRENT_VERSION=$(grep channel rust-toolchain.toml | cut -d'"' -f2)
13+
echo "Current rust-toolchain.toml version: $CURRENT_VERSION"
14+
15+
if [ "$CURRENT_VERSION" != "$VERSION" ]; then
16+
echo "Updating rust-toolchain.toml to $VERSION"
17+
sed -i '' "s/channel = \".*\"/channel = \"$VERSION\"/" rust-toolchain.toml
18+
else
19+
echo "rust-toolchain.toml is already up to date"
20+
fi

0 commit comments

Comments
 (0)