mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-23 12:05:50 -06:00
add dry-run to oizys cache
This commit is contained in:
parent
406ef53fec
commit
a8df050426
2 changed files with 12 additions and 4 deletions
|
@ -70,8 +70,10 @@ hwylCli:
|
||||||
? "jobs when pushing paths"
|
? "jobs when pushing paths"
|
||||||
* countProcessors()
|
* countProcessors()
|
||||||
- j
|
- j
|
||||||
|
`dry-run`:
|
||||||
|
? "don't actually build derivations"
|
||||||
run:
|
run:
|
||||||
nixBuildWithCache(name, args, service, jobs)
|
nixBuildWithCache(name, args, service, jobs, `dry-run`)
|
||||||
|
|
||||||
[ci]
|
[ci]
|
||||||
... "builtin ci"
|
... "builtin ci"
|
||||||
|
|
|
@ -312,7 +312,11 @@ proc nixBuildHostDry*(minimal: bool, rest: seq[string]) =
|
||||||
cmd.addArg "--dry-run"
|
cmd.addArg "--dry-run"
|
||||||
cmd.addArgs rest
|
cmd.addArgs rest
|
||||||
let (_, err) =
|
let (_, err) =
|
||||||
runCmdCaptWithSpinner(cmd, "evaluating derivation for: " & getHosts().join(" ").bb("bold"), {CaptStderr})
|
runCmdCaptWithSpinner(
|
||||||
|
cmd,
|
||||||
|
"evaluating derivation for: " & getHosts().join(" ").bb("bold"),
|
||||||
|
{CaptStderr}
|
||||||
|
)
|
||||||
let output = parseDryRunOutput err
|
let output = parseDryRunOutput err
|
||||||
display output
|
display output
|
||||||
|
|
||||||
|
@ -373,7 +377,7 @@ proc prettyDerivation*(path: string): BbString =
|
||||||
drv.name.trunc(maxLen) & " " & drv.hash.bb("faint")
|
drv.name.trunc(maxLen) & " " & drv.hash.bb("faint")
|
||||||
|
|
||||||
|
|
||||||
proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: int) =
|
proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: int, dry: bool) =
|
||||||
## build individual derivations not cached and push to cache
|
## build individual derivations not cached and push to cache
|
||||||
if findExe(service) == "": fatalQuit fmt"is {service} installed?"
|
if findExe(service) == "": fatalQuit fmt"is {service} installed?"
|
||||||
info bbfmt"building and pushing to cache: [b]{name}"
|
info bbfmt"building and pushing to cache: [b]{name}"
|
||||||
|
@ -383,7 +387,9 @@ proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: i
|
||||||
info "nothing to build"
|
info "nothing to build"
|
||||||
quit "exiting...", QuitSuccess
|
quit "exiting...", QuitSuccess
|
||||||
|
|
||||||
info fmt("building {drvs.len} derivations:\n") & drvs.mapIt(prettyDerivation(it.drv.outputs["out"].path)).join("\n")
|
info fmt("need to build {drvs.len} derivations:\n") & drvs.mapIt(prettyDerivation(" " & it.drv.outputs["out"].path)).join("\n")
|
||||||
|
if dry:
|
||||||
|
quit "exiting...", QuitSuccess
|
||||||
|
|
||||||
let results =
|
let results =
|
||||||
collect:
|
collect:
|
||||||
|
|
Loading…
Add table
Reference in a new issue