diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-11-07 18:01:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 18:01:28 +0000 |
commit | d0018c61ff03ce2c07137411187a97e473346f50 (patch) | |
tree | c79d4b89457d90598956f42b6d4bcbe0fd7617cc /pkgs/build-support | |
parent | 71f42b7f1a829ebe7819f1c3b516b23ace04dd2e (diff) | |
parent | 1505981287710bea9dd0bea8fda9a0817fb38ddf (diff) | |
download | nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.tar nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.tar.gz nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.tar.bz2 nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.tar.lz nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.tar.xz nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.tar.zst nixpkgs-d0018c61ff03ce2c07137411187a97e473346f50.zip |
Merge staging-next into staging
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/closure-info.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/build-support/closure-info.nix b/pkgs/build-support/closure-info.nix index f6c31bd786b..f2aa4964d9a 100644 --- a/pkgs/build-support/closure-info.nix +++ b/pkgs/build-support/closure-info.nix @@ -21,14 +21,22 @@ stdenv.mkDerivation { nativeBuildInputs = [ coreutils jq ]; + empty = rootPaths == []; + buildCommand = '' out=''${outputs[out]} mkdir $out - jq -r ".closure | map(.narSize) | add" < "$NIX_ATTRS_JSON_FILE" > $out/total-nar-size - jq -r '.closure | map([.path, .narHash, .narSize, "", (.references | length)] + .references) | add | map("\(.)\n") | add' < "$NIX_ATTRS_JSON_FILE" | head -n -1 > $out/registration - jq -r '.closure[].path' < "$NIX_ATTRS_JSON_FILE" > $out/store-paths + if [[ -n "$empty" ]]; then + echo 0 > $out/total-nar-size + touch $out/registration $out/store-paths + else + jq -r ".closure | map(.narSize) | add" < "$NIX_ATTRS_JSON_FILE" > $out/total-nar-size + jq -r '.closure | map([.path, .narHash, .narSize, "", (.references | length)] + .references) | add | map("\(.)\n") | add' < "$NIX_ATTRS_JSON_FILE" | head -n -1 > $out/registration + jq -r '.closure[].path' < "$NIX_ATTRS_JSON_FILE" > $out/store-paths + fi + ''; } |