ci/eval: fail on asserts when generating attrpaths
This doesn't fail on *all* asserts, yet, because nix-env still ignores these in the main eval step. But it already gives some converage during the attrpath generation.
This commit is contained in:
+1
-2
@@ -64,8 +64,7 @@ let
|
||||
-I "$src" \
|
||||
--option restrict-eval true \
|
||||
--option allow-import-from-derivation false \
|
||||
--option eval-system "${evalSystem}" \
|
||||
--arg enableWarnings false > $out/paths.json
|
||||
--option eval-system "${evalSystem}" > $out/paths.json
|
||||
'';
|
||||
|
||||
singleSystem =
|
||||
|
||||
@@ -113,12 +113,10 @@ with pkgs;
|
||||
|
||||
stringsWithDeps = lib.stringsWithDeps;
|
||||
|
||||
### Evaluating the entire Nixpkgs naively will fail, make failure fast
|
||||
### Evaluating the entire Nixpkgs naively will likely fail, make failure fast
|
||||
AAAAAASomeThingsFailToEvaluate = throw ''
|
||||
Please be informed that this pseudo-package is not the only part
|
||||
of Nixpkgs that fails to evaluate. You should not evaluate
|
||||
entire Nixpkgs without some special measures to handle failing
|
||||
packages, like using pkgs/top-level/release-attrpaths-superset.nix.
|
||||
This pseudo-package is likely not the only part of Nixpkgs that fails to evaluate.
|
||||
You should not evaluate entire Nixpkgs without measures to handle failing packages.
|
||||
'';
|
||||
|
||||
tests = callPackages ../test { };
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
{
|
||||
lib ? import (path + "/lib"),
|
||||
trace ? false,
|
||||
enableWarnings ? true,
|
||||
checkMeta ? true,
|
||||
path ? ./../..,
|
||||
}:
|
||||
@@ -62,8 +61,10 @@ let
|
||||
justAttrNames =
|
||||
path: value:
|
||||
let
|
||||
attempt =
|
||||
if
|
||||
result =
|
||||
if path == [ "AAAAAASomeThingsFailToEvaluate" ] then
|
||||
[ ]
|
||||
else if
|
||||
lib.isDerivation value
|
||||
&&
|
||||
# in some places we have *derivations* with jobsets as subattributes, ugh
|
||||
@@ -94,17 +95,6 @@ let
|
||||
builtins.attrValues
|
||||
builtins.concatLists
|
||||
];
|
||||
|
||||
seq = builtins.deepSeq attempt attempt;
|
||||
tried = builtins.tryEval seq;
|
||||
|
||||
result =
|
||||
if tried.success then
|
||||
tried.value
|
||||
else if enableWarnings && path != [ "AAAAAASomeThingsFailToEvaluate" ] then
|
||||
lib.warn "tryEval failed at: ${lib.concatStringsSep "." path}" [ ]
|
||||
else
|
||||
[ ];
|
||||
in
|
||||
if !trace then result else lib.trace "** ${lib.concatStringsSep "." path}" result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user