To avoid antivirus false-positives, I moved my Nim work into an exclusion path. However, running nim r <filename> resulted in the binary being placed in the default nimcache path, which is outside my exclusion path. That resulted in an IM from my friendly CYBERSEC team member.
Now I'm trying to create one single, global nimcache setting so any new Nim project's cache will target the exclusion folder by default. I'm on Win11, so I tried making this file:
# C:\Users\userid\AppData\Roaming\nim\config.nims
switch("nimcache", "$projectpath/mynimcache")
and the error when I build my demo app is:
Executing task in folder nimtimmy: nim r --hints:off D:\my\exclusion\path\nimtimmy\src\timmy.nim
cannot create directory: C:\Users\userid\AppData\Roaming\nim\D:\my\exclusion\path\nimtimmy\src\mynimcache
Can someone help me understand how I should properly apply path substitution for $projectpath?
https://nim-lang.org/docs/nimscript.html#projectDir
from std/os import `/`
switch("nimcache", projectDir() / "mynimcache")