1
0
Fork 0

override rustc version globally, for OOT kmods

This commit is contained in:
Pratham Patel 2024-04-18 17:50:34 +05:30
parent 4079e09b10
commit d6ed009f45
Signed by: thefossguy
SSH Key Fingerprint: SHA256:HwRBy9H1FYXWcv/Qi1WY3kmcVtGz2ydZuPJgD4pkusY
1 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,13 @@
set -xeu -o pipefail
function setup_rust_toolchain() {
rustup override set "$(scripts/min-tool-version.sh rustc)"
RUSTUP_OVERRIDE_DIR_PATH="$(dirname "$(dirname "$PWD")")"
if [[ "${RUSTUP_OVERRIDE_DIR_PATH}" == *'/nix-kernel-dev' || "${RUSTUP_OVERRIDE_DIR_PATH}" == *'/freax' ]]; then
RUSTUP_OVERRIDE_SUFFIX="--path ${RUSTUP_OVERRIDE_DIR_PATH}"
fi
# shellcheck disable=SC2086
rustup override set "$(scripts/min-tool-version.sh rustc)" ${RUSTUP_OVERRIDE_SUFFIX}
rustup component add rust-src rustfmt clippy
cargo install --locked --version "$(scripts/min-tool-version.sh bindgen)" bindgen-cli