bug fixes with sfMainModule, hints, mainPackageNotes, mainPackageId, hintSuccessX (#14555)
* SuccessX `out` now works with --compileOnly and jsonscript; fix bugs in jsonscript * several bug fixes; eg: `nim doc lib/system/io` now is sane * dummy edit to force docs CI
This commit is contained in:
parent
4ba34522f6
commit
01f6e505c8
8 changed files with 70 additions and 25 deletions
|
|
@ -66,8 +66,7 @@ when not defined(leanCompiler):
|
|||
compileProject(graph)
|
||||
finishDoc2Pass(graph.config.projectName)
|
||||
|
||||
proc commandCompileToC(graph: ModuleGraph) =
|
||||
let conf = graph.config
|
||||
proc setOutFile(conf: ConfigRef) =
|
||||
if conf.outFile.isEmpty:
|
||||
let base = conf.projectName
|
||||
let targetName = if optGenDynLib in conf.globalOptions:
|
||||
|
|
@ -76,6 +75,9 @@ proc commandCompileToC(graph: ModuleGraph) =
|
|||
base & platform.OS[conf.target.targetOS].exeExt
|
||||
conf.outFile = RelativeFile targetName
|
||||
|
||||
proc commandCompileToC(graph: ModuleGraph) =
|
||||
let conf = graph.config
|
||||
setOutFile(conf)
|
||||
extccomp.initVars(conf)
|
||||
semanticPasses(graph)
|
||||
registerPass(graph, cgenPass)
|
||||
|
|
@ -370,6 +372,7 @@ proc mainCommand*(graph: ModuleGraph) =
|
|||
conf.cmd = cmdDump
|
||||
of "jsonscript":
|
||||
conf.cmd = cmdJsonScript
|
||||
setOutFile(graph.config)
|
||||
commandJsonScript(graph)
|
||||
elif commandAlreadyProcessed: discard # already handled
|
||||
else:
|
||||
|
|
@ -386,7 +389,15 @@ proc mainCommand*(graph: ModuleGraph) =
|
|||
else: "Debug"
|
||||
let sec = formatFloat(epochTime() - conf.lastCmdTime, ffDecimal, 3)
|
||||
let project = if optListFullPaths in conf.globalOptions: $conf.projectFull else: $conf.projectName
|
||||
var output = $conf.absOutFile
|
||||
|
||||
var output: string
|
||||
if optCompileOnly in conf.globalOptions and conf.cmd != cmdJsonScript:
|
||||
output = $conf.jsonBuildFile
|
||||
elif conf.outFile.isEmpty and conf.cmd notin {cmdJsonScript, cmdCompileToBackend, cmdDoc}:
|
||||
# for some cmd we expect a valid absOutFile
|
||||
output = "unknownOutput"
|
||||
else:
|
||||
output = $conf.absOutFile
|
||||
if optListFullPaths notin conf.globalOptions: output = output.AbsoluteFile.extractFilename
|
||||
rawMessage(conf, hintSuccessX, [
|
||||
"loc", loc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue