mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-23 07:55: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"
|
||||
* countProcessors()
|
||||
- j
|
||||
`dry-run`:
|
||||
? "don't actually build derivations"
|
||||
run:
|
||||
nixBuildWithCache(name, args, service, jobs)
|
||||
nixBuildWithCache(name, args, service, jobs, `dry-run`)
|
||||
|
||||
[ci]
|
||||
... "builtin ci"
|
||||
|
|
|
@ -312,7 +312,11 @@ proc nixBuildHostDry*(minimal: bool, rest: seq[string]) =
|
|||
cmd.addArg "--dry-run"
|
||||
cmd.addArgs rest
|
||||
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
|
||||
display output
|
||||
|
||||
|
@ -373,7 +377,7 @@ proc prettyDerivation*(path: string): BbString =
|
|||
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
|
||||
if findExe(service) == "": fatalQuit fmt"is {service} installed?"
|
||||
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"
|
||||
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 =
|
||||
collect:
|
||||
|
|
Loading…
Add table
Reference in a new issue