Skip to content
Snippets Groups Projects
Verified Commit 62005f83 authored by Julian Ospald's avatar Julian Ospald :tea:
Browse files

Improve debug info

parent eaafd77a
No related branches found
No related tags found
No related merge requests found
......@@ -750,7 +750,7 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
liftE $ getDebugInfo
)
>>= \case
VRight dinfo -> putStrLn $ show dinfo
VRight dinfo -> putStrLn $ prettyDebugInfo dinfo
VLeft e ->
runLogger ($(logError) [i|#{e}|]) >> exitFailure
......@@ -891,3 +891,24 @@ checkForUpdates dls = do
when (l > ghc_ver)
$ $(logWarn)
[i|New GHCup version available: #{prettyVer l}. To upgrade, run 'ghcup upgrade'|]
prettyDebugInfo :: DebugInfo -> String
prettyDebugInfo DebugInfo {..} = [i|Debug Info
==========
GHCup base dir: #{toFilePath diBaseDir}
GHCup bin dir: #{toFilePath diBinDir}
GHCup GHC directory: #{toFilePath diGHCDir}
GHCup cache directory: #{toFilePath diCacheDir}
Architecture: #{prettyArch diArch}
Platform: #{prettyPlatform diPlatform}
Version: #{describe_result}|]
where
prettyArch :: Architecture -> String
prettyArch A_64 = "amd64"
prettyArch A_32 = "i386"
prettyPlatform :: PlatformResult -> String
prettyPlatform PlatformResult { _platform = plat, _distroVersion = Just v' }
= show plat <> ", " <> show v'
prettyPlatform PlatformResult { _platform = plat, _distroVersion = Nothing }
= show plat
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment