Skip to content

Commit

Permalink
stdenv: check if this fixes laziness issue
Browse files Browse the repository at this point in the history
```
error: cannot coerce null to a string

at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-3/pkgs/development/coq-modules/coq-lsp/default.nix:34:60:

    33|     homepage = "https://github.com/ejgallego/coq-lsp";
    34|     changelog = "https://github.com/ejgallego/coq-lsp/blob/${defaultVersion}/CHANGES.md";
```
  • Loading branch information
Artturin committed Apr 28, 2023
1 parent 77ab6ab commit 58ddcbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pkgs/stdenv/generic/check-meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ let
# -----
else { valid = "yes"; });

assertValidity = { attrs, pos ? null, references ? [] }: let
commonMeta = { validity, attrs, pos ? null, references ? [] }: let
outputs = attrs.outputs or [ "out" ];

# The meta attribute is passed in the resulting attribute set,
Expand Down Expand Up @@ -431,7 +431,9 @@ let
then lib.all (d: d.meta.available or true) references
else true);
};
in meta;

assertValidity = { meta, attrs }: let
validity = checkValidity attrs;
in validity // {
# Throw an error if trying to evaluate a non-valid derivation
Expand All @@ -443,7 +445,6 @@ let
yes = true;
}.${validity.valid};

inherit meta;
};

in assertValidity
in { inherit assertValidity commonMeta; }
3 changes: 2 additions & 1 deletion pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ else let
lib.mapNullable unsafeDerivationToUntrackedOutpath attrs.allowedRequisites;
};

validity = checkMeta { inherit attrs pos references; };
validity = let meta = checkMeta.commonMeta { inherit validity attrs pos references; }; in
(checkMeta.assertValidity { inherit meta attrs; }) // { inherit meta; };

checkedEnv =
let
Expand Down

0 comments on commit 58ddcbb

Please sign in to comment.