Merge branch 'PR/82' into master
This commit is contained in:
commit
cd1dd8c29e
15
lib/GHCup.hs
15
lib/GHCup.hs
@ -74,7 +74,7 @@ import Prelude hiding ( abs
|
|||||||
)
|
)
|
||||||
import Safe hiding ( at )
|
import Safe hiding ( at )
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import System.Posix.Env.ByteString ( getEnvironment )
|
import System.Posix.Env.ByteString ( getEnvironment, getEnv )
|
||||||
import System.Posix.FilePath ( getSearchPath, takeExtension )
|
import System.Posix.FilePath ( getSearchPath, takeExtension )
|
||||||
import System.Posix.Files.ByteString
|
import System.Posix.Files.ByteString
|
||||||
import Text.Regex.Posix
|
import Text.Regex.Posix
|
||||||
@ -134,10 +134,23 @@ installGHCBindist dlinfo ver pfreq = do
|
|||||||
-- prepare paths
|
-- prepare paths
|
||||||
ghcdir <- lift $ ghcupGHCDir tver
|
ghcdir <- lift $ ghcupGHCDir tver
|
||||||
|
|
||||||
|
toolchainSanityChecks
|
||||||
|
|
||||||
liftE $ installPackedGHC dl (view dlSubdir dlinfo) ghcdir ver pfreq
|
liftE $ installPackedGHC dl (view dlSubdir dlinfo) ghcdir ver pfreq
|
||||||
|
|
||||||
liftE $ postGHCInstall tver
|
liftE $ postGHCInstall tver
|
||||||
|
|
||||||
|
where
|
||||||
|
toolchainSanityChecks = do
|
||||||
|
r <- forM ["CC", "LD"] (liftIO . getEnv)
|
||||||
|
case catMaybes r of
|
||||||
|
[] -> pure ()
|
||||||
|
_ -> do
|
||||||
|
lift $ $(logWarn) "CC/LD environment variable is set. This will change the compiler/linker"
|
||||||
|
lift $ $(logWarn) "GHC uses internally and can cause defunct GHC in some cases (e.g. in Anaconda"
|
||||||
|
lift $ $(logWarn) "environments). If you encounter problems, unset CC and LD and reinstall."
|
||||||
|
|
||||||
|
|
||||||
-- | Install a packed GHC distribution. This only deals with unpacking and the GHC
|
-- | Install a packed GHC distribution. This only deals with unpacking and the GHC
|
||||||
-- build system and nothing else.
|
-- build system and nothing else.
|
||||||
installPackedGHC :: ( MonadMask m
|
installPackedGHC :: ( MonadMask m
|
||||||
|
Loading…
Reference in New Issue
Block a user