From 2536db1b6a54f84035933a14e08e3487931101a9 Mon Sep 17 00:00:00 2001 From: zah Date: Fri, 21 Oct 2022 22:48:43 +0300 Subject: [PATCH] Work-around a Nim 1.6 issue in the handling of the NBS paths file (#4253) --- config.nims | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config.nims b/config.nims index 2b51b5c77..dea1e2127 100644 --- a/config.nims +++ b/config.nims @@ -2,8 +2,14 @@ import strutils --noNimblePath +const currentDir = currentSourcePath()[0 .. ^(len("config.nims") + 1)] + if getEnv("NIMBUS_BUILD_SYSTEM") == "yes" and - system.fileExists("nimbus-build-system.paths"): + # BEWARE + # In Nim 1.6, config files are evaluated with a working directory + # matching where the Nim command was invocated. This means that we + # must do all file existance checks with full absolute paths: + system.fileExists(currentDir & "nimbus-build-system.paths"): include "nimbus-build-system.paths" const nimCachePathOverride {.strdefine.} = "" @@ -130,7 +136,6 @@ switch("passL", "-fno-omit-frame-pointer") # for heap-usage-by-instance-type metrics and object base-type strings --define:nimTypeNames -const currentDir = currentSourcePath()[0 .. ^(len("config.nims") + 1)] switch("define", "nim_compiler_path=" & currentDir & "env.sh nim") switch("define", "withoutPCRE")