#!/bin/sh PINNED_RUSTC_VERSION='rustc 1.96.1 (31fca3adb 2026-06-26)' PINNED_CARGO_VERSION='cargo 1.96.1 (356927216 2026-06-26)' require_pinned_rust_toolchain() { actual_rustc=$(rustc --version 2>/dev/null || true) actual_cargo=$(cargo --version 2>/dev/null || true) if [ "$actual_rustc" != "$PINNED_RUSTC_VERSION" ]; then echo "Rust compiler mismatch; required: $PINNED_RUSTC_VERSION" >&2 exit 1 fi if [ "$actual_cargo" != "$PINNED_CARGO_VERSION" ]; then echo "Cargo mismatch; required: $PINNED_CARGO_VERSION" >&2 exit 1 fi } hash_file() { shasum -a 256 "$1" | awk '{print $1}' } hash_rust_sources() { source_directory=$1 find "$source_directory" -type f -print | LC_ALL=C sort | while IFS= read -r source_file; do shasum -a 256 "$source_file"; done | shasum -a 256 | awk '{print $1}' }