Report bad default values which would have cause a build failure if they
were used to build a NixOS system. svn path=/nixpkgs/trunk/; revision=17286
This commit is contained in:
parent
854293fc7b
commit
6041b78fa4
@ -235,6 +235,12 @@ rec {
|
|||||||
# the set generated with filterOptionSets.
|
# the set generated with filterOptionSets.
|
||||||
optionAttrSetToDocList = ignore: newOptionAttrSetToDocList;
|
optionAttrSetToDocList = ignore: newOptionAttrSetToDocList;
|
||||||
newOptionAttrSetToDocList = attrs:
|
newOptionAttrSetToDocList = attrs:
|
||||||
|
let tryEval = v:
|
||||||
|
let res = builtins.tryEval v; in
|
||||||
|
if builtins ? tryEval then
|
||||||
|
if res.success then res.value else "<error>"
|
||||||
|
else v;
|
||||||
|
in
|
||||||
let options = collect isOption attrs; in
|
let options = collect isOption attrs; in
|
||||||
fold (opt: rest:
|
fold (opt: rest:
|
||||||
let
|
let
|
||||||
@ -246,8 +252,8 @@ rec {
|
|||||||
declarations = map (x: toString x.source) opt.declarations;
|
declarations = map (x: toString x.source) opt.declarations;
|
||||||
definitions = map (x: toString x.source) opt.definitions;
|
definitions = map (x: toString x.source) opt.definitions;
|
||||||
}
|
}
|
||||||
// (if opt ? example then {inherit(opt) example;} else {})
|
// optionalAttrs (opt ? example) { example = tryEval opt.example; }
|
||||||
// (if opt ? default then {inherit(opt) default;} else {});
|
// optionalAttrs (opt ? default) { default = tryEval opt.default; };
|
||||||
|
|
||||||
subOptions =
|
subOptions =
|
||||||
if opt ? options then
|
if opt ? options then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user