show the outs with oizys cache before building

This commit is contained in:
Daylin Morgan 2025-02-03 06:01:25 -06:00
parent e0e393b16e
commit 33007059ce
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 8 additions and 5 deletions

View file

@ -367,6 +367,12 @@ proc reportResults(results: seq[(OizysDerivation, BuildResult)]) =
output.writeLine rows.join("\n")
close output
proc prettyDerivation*(path: string): BbString =
const maxLen = 40
let drv = path.toDerivation()
drv.name.trunc(maxLen) & " " & drv.hash.bb("faint")
proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: int) =
## build individual derivations not cached and push to cache
if findExe(service) == "": fatalQuit fmt"is {service} installed?"
@ -377,6 +383,8 @@ proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: i
info "nothing to build"
quit "exiting...", QuitSuccess
info fmt("building {drvs.len} derivations:\n") & drvs.mapIt(prettyDerivation(it.drv.outputs["out"].path)).join("\n")
let results =
collect:
for drv in drvs:

View file

@ -56,11 +56,6 @@ proc hasNarinfo*(cache: string, path: string): Opt[string] =
finally:
client.close()
proc prettyDerivation(path: string): BbString =
const maxLen = 40
let drv = path.toDerivation()
drv.name.trunc(maxLen) & " " & drv.hash.bb("faint")
proc showNarInfo(s: string): BbString =
let maxWidth = terminalWidth()
result.add "narinfo:"