From 9b15962d8d946c10f340bea300982cb7bf8657e9 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Thu, 14 Apr 2022 17:44:25 +0300 Subject: [PATCH] Use the latest Nim 1.6.6 RC; Handle Nim rebuilds when the new Nimble was already used --- .envrc | 8 +++++--- scripts/rebuild-nim | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.envrc b/.envrc index e166bf6..1a1ed9d 100755 --- a/.envrc +++ b/.envrc @@ -1,16 +1,18 @@ #!/usr/bin/env bash + +export IN_STATUS_NIM_WORKSPACE=1 + export NIM_REPO="https://github.com/status-im/Nim" export NIMBLE_REPO="https://github.com/nim-lang/nimble" if [[ -z "${NIM_COMMIT}" ]]; then - export NIM_COMMIT="727c6378d2464090564dbcd9bc8b9ac648467e38" # v1.6.0 + export NIM_COMMIT="d38177b11f628d9675809bfa85356c3ee3a26fea" # latest v1.6.x (2021-04-14) fi if [[ -z "${NIMBLE_COMMIT}" ]]; then - export NIMBLE_COMMIT="26c9102c84c6b278985cedce79d6b8982361cb81" # latest (2021-12-16) + export NIMBLE_COMMIT="d68b2cb6efe8ce298cb5021fe84d3814d755322f" # latest (2021-04-14) fi source ./scripts/rebuild-nim export PATH="$(pwd)/${NIM_DIR}/bin:$(pwd)/scripts:${PATH}" - diff --git a/scripts/rebuild-nim b/scripts/rebuild-nim index f085275..a634f70 100755 --- a/scripts/rebuild-nim +++ b/scripts/rebuild-nim @@ -114,6 +114,9 @@ build_nim() { git clone "${NIMBLE_REPO}" . git checkout "${NIMBLE_COMMIT}" # we have to delete .git or koch.nim will checkout a branch tip, overriding our target commit + # TODO + # This is quite the hack and it breaks the output of `nimble --version` + # which prints the Nim revision instead of the Nimble revision. rm -rf .git popd fi @@ -122,6 +125,10 @@ build_nim() { rm -rf dist/nimble ln -s ../"${NIMBLE_DIR}" dist/nimble + # Clean up the new Nimble cache, because the csources build + # won't recognize the validity of the packages there: + rm -rf ~/.nimble/pkgs2 + # bootstrap the Nim compiler and build the tools rm -f bin/nim bin/nim_csources pushd csources