diff --git a/programs/sbf/rust/sanity/src/lib.rs b/programs/sbf/rust/sanity/src/lib.rs index 0c820eaa95eaea..cf7a72b4efddfa 100644 --- a/programs/sbf/rust/sanity/src/lib.rs +++ b/programs/sbf/rust/sanity/src/lib.rs @@ -16,6 +16,21 @@ struct SStruct { z: u64, } +#[allow(dead_code)] +#[repr(C)] +enum TestEnum { + VariantOne, + VariantTwo, +} + +#[allow(dead_code)] +#[allow(clippy::enum_clike_unportable_variant)] +#[repr(C)] +enum Test64BitEnum { + VariantOne, + VariantTwo = 0xFFFFFFFFF, +} + #[inline(never)] fn return_sstruct() -> SStruct { SStruct { x: 1, y: 2, z: 3 } @@ -72,6 +87,14 @@ pub fn process_instruction( assert!(1.9986f64 < num && num < 2.0f64); } + { + // #[repr(C) enums must not change size between compiler version + // 32-bit for #[repr(C)] enum + assert_eq!(std::mem::size_of::(), 4); + // 64-bit for enum with a declared value + assert_eq!(std::mem::size_of::(), 8); + } + check_type_assumptions(); sol_log_compute_units(); diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index d67b57641446b5..13f05fca3ef9f8 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -1356,7 +1356,7 @@ fn assert_instruction_count() { #[cfg(feature = "sbf_c")] { programs.extend_from_slice(&[ - ("alloc", 11502), + ("alloc", 14575), ("sbf_to_sbf", 313), ("multiple_static", 208), ("noop", 5), diff --git a/sdk/bpf/scripts/install.sh b/sdk/bpf/scripts/install.sh index 55d2cbc19f4dc6..b7b59362c07a38 100755 --- a/sdk/bpf/scripts/install.sh +++ b/sdk/bpf/scripts/install.sh @@ -109,16 +109,16 @@ if [[ ! -e criterion-$version.md || ! -e criterion ]]; then fi # Install Rust-BPF -version=v1.39 +version=v1.41 if [[ ! -e bpf-tools-$version.md || ! -e bpf-tools ]]; then ( set -e rm -rf bpf-tools* rm -rf xargo job="download \ - https://github.com/solana-labs/bpf-tools/releases/download \ + https://github.com/anza-xyz/platform-tools/releases/download \ $version \ - solana-bpf-tools-${machine}-${arch}.tar.bz2 \ + platform-tools-${machine}-${arch}.tar.bz2 \ bpf-tools" get $version bpf-tools "$job" ) diff --git a/sdk/cargo-build-sbf/src/main.rs b/sdk/cargo-build-sbf/src/main.rs index 79a4a1378ed6ee..0da59ff230b385 100644 --- a/sdk/cargo-build-sbf/src/main.rs +++ b/sdk/cargo-build-sbf/src/main.rs @@ -913,7 +913,7 @@ fn main() { // The following line is scanned by CI configuration script to // separate cargo caches according to the version of platform-tools. - let platform_tools_version = String::from("v1.39"); + let platform_tools_version = String::from("v1.41"); let rust_base_version = get_base_rust_version(platform_tools_version.as_str()); let version = format!( "{}\nplatform-tools {}\n{}", diff --git a/sdk/program/Cargo.toml b/sdk/program/Cargo.toml index ccd18701eefcc4..b5689fab3c92fd 100644 --- a/sdk/program/Cargo.toml +++ b/sdk/program/Cargo.toml @@ -9,7 +9,7 @@ repository = { workspace = true } homepage = { workspace = true } license = { workspace = true } edition = { workspace = true } -rust-version = "1.72.0" # solana platform-tools rust version +rust-version = "1.75.0" # solana platform-tools rust version [dependencies] bincode = { workspace = true } diff --git a/sdk/sbf/c/sbf.mk b/sdk/sbf/c/sbf.mk index 6699daf120e639..84c152e2dd26e0 100644 --- a/sdk/sbf/c/sbf.mk +++ b/sdk/sbf/c/sbf.mk @@ -15,7 +15,7 @@ OUT_DIR ?= ./out OS := $(shell uname) LLVM_DIR = $(LOCAL_PATH)../dependencies/platform-tools/llvm -LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/15.0.4/include +LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/17/include COMPILER_RT_DIR = $(LOCAL_PATH)../dependencies/platform-tools/rust/lib/rustlib/sbf-solana-solana/lib STD_INC_DIRS := $(LLVM_DIR)/include STD_LIB_DIRS := $(LLVM_DIR)/lib diff --git a/sdk/sbf/scripts/install.sh b/sdk/sbf/scripts/install.sh index 08f5f79e1b3417..12343a413ed7b7 100755 --- a/sdk/sbf/scripts/install.sh +++ b/sdk/sbf/scripts/install.sh @@ -109,13 +109,13 @@ if [[ ! -e criterion-$version.md || ! -e criterion ]]; then fi # Install platform tools -version=v1.39 +version=v1.41 if [[ ! -e platform-tools-$version.md || ! -e platform-tools ]]; then ( set -e rm -rf platform-tools* job="download \ - https://github.com/solana-labs/platform-tools/releases/download \ + https://github.com/anza-xyz/platform-tools/releases/download \ $version \ platform-tools-${machine}-${arch}.tar.bz2 \ platform-tools"