Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

v1.16: Add rust-version field to solana-program to prevent the accidental use of unsupported platform-tools versions (backport of #32232) #32262

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ci/test-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ test-stable-sbf)
# SBF solana-sdk legacy compile test
"$cargo_build_sbf" --manifest-path sdk/Cargo.toml

# Ensure the minimum supported "rust-version" matches platform tools to fail
# quickly if users try to build with an older platform tools install
cargo_toml=sdk/program/Cargo.toml
source "scripts/read-cargo-variable.sh"
crate_rust_version=$(readCargoVariable rust-version $cargo_toml)
platform_tools_rust_version=$("$cargo_build_sbf" --version | grep rustc)
platform_tools_rust_version=$(echo "$platform_tools_rust_version" | cut -d\ -f2) # Remove "rustc " prefix from a string like "rustc 1.68.0-dev"
platform_tools_rust_version=$(echo "$platform_tools_rust_version" | cut -d- -f1) # Remove "-dev" suffix from a string like "1.68.0-dev"

if [[ $crate_rust_version != "$platform_tools_rust_version" ]]; then
echo "Error: Update 'rust-version' field in '$cargo_toml' from $crate_rust_version to $platform_tools_rust_version"
exit 1
fi

# SBF C program system tests
_ make -C programs/sbf/c tests
if need_to_upload_test_result; then
Expand Down
1 change: 1 addition & 0 deletions sdk/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = "1.68.0" # solana platform-tools rust version

[dependencies]
bincode = { workspace = true }
Expand Down