From 8762880452d6f26cf98dc96337d1b53f9eb96bf5 Mon Sep 17 00:00:00 2001 From: henk717 Date: Tue, 21 May 2024 15:43:44 +0200 Subject: [PATCH] Harden koboldcpp.sh against conda hijacking (#857) * Harden against conda hijacks Turns out conda can override the location of our packages, by ignoring the conda rc files we can prevent this. * Harden even further Turns out not everything has a --no-rc option, now we hardcode the path. * Remove --no-rc in run Not supported in run, breaks the commands. --- koboldcpp.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/koboldcpp.sh b/koboldcpp.sh index 6bef9c4bd..adfd7e07c 100755 --- a/koboldcpp.sh +++ b/koboldcpp.sh @@ -11,24 +11,24 @@ if [[ ! -f "conda/envs/linux/bin/python" || $1 == "rebuild" ]]; then else KCPP_CUDA=11.5.0 fi - bin/micromamba create --no-shortcuts -r conda -n linux -f environment.tmp.yaml -y - bin/micromamba create --no-shortcuts -r conda -n linux -f environment.tmp.yaml -y - bin/micromamba run -r conda -n linux make clean + bin/micromamba create --no-rc --no-shortcuts -r conda -p conda/envs/linux -f environment.tmp.yaml -y + bin/micromamba create --no-rc --no-shortcuts -r conda -p conda/envs/linux -f environment.tmp.yaml -y + bin/micromamba run -r conda -p conda/envs/linux make clean echo $KCPP_CUDA > conda/envs/linux/cudaver echo rm environment.tmp.yaml fi KCPP_CUDA=$(