Fix whereIsTool for cross
This commit is contained in:
parent
bc85a7d9c3
commit
42134fd2a5
@ -1929,7 +1929,7 @@ whereIsTool tool ver@GHCTargetVersion {..} = do
|
||||
whenM (lift $ fmap not $ ghcInstalled ver)
|
||||
$ throwE (NotInstalled GHC ver)
|
||||
bdir <- lift $ ghcupGHCDir ver
|
||||
pure (bdir </> "bin" </> "ghc" <> exeExt)
|
||||
pure (bdir </> "bin" </> ghcBinaryName ver)
|
||||
Cabal -> do
|
||||
whenM (lift $ fmap not $ cabalInstalled _tvVersion)
|
||||
$ throwE (NotInstalled Cabal (GHCTargetVersion Nothing _tvVersion))
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user