File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 3535 ( a : b : builtins . elem b . id a . before || builtins . elem a . id b . after )
3636 ( builtins . attrValues enabledHooks ) ;
3737 in
38- builtins . map ( value : value . raw ) sortedHooks . result ;
38+ if sortedHooks ? result then
39+ builtins . map ( value : value . raw ) sortedHooks . result
40+ else
41+ let
42+ getIds = builtins . map ( value : value . id ) ;
43+
44+ prettyPrintCycle = opts : cycle :
45+ lib . pipe cycle [
46+ ( builtins . map ( hook :
47+ lib . nameValuePair hook . id { before = hook . before ; after = hook . after ; }
48+ ) )
49+ lib . listToAttrs
50+ ( lib . generators . toPretty opts )
51+ ] ;
52+ in
53+ throw ''
54+ The hooks can't be sorted because of a cycle in the dependency graph:
55+
56+ ${ concatStringsSep " -> " ( getIds sortedHooks . cycle ) }
57+
58+ which leads to a loop back to: ${ concatStringsSep ", " ( getIds sortedHooks . loops ) }
59+
60+ Try removing the conflicting hook ids from the `before` and `after` attributes of these hooks:
61+
62+ ${ prettyPrintCycle { indent = " " ; } sortedHooks . cycle }
63+ '' ;
3964
4065 configFile =
4166 performAssertions (
You can’t perform that action at this time.
0 commit comments