ghost-node/scripts/patches/patch-2.sh
Uncle Stinky 4348580127
patches for the latest rustc compiler
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2026-02-05 18:19:54 +03:00

17 lines
685 B
Bash
Executable File

#!/bin/bash
LATEST_TESTED_VERSION=83
DEPENDENCY_PATH=~/.local/share/cargo/git/checkouts/polkadot-sdk-dee0edd6eefa0594/b401690/substrate/primitives/io/src/lib.rs
cargo_version=$(cargo --version | cut -d'.' -f2)
if [ "$cargo_version" -gt "$LATEST_TESTED_VERSION" ]; then
if grep -q '#\[no_mangle\]' "$DEPENDENCY_PATH"; then
sed -i '/#\[no_mangle\]/d' "$DEPENDENCY_PATH"
echo "[+] patch-2 will be applied: remove unnecessary #[no_mangle] from the source code for sp-io"
else
echo "[+] patch-2 already applied: #[no_mangle] already removed from source code of sp-io"
fi
else
echo "[+] patch-2 not needed: rustc compiler version is compatible"
fi