mirror of
https://github.com/NixOS/nix.git
synced 2025-12-03 07:31:00 +01:00
path-info: print correct path when using nix path-info --store file://... --all --json
When querying all paths in a binary cache store, the path's representation is `<hash>-x` (where `x` is the value of `MissingName`) because the .narinfo filenames only contain the hash. Beforecc46ea1630this worked correctly, because the entire path info was read and the path from this representation was printed, i.e. in the form `<hash>-<name>`. Since then however, the direct result from `queryAllValidPaths()` was used as `path`. Added a regression test to make sure the behavior remains correct. (cherry picked from commitc80cd6bb06)
This commit is contained in:
parent
b433176028
commit
cb7beb05cd
2 changed files with 15 additions and 1 deletions
|
|
@ -14,6 +14,14 @@ outPath=$(nix-build dependencies.nix --no-out-link)
|
|||
|
||||
nix copy --to file://$cacheDir $outPath
|
||||
|
||||
readarray -t paths < <(nix path-info --all --json --store file://$cacheDir | jq 'keys|sort|.[]' -r)
|
||||
[[ "${#paths[@]}" -eq 3 ]]
|
||||
for path in "${paths[@]}"; do
|
||||
[[ "$path" =~ -dependencies-input-0$ ]] \
|
||||
|| [[ "$path" =~ -dependencies-input-2$ ]] \
|
||||
|| [[ "$path" =~ -dependencies-top$ ]]
|
||||
done
|
||||
|
||||
# Test copying build logs to the binary cache.
|
||||
expect 1 nix log --store file://$cacheDir $outPath 2>&1 | grep 'is not available'
|
||||
nix store copy-log --to file://$cacheDir $outPath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue