From 988217cc53dd1ecaf1793d0195ff05bf12f523a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Wed, 15 Apr 2020 17:25:03 +0200 Subject: [PATCH] new env var: USE_SYSTEM_NIM --- README.md | 6 ++++++ makefiles/variables.mk | 3 +++ scripts/env.sh | 7 ++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 383ec51..410dba3 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ GNU Make, Bash and the usual POSIX utilities. +## Make flags + +* use the system Nim instead of the shipped version (usually for testing Nim devel versions) + +`make USE_SYSTEM_NIM=1 test` + ## License Licensed and distributed under either of diff --git a/makefiles/variables.mk b/makefiles/variables.mk index 1f80887..1dc6b33 100644 --- a/makefiles/variables.mk +++ b/makefiles/variables.mk @@ -82,3 +82,6 @@ endif # AppVeyor/Travis cache of $(NIM_DIR)/bin CI_CACHE := +# bypassing the shipped Nim, usually for testing new Nim devel versions +USE_SYSTEM_NIM := 0 + diff --git a/scripts/env.sh b/scripts/env.sh index 3adf537..fce8443 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -26,9 +26,14 @@ export NIM_PATH=$(cd "${ABS_PATH}/../vendor/Nim/bin"; pwd) # Nimble needs this to be an absolute path export NIMBLE_DIR=$(cd "${ABS_PATH}/../../.nimble"; pwd) +# we don't use Nimble-installed binaries, but just in case +export PATH="${NIMBLE_DIR}/bin:${PATH}" + #- make it an absolute path, so we can call this script from other dirs #- we can't use native Windows paths in here, because colons can't be escaped in PATH -export PATH="${NIM_PATH}:${NIMBLE_DIR}/bin:${PATH}" +if [[ "$USE_SYSTEM_NIM" != "1" ]]; then + export PATH="${NIM_PATH}:${PATH}" +fi # used by nim-beacon-chain/tests/simulation/start.sh export BUILD_OUTPUTS_DIR="${ABS_PATH}/../../../build"