compiler: make symbolfiles feature compile again

This commit is contained in:
Araq 2018-10-02 08:52:28 +02:00
commit 76aab9baf1
3 changed files with 18 additions and 18 deletions

View file

@ -12,7 +12,7 @@
const nimIncremental* = defined(nimIncremental)
import options, lineinfos
import options, lineinfos, pathutils
when nimIncremental:
import ast, msgs, intsets, btrees, db_sqlite, std / sha1
@ -45,10 +45,10 @@ when nimIncremental:
incr.r.types = initBTree[int, PType]()
proc hashFileCached*(conf: ConfigRef; fileIdx: FileIndex; fullpath: string): string =
proc hashFileCached*(conf: ConfigRef; fileIdx: FileIndex; fullpath: AbsoluteFile): string =
result = msgs.getHash(conf, fileIdx)
if result.len == 0:
result = $secureHashFile(fullpath)
result = $secureHashFile(string fullpath)
msgs.setHash(conf, fileIdx, result)
proc toDbFileId*(incr: var IncrementalCtx; conf: ConfigRef; fileIdx: FileIndex): int =
@ -57,7 +57,7 @@ when nimIncremental:
let row = incr.db.getRow(sql"select id, fullhash from filenames where fullpath = ?",
fullpath)
let id = row[0]
let fullhash = hashFileCached(conf, fileIdx, fullpath)
let fullhash = hashFileCached(conf, fileIdx, AbsoluteFile fullpath)
if id.len == 0:
result = int incr.db.insertID(sql"insert into filenames(fullpath, fullhash) values (?, ?)",
fullpath, fullhash)
@ -70,7 +70,7 @@ when nimIncremental:
if dbId == -1: return FileIndex(-1)
let fullpath = incr.db.getValue(sql"select fullpath from filenames where id = ?", dbId)
doAssert fullpath.len > 0, "cannot find file name for DB ID " & $dbId
result = fileInfoIdx(conf, fullpath)
result = fileInfoIdx(conf, AbsoluteFile fullpath)
proc addModuleDep*(incr: var IncrementalCtx; conf: ConfigRef;