Fix whereIsTool for cross

This commit is contained in:
2021-07-15 22:38:42 +02:00
parent bc85a7d9c3
commit 42134fd2a5
2 changed files with 14 additions and 1 deletions

View File

@@ -1093,3 +1093,16 @@ ensureDirectories dirs = do
createDirRecursive' logsDir
createDirRecursive' confDir
pure ()
-- | For ghc without arch triple, this is:
--
-- - ghc-<ver> (e.g. ghc-8.10.4)
--
-- For ghc with arch triple:
--
-- - <triple>-ghc-<ver> (e.g. arm-linux-gnueabihf-ghc-8.10.4)
ghcBinaryName :: GHCTargetVersion -> String
ghcBinaryName (GHCTargetVersion (Just t) v') = T.unpack (t <> "-ghc-" <> prettyVer v' <> T.pack exeExt)
ghcBinaryName (GHCTargetVersion Nothing v') = T.unpack ("ghc-" <> prettyVer v' <> T.pack exeExt)