diff --git a/.github/actions/install_nim/action.yml b/.github/actions/install_nim/action.yml index f5f7736e0..59849d455 100644 --- a/.github/actions/install_nim/action.yml +++ b/.github/actions/install_nim/action.yml @@ -116,10 +116,11 @@ runs: shell: ${{ inputs.shell }} run: | rm -rf nim + export NIMBLE_DIR=dist/nimble cp ./scripts/build_nim.sh . env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ inputs.nim_branch }} \ QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 CC=gcc \ - bash build_nim.sh nim csources dist/my_nimble NONE + bash build_nim.sh nim csources ${NIMBLE_DIR} NimBinaries # nimble install nimble -y # ls -la nim/bin # rm -rf nim/bin/nimble.exe diff --git a/scripts/build_nim.sh b/scripts/build_nim.sh index 174efca85..890c1923c 100644 --- a/scripts/build_nim.sh +++ b/scripts/build_nim.sh @@ -94,6 +94,21 @@ nim_needs_rebuilding() { fi popd >/dev/null + if [[ ! -d "$NIMBLE_DIR" ]]; then + mkdir -p "$NIMBLE_DIR" + pushd "$NIMBLE_DIR" + git clone https://github.com/nim-lang/nimble.git . + git checkout $NIMBLE_COMMIT + # we have to delete .git or koch.nim will checkout a branch tip, overriding our target commit + rm -rf .git + popd + fi + if [[ "$NIMBLE_DIR" != "dist/nimble" ]]; then + mkdir -p dist + rm -rf dist/nimble + ln -s ../"$NIMBLE_DIR" dist/nimble + fi + if [[ -n "$CI_CACHE" && -d "$CI_CACHE" ]]; then cp -a "$CI_CACHE"/* "$NIM_DIR"/bin/ || true # let this one fail with an empty cache dir fi