Skip to content

Commit

Permalink
Dont recompile Nim if already compiled (#1324)
Browse files Browse the repository at this point in the history
* Dont recompile Nim if already compiled

* removes fragile check
  • Loading branch information
jmgomez authored Jan 3, 2025
1 parent b7d37e7 commit f7140a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/nimblepkg/nimenv.nim
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ proc infoAboutActivation(nimDest, nimVersion: string) =
display("Info", nimDest & "installed; activate with 'source nim-" & nimVersion & "activate.sh'")

proc compileNim*(options: Options, nimDest: string, v: VersionRange) =
#Most of the time we dont need to recompile, if we can get the nim version from the binary .
let nimCompVersion = getNimVersionFromBin(nimDest / "bin" / "nim".addFileExt(ExeExt))
if nimCompVersion.isSome() and nimCompVersion.get.withinRange(v):
return

let keepCsources = options.useSatSolver #SAT Solver has a cache instead of a temp dir for downloads
template exec(command: string) =
let cmd = command # eval once
Expand Down

0 comments on commit f7140a3

Please sign in to comment.