File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,24 @@ def _ghc_bindist_impl(ctx):
74
74
bindists = bindist [target ]
75
75
dist = ctx .attr .dist .get (target )
76
76
if dist :
77
- bindists = [bindist for bindist in bindists if bindist ["dist" ] == dist ]
78
- if not bindists :
79
- fail ("no GHC bindist found with specified `dist` of `{}`" .format (dist ))
77
+ filtered_bindists = [bindist for bindist in bindists if bindist ["dist" ] == dist ]
78
+ if not filtered_bindists :
79
+ fail ("no GHC bindist found with specified `dist` of `{}`\n available dists: {}" .format (
80
+ dist ,
81
+ ", " .join (sorted ([bindist ["dist" ] for bindist in bindists ])),
82
+ ))
83
+ bindists = filtered_bindists
80
84
81
85
variant = ctx .attr .variant .get (target )
82
86
if variant :
83
- bindists = [bindist for bindist in bindists if bindist .get ("variant" ) == variant ]
84
- if not bindists :
85
- fail ("no GHC bindist found with specified `dist` of `{}`" .format (dist ))
87
+ filtered_bindists = [bindist for bindist in bindists if bindist .get ("variant" ) == variant ]
88
+ if not filtered_bindists :
89
+ fail ("no GHC bindist found with specified `variant` of `{}`\n available dists{}: {}" .format (
90
+ variant ,
91
+ " (where `dist` == {})" .format (dist ) if dist else "" ,
92
+ ", " .join (sorted ([bindist .get ("variant" , "(none)" ) for bindist in bindists ])),
93
+ ))
94
+ bindists = filtered_bindists
86
95
87
96
if len (bindists ) > 1 :
88
97
dists = [bindist ["dist" ] for bindist in bindists ]
You can’t perform that action at this time.
0 commit comments