Commit 81d217ae authored by Valentin Reis's avatar Valentin Reis
Browse files

return the right output dir on failure

parent ae2618f1
Pipeline #5887 passed with stages
in 27 seconds
...@@ -358,7 +358,7 @@ setupSystem target sa = do ...@@ -358,7 +358,7 @@ setupSystem target sa = do
when (isTarget target) $ setupNodeOs envVars when (isTarget target) $ setupNodeOs envVars
return (envVars, varXDG_CACHE_HOME) return (envVars, varTMPDIR)
where where
getVars :: [Text] -> IO [(Text, Text)] getVars :: [Text] -> IO [(Text, Text)]
getVars vars = catMaybes <$> mapM maybeGet vars getVars vars = catMaybes <$> mapM maybeGet vars
...@@ -409,7 +409,7 @@ nixArguments target ArgsCommon {..} = ...@@ -409,7 +409,7 @@ nixArguments target ArgsCommon {..} =
wrap :: NixCommand -> Text -> ArgsCommon -> IO () wrap :: NixCommand -> Text -> ArgsCommon -> IO ()
wrap nixCommand target sa@ArgsCommon {..} = do wrap nixCommand target sa@ArgsCommon {..} = do
when (verbosity == Verbose) $ print sa when (verbosity == Verbose) $ print sa
(envVars, tmpXDGHOME) <- setupSystem target sa (envVars, tmpDir) <- setupSystem target sa
putText $ nixc <> " " <> T.unwords arglist putText $ nixc <> " " <> T.unwords arglist
case nixCommand of case nixCommand of
NixShell -> executeFile (toS nixc) True (fmap toS arglist) Nothing NixShell -> executeFile (toS nixc) True (fmap toS arglist) Nothing
...@@ -421,7 +421,7 @@ wrap nixCommand target sa@ArgsCommon {..} = do ...@@ -421,7 +421,7 @@ wrap nixCommand target sa@ArgsCommon {..} = do
>>= \case >>= \case
ExitSuccess -> copySuccess "/tmp/papa" ExitSuccess -> copySuccess "/tmp/papa"
ExitFailure _ -> ExitFailure _ ->
copyFailure (toS tmpXDGHOME) >> die "build failed." copyFailure (toS tmpDir) >> die "build failed."
where where
copySuccess source = copySuccess source =
runProcessVerbose verbosity "cp" ["-r", source, "./result"] [] runProcessVerbose verbosity "cp" ["-r", source, "./result"] []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment