mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 06:03:15 -06:00
more cache build changes
This commit is contained in:
parent
84833821d0
commit
076a1c4ebd
1 changed files with 15 additions and 7 deletions
|
@ -180,14 +180,18 @@ type
|
||||||
output: string
|
output: string
|
||||||
name: string
|
name: string
|
||||||
|
|
||||||
# func setStatus(od: var OizysDerivation, toBuild: seq[string], drvs: Table[string, NixDerivation]) =
|
iterator getSystemPathDrvs(drvs: Table[string, NixDerivation]): string =
|
||||||
|
let systemPaths = findSystemPaths(drvs)
|
||||||
|
for p in systemPaths:
|
||||||
|
for d in drvs[p].inputDrvs.keys():
|
||||||
|
yield d
|
||||||
|
|
||||||
proc getOizysDerivations(): seq[OizysDerivation] =
|
proc getOizysDerivations(): seq[OizysDerivation] =
|
||||||
let toBuild = toBuildNixosConfiguration()
|
let toBuild = toBuildNixosConfiguration()
|
||||||
let drvs = evaluateDerivations(nixosConfigAttrs())
|
let drvs = evaluateDerivations(nixosConfigAttrs())
|
||||||
|
|
||||||
for name in toBuild:
|
for name in getSystemPathDrvs(drvs):
|
||||||
if not isIgnored(name):
|
if name in toBuild and not isIgnored(name):
|
||||||
let nixDrv = drvs[name]
|
let nixDrv = drvs[name]
|
||||||
result.add OizysDerivation(
|
result.add OizysDerivation(
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -203,6 +207,7 @@ proc systemPathDrvsToBuild(): seq[string] =
|
||||||
let systemPaths = findSystemPaths(drvs)
|
let systemPaths = findSystemPaths(drvs)
|
||||||
for p in systemPaths:
|
for p in systemPaths:
|
||||||
inputDrvs &= drvs[p].inputDrvs.keys().toSeq()
|
inputDrvs &= drvs[p].inputDrvs.keys().toSeq()
|
||||||
|
|
||||||
(result, _) = filterSeq(inputDrvs, (s) => s in toBuild)
|
(result, _) = filterSeq(inputDrvs, (s) => s in toBuild)
|
||||||
(dropped, result) = filterSeq(result, isIgnored)
|
(dropped, result) = filterSeq(result, isIgnored)
|
||||||
echo "SOMETHING SHOULD HAPPEN HERE!"
|
echo "SOMETHING SHOULD HAPPEN HERE!"
|
||||||
|
@ -283,7 +288,9 @@ proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: i
|
||||||
quit "exiting...", QuitSuccess
|
quit "exiting...", QuitSuccess
|
||||||
|
|
||||||
# TODO: add back reporting to GITHUB SUMMARY
|
# TODO: add back reporting to GITHUB SUMMARY
|
||||||
|
for drv in drvs:
|
||||||
|
echo drv.name
|
||||||
|
quit 1
|
||||||
# include time to build?
|
# include time to build?
|
||||||
var outs: seq[string]
|
var outs: seq[string]
|
||||||
for drv in drvs:
|
for drv in drvs:
|
||||||
|
@ -291,14 +298,15 @@ proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: i
|
||||||
var cmd = "nix build"
|
var cmd = "nix build"
|
||||||
cmd.addArg drv.name & "^*"
|
cmd.addArg drv.name & "^*"
|
||||||
cmd.addArg "--no-link"
|
cmd.addArg "--no-link"
|
||||||
cmd.addArg "--print-out-paths"
|
# cmd.addArg "--print-out-paths"
|
||||||
cmd.addArg "-L"
|
# cmd.addArg "-L"
|
||||||
cmd.addArgs rest
|
cmd.addArgs rest
|
||||||
let buildCode = runCmd(cmd)
|
let buildCode = runCmd(cmd)
|
||||||
if buildCode != 0:
|
if buildCode != 0:
|
||||||
error "failed to build: " & drv.name
|
error "failed to build: " & drv.name
|
||||||
continue
|
continue
|
||||||
info "build duration: " & $(now() - startTime)
|
info "build duration: " & $(now() - startTime)
|
||||||
|
info "---------------------------------------------------------------------------------------------------"
|
||||||
outs &= drv.output
|
outs &= drv.output
|
||||||
|
|
||||||
var cmd = service
|
var cmd = service
|
||||||
|
|
Loading…
Reference in a new issue