Use the latest Nim 1.6.6 RC; Handle Nim rebuilds when the new Nimble was already used

This commit is contained in:
Zahary Karadjov 2022-04-14 17:44:25 +03:00
parent b6685bb651
commit 9b15962d8d
2 changed files with 12 additions and 3 deletions

8
.envrc
View File

@ -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}"

View File

@ -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