Compare commits
7 Commits
issue-180
...
stack-2.7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
bbbe52f453
|
|||
|
7a2570019a
|
|||
|
c5b4e82b48
|
|||
|
4ed72fb517
|
|||
|
5217aa0a1d
|
|||
|
eb26a5133f
|
|||
|
9e9402a3a2
|
@@ -1930,14 +1930,15 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
let vi = getVersionInfo (_tvVersion targetVer) GHC dls
|
let vi = getVersionInfo (_tvVersion targetVer) GHC dls
|
||||||
when setCompile $ void $ liftE $
|
when setCompile $ void $ liftE $
|
||||||
setGHC targetVer SetGHCOnly
|
setGHC targetVer SetGHCOnly
|
||||||
pure vi
|
pure (vi, targetVer)
|
||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight vi -> do
|
VRight (vi, tv) -> do
|
||||||
runLogger $ $(logInfo)
|
runLogger $ $(logInfo)
|
||||||
"GHC successfully compiled and installed"
|
"GHC successfully compiled and installed"
|
||||||
forM_ (_viPostInstall =<< vi) $ \msg ->
|
forM_ (_viPostInstall =<< vi) $ \msg ->
|
||||||
runLogger $ $(logInfo) msg
|
runLogger $ $(logInfo) msg
|
||||||
|
putStr (T.unpack $ tVerToText tv)
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft (V (AlreadyInstalled _ v)) -> do
|
||||||
runLogger $ $(logWarn)
|
runLogger $ $(logWarn)
|
||||||
|
|||||||
@@ -2155,14 +2155,13 @@ ghcupDownloads:
|
|||||||
unknown_versioning: *stack-251-64
|
unknown_versioning: *stack-251-64
|
||||||
2.7.1:
|
2.7.1:
|
||||||
viTags:
|
viTags:
|
||||||
- Recommended
|
- old
|
||||||
- Latest
|
|
||||||
viChangeLog: https://github.com/commercialhaskell/stack/blob/master/ChangeLog.md#v271
|
viChangeLog: https://github.com/commercialhaskell/stack/blob/master/ChangeLog.md#v271
|
||||||
viPostInstall: *stack-post
|
viPostInstall: *stack-post
|
||||||
viArch:
|
viArch:
|
||||||
A_64:
|
A_64:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning: &stack-64
|
unknown_versioning: &stack-271-64
|
||||||
dlUri: https://github.com/commercialhaskell/stack/releases/download/v2.7.1/stack-2.7.1-linux-x86_64.tar.gz
|
dlUri: https://github.com/commercialhaskell/stack/releases/download/v2.7.1/stack-2.7.1-linux-x86_64.tar.gz
|
||||||
dlHash: 2bc47749ee4be5eccb52a2d4a6a00b0f3b28b92517742b40c675836d7db2777d
|
dlHash: 2bc47749ee4be5eccb52a2d4a6a00b0f3b28b92517742b40c675836d7db2777d
|
||||||
dlSubdir:
|
dlSubdir:
|
||||||
@@ -2180,5 +2179,33 @@ ghcupDownloads:
|
|||||||
dlSubdir:
|
dlSubdir:
|
||||||
RegexDir: "stack-.*"
|
RegexDir: "stack-.*"
|
||||||
Linux_Alpine:
|
Linux_Alpine:
|
||||||
unknown_versioning: *stack-64
|
unknown_versioning: *stack-271-64
|
||||||
|
2.7.3:
|
||||||
|
viTags:
|
||||||
|
- Latest
|
||||||
|
- Recommended
|
||||||
|
viChangeLog: https://github.com/commercialhaskell/stack/blob/master/ChangeLog.md#v273
|
||||||
|
viPostInstall: *stack-post
|
||||||
|
viArch:
|
||||||
|
A_64:
|
||||||
|
Linux_UnknownLinux:
|
||||||
|
unknown_versioning: &stack-273-64
|
||||||
|
dlUri: https://github.com/commercialhaskell/stack/releases/download/v2.7.3/stack-2.7.3-linux-x86_64.tar.gz
|
||||||
|
dlHash: a6c090555fa1c64aa61c29aa4449765a51d79e870cf759cde192937cd614e72b
|
||||||
|
dlSubdir:
|
||||||
|
RegexDir: "stack-.*"
|
||||||
|
Darwin:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://github.com/commercialhaskell/stack/releases/download/v2.7.3/stack-2.7.3-osx-x86_64.tar.gz
|
||||||
|
dlHash: 42e5000a00af44a7b26852421ac63ce75f510ad1a97742cb131107088ee9fe30
|
||||||
|
dlSubdir:
|
||||||
|
RegexDir: "stack-.*"
|
||||||
|
Windows:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://github.com/commercialhaskell/stack/releases/download/v2.7.3/stack-2.7.3-windows-x86_64.tar.gz
|
||||||
|
dlHash: e6ba12e0ecabf0df2567d88a0d247da238bc114bcccfca4195f5e86472c9330c
|
||||||
|
dlSubdir:
|
||||||
|
RegexDir: "stack-.*"
|
||||||
|
Linux_Alpine:
|
||||||
|
unknown_versioning: *stack-273-64
|
||||||
|
|
||||||
|
|||||||
30
lib/GHCup.hs
30
lib/GHCup.hs
@@ -77,6 +77,9 @@ import System.Directory hiding ( findFiles )
|
|||||||
import System.Environment
|
import System.Environment
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
|
#if defined(IS_WINDOWS)
|
||||||
|
import System.IO.Temp
|
||||||
|
#endif
|
||||||
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
||||||
import Text.Regex.Posix
|
import Text.Regex.Posix
|
||||||
|
|
||||||
@@ -249,6 +252,22 @@ installPackedGHC :: ( MonadMask m
|
|||||||
#endif
|
#endif
|
||||||
] m ()
|
] m ()
|
||||||
installPackedGHC dl msubdir inst ver = do
|
installPackedGHC dl msubdir inst ver = do
|
||||||
|
#if defined(IS_WINDOWS)
|
||||||
|
lift $ $(logInfo) "Installing GHC (this may take a while)"
|
||||||
|
|
||||||
|
Dirs { tmpDir } <- lift getDirs
|
||||||
|
unpackDir <- liftIO $ emptyTempFile tmpDir "ghc"
|
||||||
|
liftIO $ rmFile unpackDir
|
||||||
|
|
||||||
|
liftE $ unpackToDir unpackDir dl
|
||||||
|
|
||||||
|
d <- case msubdir of
|
||||||
|
Just td -> liftE $ intoSubdir unpackDir td
|
||||||
|
Nothing -> pure unpackDir
|
||||||
|
|
||||||
|
liftIO $ Win32.moveFileEx d (Just inst) 0
|
||||||
|
liftIO $ rmPath unpackDir
|
||||||
|
#else
|
||||||
PlatformRequest {..} <- lift getPlatformReq
|
PlatformRequest {..} <- lift getPlatformReq
|
||||||
|
|
||||||
-- unpack
|
-- unpack
|
||||||
@@ -264,6 +283,7 @@ installPackedGHC dl msubdir inst ver = do
|
|||||||
liftE $ runBuildAction tmpUnpack
|
liftE $ runBuildAction tmpUnpack
|
||||||
(Just inst)
|
(Just inst)
|
||||||
(installUnpackedGHC workdir inst ver)
|
(installUnpackedGHC workdir inst ver)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
-- | Install an unpacked GHC distribution. This only deals with the GHC
|
-- | Install an unpacked GHC distribution. This only deals with the GHC
|
||||||
@@ -280,13 +300,6 @@ installUnpackedGHC :: ( MonadReader env m
|
|||||||
-> FilePath -- ^ Path to install to
|
-> FilePath -- ^ Path to install to
|
||||||
-> Version -- ^ The GHC version
|
-> Version -- ^ The GHC version
|
||||||
-> Excepts '[ProcessError] m ()
|
-> Excepts '[ProcessError] m ()
|
||||||
#if defined(IS_WINDOWS)
|
|
||||||
installUnpackedGHC path inst _ = do
|
|
||||||
lift $ $(logInfo) "Installing GHC (this may take a while)"
|
|
||||||
-- windows bindists are relocatable and don't need
|
|
||||||
-- to run configure
|
|
||||||
liftIO $ copyDirectoryRecursive path inst
|
|
||||||
#else
|
|
||||||
installUnpackedGHC path inst ver = do
|
installUnpackedGHC path inst ver = do
|
||||||
PlatformRequest {..} <- lift getPlatformReq
|
PlatformRequest {..} <- lift getPlatformReq
|
||||||
|
|
||||||
@@ -309,7 +322,6 @@ installUnpackedGHC path inst ver = do
|
|||||||
Nothing
|
Nothing
|
||||||
lEM $ make ["install"] (Just path)
|
lEM $ make ["install"] (Just path)
|
||||||
pure ()
|
pure ()
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
-- | Installs GHC into @~\/.ghcup\/ghc/\<ver\>@ and places the
|
-- | Installs GHC into @~\/.ghcup\/ghc/\<ver\>@ and places the
|
||||||
@@ -1495,6 +1507,7 @@ rmGhcupDirs = do
|
|||||||
, binDir
|
, binDir
|
||||||
, logsDir
|
, logsDir
|
||||||
, cacheDir
|
, cacheDir
|
||||||
|
, tmpDir
|
||||||
} <- getDirs
|
} <- getDirs
|
||||||
|
|
||||||
let envFilePath = baseDir </> "env"
|
let envFilePath = baseDir </> "env"
|
||||||
@@ -1506,6 +1519,7 @@ rmGhcupDirs = do
|
|||||||
rmDir cacheDir
|
rmDir cacheDir
|
||||||
rmDir logsDir
|
rmDir logsDir
|
||||||
rmBinDir binDir
|
rmBinDir binDir
|
||||||
|
rmDir tmpDir
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
rmDir (baseDir </> "msys64")
|
rmDir (baseDir </> "msys64")
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ data Dirs = Dirs
|
|||||||
, cacheDir :: FilePath
|
, cacheDir :: FilePath
|
||||||
, logsDir :: FilePath
|
, logsDir :: FilePath
|
||||||
, confDir :: FilePath
|
, confDir :: FilePath
|
||||||
|
, tmpDir :: FilePath
|
||||||
}
|
}
|
||||||
deriving (Show, GHC.Generic)
|
deriving (Show, GHC.Generic)
|
||||||
|
|
||||||
|
|||||||
@@ -1086,19 +1086,14 @@ ensureGlobalTools = do
|
|||||||
|
|
||||||
-- | Ensure ghcup directory structure exists.
|
-- | Ensure ghcup directory structure exists.
|
||||||
ensureDirectories :: Dirs -> IO ()
|
ensureDirectories :: Dirs -> IO ()
|
||||||
ensureDirectories dirs = do
|
ensureDirectories (Dirs baseDir binDir cacheDir logsDir confDir tmpDir) = do
|
||||||
let Dirs
|
|
||||||
{ baseDir
|
|
||||||
, binDir
|
|
||||||
, cacheDir
|
|
||||||
, logsDir
|
|
||||||
, confDir
|
|
||||||
} = dirs
|
|
||||||
createDirRecursive' baseDir
|
createDirRecursive' baseDir
|
||||||
|
createDirRecursive' (baseDir </> "ghc")
|
||||||
createDirRecursive' binDir
|
createDirRecursive' binDir
|
||||||
createDirRecursive' cacheDir
|
createDirRecursive' cacheDir
|
||||||
createDirRecursive' logsDir
|
createDirRecursive' logsDir
|
||||||
createDirRecursive' confDir
|
createDirRecursive' confDir
|
||||||
|
createDirRecursive' tmpDir
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -191,6 +191,15 @@ ghcupLogsDir = do
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
-- | Defaults to '~/.ghcup/tmp.
|
||||||
|
--
|
||||||
|
-- If 'GHCUP_USE_XDG_DIRS' is set (to anything),
|
||||||
|
-- then uses 'XDG_DATA_HOME/ghcup/tmp' as per xdg spec.
|
||||||
|
ghcupTmpDir :: IO FilePath
|
||||||
|
ghcupTmpDir = ghcupBaseDir <&> (</> "tmp")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getAllDirs :: IO Dirs
|
getAllDirs :: IO Dirs
|
||||||
getAllDirs = do
|
getAllDirs = do
|
||||||
baseDir <- ghcupBaseDir
|
baseDir <- ghcupBaseDir
|
||||||
@@ -198,6 +207,7 @@ getAllDirs = do
|
|||||||
cacheDir <- ghcupCacheDir
|
cacheDir <- ghcupCacheDir
|
||||||
logsDir <- ghcupLogsDir
|
logsDir <- ghcupLogsDir
|
||||||
confDir <- ghcupConfigDir
|
confDir <- ghcupConfigDir
|
||||||
|
tmpDir <- ghcupTmpDir
|
||||||
pure Dirs { .. }
|
pure Dirs { .. }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="command-button"><pre><span class='ghcup-command'>Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true</span></span></pre><button class="tooltip" onclick="copyToClipboardPowershell()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button>
|
<div class="command-button"><pre><span class='ghcup-command'>Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true</span></span></pre><button class="tooltip" onclick="copyToClipboardPowershell()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button>
|
||||||
</div>
|
</div>
|
||||||
<p class="other-help">If you want to run an interactive installation, change <span class='code'>$true</span> to <span class='code'>$false</span> at the end of the script.</p>
|
<p class="other-help">If you want to run an non-interactive installation, change <span class='code'>$true</span> to <span class='code'>$false</span> at the end of the script.</p>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<p>If you're a Windows Subsystem 2 for Linux user run the following in your terminal, then follow the onscreen instructions to install Haskell.
|
<p>If you're a Windows Subsystem 2 for Linux user run the following in your terminal, then follow the onscreen instructions to install Haskell.
|
||||||
|
|||||||
Reference in New Issue
Block a user