use file IDs consistently instead of file paths in the rod files handling
This commit is contained in:
parent
d26e488316
commit
27dd39778f
2 changed files with 13 additions and 12 deletions
|
|
@ -18,5 +18,5 @@ const
|
||||||
VersionPatch* = 1
|
VersionPatch* = 1
|
||||||
VersionAsString* = $VersionMajor & "." & $VersionMinor & "." & $VersionPatch
|
VersionAsString* = $VersionMajor & "." & $VersionMinor & "." & $VersionPatch
|
||||||
|
|
||||||
RodFileVersion* = "1211" # modify this if the rod-format changes!
|
RodFileVersion* = "1212" # modify this if the rod-format changes!
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,8 @@ type
|
||||||
s: cstring # mmap'ed file contents
|
s: cstring # mmap'ed file contents
|
||||||
options: TOptions
|
options: TOptions
|
||||||
reason: TReasonForRecompile
|
reason: TReasonForRecompile
|
||||||
modDeps: TStringSeq
|
modDeps: seq[int32]
|
||||||
files: TStringSeq
|
files: seq[int32]
|
||||||
dataIdx: int # offset of start of data section
|
dataIdx: int # offset of start of data section
|
||||||
convertersIdx: int # offset of start of converters section
|
convertersIdx: int # offset of start of converters section
|
||||||
initIdx, interfIdx, compilerProcsIdx, methodsIdx: int
|
initIdx, interfIdx, compilerProcsIdx, methodsIdx: int
|
||||||
|
|
@ -586,9 +586,10 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
|
||||||
inc(r.pos, 2) # skip "(\10"
|
inc(r.pos, 2) # skip "(\10"
|
||||||
inc(r.line)
|
inc(r.line)
|
||||||
while r.s[r.pos] != ')':
|
while r.s[r.pos] != ')':
|
||||||
var relativePath = decodeStr(r.s, r.pos)
|
let relativePath = decodeStr(r.s, r.pos)
|
||||||
var resolvedPath = relativePath.findModule
|
let resolvedPath = relativePath.findModule
|
||||||
r.files.add(if resolvedPath.len > 0: resolvedPath else: relativePath)
|
let finalPath = if resolvedPath.len > 0: resolvedPath else: relativePath
|
||||||
|
r.files.add(finalPath.fileInfoIdx)
|
||||||
inc(r.pos) # skip #10
|
inc(r.pos) # skip #10
|
||||||
inc(r.line)
|
inc(r.line)
|
||||||
if r.s[r.pos] == ')': inc(r.pos)
|
if r.s[r.pos] == ')': inc(r.pos)
|
||||||
|
|
@ -596,7 +597,7 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
|
||||||
inc(r.pos, 2) # skip "(\10"
|
inc(r.pos, 2) # skip "(\10"
|
||||||
inc(r.line)
|
inc(r.line)
|
||||||
while r.s[r.pos] != ')':
|
while r.s[r.pos] != ')':
|
||||||
w = r.files[decodeVInt(r.s, r.pos)]
|
w = r.files[decodeVInt(r.s, r.pos)].toFullPath
|
||||||
inc(r.pos) # skip ' '
|
inc(r.pos) # skip ' '
|
||||||
inclCrc = decodeVInt(r.s, r.pos)
|
inclCrc = decodeVInt(r.s, r.pos)
|
||||||
if r.reason == rrNone:
|
if r.reason == rrNone:
|
||||||
|
|
@ -828,7 +829,7 @@ proc checkDep(fileIdx: int32): TReasonForRecompile =
|
||||||
var res = checkDep(SystemFileIdx)
|
var res = checkDep(SystemFileIdx)
|
||||||
if res != rrNone: result = rrModDeps
|
if res != rrNone: result = rrModDeps
|
||||||
for i in countup(0, high(r.modDeps)):
|
for i in countup(0, high(r.modDeps)):
|
||||||
res = checkDep(r.modDeps[i].fileInfoIdx)
|
res = checkDep(r.modDeps[i])
|
||||||
if res != rrNone:
|
if res != rrNone:
|
||||||
result = rrModDeps
|
result = rrModDeps
|
||||||
# we cannot break here, because of side-effects of `checkDep`
|
# we cannot break here, because of side-effects of `checkDep`
|
||||||
|
|
@ -1062,11 +1063,11 @@ proc viewFile(rodfile: string) =
|
||||||
while r.s[r.pos] != ')':
|
while r.s[r.pos] != ')':
|
||||||
let relativePath = decodeStr(r.s, r.pos)
|
let relativePath = decodeStr(r.s, r.pos)
|
||||||
let resolvedPath = relativePath.findModule
|
let resolvedPath = relativePath.findModule
|
||||||
let rr = if resolvedPath.len > 0: resolvedPath else: relativePath
|
let finalPath = if resolvedPath.len > 0: resolvedPath else: relativePath
|
||||||
r.files.add(rr)
|
r.files.add(finalPath.fileInfoIdx)
|
||||||
inc(r.pos) # skip #10
|
inc(r.pos) # skip #10
|
||||||
inc(r.line)
|
inc(r.line)
|
||||||
outf.writeln(rr)
|
outf.writeln finalPath
|
||||||
if r.s[r.pos] == ')': inc(r.pos)
|
if r.s[r.pos] == ')': inc(r.pos)
|
||||||
outf.write(")\n")
|
outf.write(")\n")
|
||||||
of "INCLUDES":
|
of "INCLUDES":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue