fix crash when missing derivation file

The derivation file existed on master, but did not exist on staging.
This commit is contained in:
Ryan Mulligan 2019-03-21 07:13:07 -07:00
parent f652d735ef
commit 3bc08739f0
3 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,7 @@ module OurPrelude
, Text
, Vector
, interpolate
, tshow
) where
import Control.Applicative ((<|>))
@ -26,10 +27,13 @@ import Data.Bifunctor
import Data.Function ((&))
import Data.Semigroup ((<>))
import Data.Set (Set)
import Data.Text (Text)
import Data.Text (Text, pack)
import Data.Vector (Vector)
import Language.Haskell.TH.Quote
import qualified NeatInterpolation
interpolate :: QuasiQuoter
interpolate = NeatInterpolation.text
tshow :: Show a => a -> Text
tshow = show >>> pack

View File

@ -169,8 +169,7 @@ armRebuilds = archRebuilds "aarch64-linux"
outpathReport :: Set ResultLine -> Text
outpathReport diff =
let tshow = show >>> T.pack
pkg = tshow $ V.length $ packageRebuilds diff
let pkg = tshow $ V.length $ packageRebuilds diff
firstFifty = T.unlines $ V.toList $ V.take 50 $ packageRebuilds diff
darwin = tshow $ darwinRebuilds diff
linux = tshow $ linuxRebuilds diff

View File

@ -335,5 +335,5 @@ assertNotUpdatedOn ::
MonadIO m => UpdateEnv -> FilePath -> Text -> ExceptT Text m ()
assertNotUpdatedOn updateEnv derivationFile branch = do
Git.cleanAndResetTo branch
derivationContents <- liftIO $ T.readFile derivationFile
derivationContents <- fmapLT tshow $ tryIO $ T.readFile derivationFile
Nix.assertOldVersionOn updateEnv branch derivationContents