From 15bc75d4cf6f7c471242a596a3ccb7349e38e605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Tue, 7 Sep 2021 17:27:33 +0200 Subject: [PATCH] QUICK_AND_DIRTY_NIMBLE --- README.md | 7 +++++++ scripts/build_nim.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index fdc2d32..003a1f4 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,13 @@ CI. Defaults to 0. `make QUICK_AND_DIRTY_COMPILER=1 build-nim` +### QUICK_AND_DIRTY_NIMBLE + +Build Nimble when it wouldn't be normally built as part of the tools. Only +useful with `QUICK_AND_DIRTY_COMPILER=1`. Defaults to 0. + +`make QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 build-nim` + ### NIM_COMMIT Build and use a different Nim compiler version than the default one. diff --git a/scripts/build_nim.sh b/scripts/build_nim.sh index dda78ec..0449c98 100755 --- a/scripts/build_nim.sh +++ b/scripts/build_nim.sh @@ -34,6 +34,7 @@ UCPU="" [[ "$ARCH_OVERRIDE" == "x86" ]] && UCPU="ucpu=i686" [[ -z "$NIM_BUILD_MSG" ]] && NIM_BUILD_MSG="Building the Nim compiler" [[ -z "$QUICK_AND_DIRTY_COMPILER" ]] && QUICK_AND_DIRTY_COMPILER=0 +[[ -z "$QUICK_AND_DIRTY_NIMBLE" ]] && QUICK_AND_DIRTY_NIMBLE=0 # Windows detection if uname | grep -qiE "mingw|msys"; then @@ -205,6 +206,12 @@ build_nim() { rm -f bin/nim cp -a compiler/nim bin/nim rm bin/nim1 + + # Do we want Nimble in this quick build? + if [[ "${QUICK_AND_DIRTY_NIMBLE}" != "0" ]]; then + bin/nim c -d:release --noNimblePath --skipUserCfg --skipParentCfg dist/nimble/src/nimble.nim + mv dist/nimble/src/nimble bin/ + fi fi # record the built commit