Non deterministic failures should not be deferred (#1075)
It looks like `callCabalProjectToNix` can fail in its `cabal` call with the following error:
```
open: permission denied (Permission denied)
```
Then running the same derivation locally works. If the error is deferred there is no easy way on hydra to retry.
This change makes it so only solvers errors (which should hopefully be deterministic) are deferred. All other errors will go back to being eval time errors meaning they should be automatically retried at the next hydra eval.
commitdff62ec5bdaeb058ec68a08919008852f53f29bd
authorHamish Mackenzie <Hamish.Mackenzie@iohk.io>
dateThu 18 Mar 2021, 19:45 (6 years ago)
parent962ecfe
lib/call-cabal-project-to-nix.nix+6
@@ -528,6 +528,12 @@ let
528528 # move pkgs.nix to default.nix ensure we can just nix `import` the result.
529529 mv $out${subDir'}/pkgs.nix $out${subDir'}/default.nix
530530 else
531+ # Check that this was a solver failure that (not some other
532+ # possibly non deterministic failure).
533+ # TODO replace grep once https://github.com/haskell/cabal/issues/5191
534+ # is fixed.
535+ grep "cabal: Could not resolve dependencies" cabal-configure.out
536+
531537 # When cabal configure fails copy the output that we captured above and
532538 # use `failed-cabal-configure.nix` to make a suitable derviation with.
533539 cp cabal-configure.out $out