Skip to content

Commit

Permalink
fix: make build proviso much more robust
Browse files Browse the repository at this point in the history
The latest nix-uncached provides a more efficient schema which allows
us to make a single call and still query the entire dependency closure
for each path passed.

This will now capture any uncached dependencies even for derivations
which are typically built locally, such as a NixOS system.

x-ref: divnix/nix-uncached#1
  • Loading branch information
nrdxp authored and blaggacao committed Jan 24, 2023
1 parent 42db376 commit d82c902
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/actions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@
local -a uncached
# FIXME: merge upstream to avoid any need for runtime context
command nix build github:divnix/nix-uncached/v2.12.1
command nix build github:divnix/nix-uncached/v2.13.1
drvs="$(command jq -r '.targetDrv | select(. != "null")' <<< "''${input[@]}")"
drvs=$(command jq -r '.targetDrv | select(. != "null")' <<< "''${input[@]}")
mapfile -t uncached < <(command nix show-derivation $drvs | jq -r '.[].outputs.out.path' | result/bin/nix-uncached)
uncached_json=$(result/bin/nix-uncached $drvs)
if [[ -n ''${uncached[*]} ]]; then
mapfile -t uncached < <(command nix show-derivation ''${uncached[@]} \
| command jq -r '.| to_entries[] | select(.value|.env.preferLocalBuild != "1") | .key')
fi
mapfile -t uncached < <(command jq -r 'to_entries[]|select(.value == [])|.key' <<< "$uncached_json")
if [[ -n ''${uncached[*]} ]]; then
local list filtered
Expand Down

0 comments on commit d82c902

Please sign in to comment.