nim-workspace improvements

- use local NIMBLE_DIR (we should remove the warning at nimble side)
- make sure the correct nimble is picked
- install nimlangserver
This commit is contained in:
Ivan Yonchovski 2022-12-14 15:02:22 +02:00 committed by zah
parent b390f25205
commit 78625d3b97
4 changed files with 14 additions and 3 deletions

5
.envrc
View File

@ -3,4 +3,7 @@
source ./scripts/rebuild-nim
source ./scripts/rebuild-nimble
export PATH="$(pwd)/bin:~/.cache/nim-workspace/bin/:$(pwd)/${NIM_DIR}/bin:$(pwd)/scripts:${PATH}"
export NIMBLE_DIR="$(pwd)/.nimble"
export PATH="$(pwd)/bin:$(realpath ~/.cache/nim-workspace/bin/):$NIMBLE_DIR/bin:$(pwd)/${NIM_DIR}/bin:$(pwd)/scripts:${PATH}"
source ./scripts/rebuild-languageserver

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
if [ ! -f "$NIMBLE_DIR/bin/nimlangserver" ] ; then
nimble install -y nimlangserver
fi

View File

@ -11,8 +11,10 @@ if [ ! -f ~/.cache/nim-workspace/bin/nim$EXE_SUFFIX ]; then
if uname | grep -qiE "mingw|msys"; then
curl https://github.com/dom96/choosenim/releases/download/v0.8.4/choosenim-0.8.4_windows_amd64.exe \
--output /tmp/choosenim.exe
/tmp/choosenim.exe stable --nimbleDir:~/.cache/nim-workspace
/tmp/choosenim.exe "#version-1-6" --nimbleDir:~/.cache/nim-workspace
else
curl https://raw.githubusercontent.com/yyoncho/choosenim/nimble-dir/scripts/choosenim-unix-init.sh -sSf | NIMBLE_BIN=~/.cache/nim-workspace sh -x
chmod a+x ~/.cache/nim-workspace/choosenim
~/.cache/nim-workspace/choosenim "#version-1-6" --nimbleDir:~/.cache/nim-workspace
fi
fi

View File

@ -13,6 +13,8 @@ else
BUILD_COMMAND="sh compile_nimble.sh"
fi
git submodule update --init
pushd $NIMBLE_SOURCES
NIMBLE_COMMIT=$(git rev-parse HEAD)
popd
@ -21,7 +23,6 @@ NIMBLE_CACHE_DIR=~/.cache/nim/nim-workspace/
NIMBLE=$NIMBLE_CACHE_DIR/nimble_$NIMBLE_COMMIT$EXE_SUFFIX
if [ ! -f $NIMBLE ]; then
git submodule update --init
mkdir -p $NIMBLE_CACHE_DIR
pushd $NIMBLE_SOURCES
$BUILD_COMMAND