Copyright | (c) Julian Ospald 2020 |
---|---|
License | LGPL-3.0 |
Maintainer | hasufell@hasufell.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module contains the main functions that correspond to the command line interface, like installation, listing versions and so on.
These are the entry points.
Synopsis
- fetchToolBindist :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => GHCTargetVersion -> Tool -> Maybe FilePath -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload] m FilePath
- rmTool :: (MonadReader env m, HasDirs env, HasLog env, MonadFail m, MonadMask m, MonadUnliftIO m) => ListResult -> Excepts '[NotInstalled, UninstallFailed] m ()
- rmGhcup :: (MonadReader env m, HasDirs env, MonadIO m, MonadCatch m, HasLog env, MonadMask m, MonadUnliftIO m) => m ()
- rmGhcupDirs :: (MonadReader env m, HasDirs env, MonadIO m, HasLog env, MonadCatch m, MonadMask m) => m [FilePath]
- getDebugInfo :: (Alternative m, MonadFail m, MonadReader env m, HasDirs env, HasLog env, MonadCatch m, MonadIO m) => Excepts '[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] m DebugInfo
- upgradeGHCup :: (MonadMask m, MonadReader env m, HasDirs env, HasPlatformReq env, HasGHCupInfo env, HasSettings env, MonadCatch m, HasLog env, MonadThrow m, MonadFail m, MonadResource m, MonadIO m, MonadUnliftIO m) => Maybe FilePath -> Bool -> Bool -> Excepts '[CopyError, DigestError, ContentLengthError, GPGError, GPGError, DownloadFailed, NoDownload, NoUpdate, ToolShadowed] m Version
- upgradeGHCup' :: (MonadMask m, MonadReader env m, HasDirs env, HasPlatformReq env, HasGHCupInfo env, HasSettings env, MonadCatch m, HasLog env, MonadThrow m, MonadFail m, MonadResource m, MonadIO m, MonadUnliftIO m) => Maybe FilePath -> Bool -> Bool -> Version -> Excepts '[CopyError, DigestError, ContentLengthError, GPGError, GPGError, DownloadFailed, NoDownload, NoUpdate, ToolShadowed] m Version
- whereIsTool :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => Tool -> GHCTargetVersion -> Excepts '[NotInstalled] m FilePath
- checkIfToolInstalled :: (MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Tool -> Version -> m Bool
- checkIfToolInstalled' :: (MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Tool -> GHCTargetVersion -> m Bool
- rmOldGHC :: (MonadReader env m, HasGHCupInfo env, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => Excepts '[NotInstalled, UninstallFailed] m ()
- rmUnsetTools :: (MonadReader env m, HasGHCupInfo env, HasPlatformReq env, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => Excepts '[NotInstalled, UninstallFailed] m ()
- rmProfilingLibs :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => m ()
- rmShareDir :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => m ()
- rmHLSNoGHC :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadMask m, MonadFail m, MonadUnliftIO m) => Excepts '[NotInstalled, UninstallFailed] m ()
- rmCache :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadMask m) => m ()
- rmTmp :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadMask m) => m ()
- module GHCup.Cabal
- testGHCVer :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => GHCTargetVersion -> [Text] -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, ArchiveResult, TarDirDoesNotExist, UnknownArchive, TestFailed] m ()
- testGHCBindist :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => DownloadInfo -> GHCTargetVersion -> [Text] -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, ArchiveResult, TarDirDoesNotExist, UnknownArchive, TestFailed] m ()
- testPackedGHC :: (MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasPlatformReq env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadFail m, MonadResource m) => FilePath -> Maybe TarDir -> GHCTargetVersion -> [Text] -> Excepts '[ArchiveResult, UnknownArchive, TarDirDoesNotExist, TestFailed] m ()
- testUnpackedGHC :: (MonadReader env m, HasDirs env, HasSettings env, MonadThrow m, HasLog env, MonadIO m) => GHCupPath -> GHCTargetVersion -> [Text] -> Excepts '[ProcessError] m ()
- fetchGHCSrc :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => GHCTargetVersion -> Maybe FilePath -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload] m FilePath
- installGHCBindist :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => DownloadInfo -> GHCTargetVersion -> InstallDir -> Bool -> [Text] -> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError] m ()
- rmGHCVer :: (MonadReader env m, HasDirs env, MonadThrow m, HasLog env, MonadIO m, MonadFail m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> Excepts '[NotInstalled, UninstallFailed] m ()
- installPackedGHC :: (MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasPlatformReq env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadFail m, MonadResource m) => FilePath -> Maybe TarDir -> InstallDirResolved -> GHCTargetVersion -> Bool -> [Text] -> Excepts '[BuildFailed, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, MergeFileTreeError] m ()
- postGHCInstall :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> Excepts '[NotInstalled] m ()
- installUnpackedGHC :: (MonadReader env m, HasPlatformReq env, HasDirs env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadMask m, MonadResource m, MonadFail m) => GHCupPath -> InstallDirResolved -> GHCTargetVersion -> Bool -> [Text] -> Excepts '[ProcessError, MergeFileTreeError] m ()
- mergeGHCFileTree :: (MonadReader env m, HasPlatformReq env, HasDirs env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadMask m, MonadResource m, MonadFail m) => GHCupPath -> InstallDirResolved -> GHCTargetVersion -> Bool -> Excepts '[MergeFileTreeError] m ()
- installGHCBin :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasPlatformReq env, HasGHCupInfo env, HasDirs env, HasSettings env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, Alternative m) => GHCTargetVersion -> InstallDir -> Bool -> [Text] -> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError, NoCompatiblePlatform, ParseError, UnsupportedSetupCombo, DistroNotFound, NoCompatibleArch] m ()
- setGHC :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> SetGHC -> Maybe FilePath -> Excepts '[NotInstalled] m GHCTargetVersion
- unsetGHC :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadMask m) => Maybe Text -> Excepts '[NotInstalled] m ()
- compileGHC :: (MonadMask m, MonadReader env m, HasDirs env, HasPlatformReq env, HasGHCupInfo env, HasSettings env, MonadThrow m, MonadResource m, HasLog env, MonadIO m, MonadUnliftIO m, MonadFail m) => GHCVer -> Maybe Text -> Maybe [VersionPattern] -> Either Version FilePath -> Maybe Int -> Maybe FilePath -> Maybe (Either FilePath [URI]) -> [Text] -> Maybe String -> Maybe BuildSystem -> InstallDir -> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, GHCupSetError, NoDownload, NotFoundInPATH, PatchFailed, UnknownArchive, TarDirDoesNotExist, NotInstalled, DirNotEmpty, ArchiveResult, FileDoesNotExistError, HadrianNotFound, InvalidBuildConfig, ProcessError, CopyError, BuildFailed, UninstallFailed, MergeFileTreeError] m GHCTargetVersion
- installHLSBindist :: (MonadMask m, MonadCatch m, MonadReader env m, HasPlatformReq env, HasDirs env, HasSettings env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, MonadFail m) => DownloadInfo -> Version -> InstallDir -> Bool -> Excepts '[AlreadyInstalled, CopyError, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, ArchiveResult, FileAlreadyExistsError, ProcessError, DirNotEmpty, UninstallFailed, MergeFileTreeError] m ()
- rmHLSVer :: (MonadMask m, MonadReader env m, HasDirs env, MonadThrow m, HasLog env, MonadIO m, MonadFail m, MonadCatch m, MonadUnliftIO m) => Version -> Excepts '[NotInstalled, UninstallFailed] m ()
- isLegacyHLSBindist :: FilePath -> IO Bool
- installHLSUnpackedLegacy :: (MonadReader env m, MonadFail m, HasLog env, MonadCatch m, MonadIO m) => FilePath -> InstallDirResolved -> Version -> Bool -> Excepts '[CopyError, FileAlreadyExistsError] m ()
- installHLSUnpacked :: (MonadMask m, MonadUnliftIO m, MonadReader env m, MonadFail m, HasLog env, HasDirs env, HasSettings env, MonadCatch m, MonadIO m, MonadResource m, HasPlatformReq env) => FilePath -> InstallDirResolved -> Version -> Bool -> Excepts '[ProcessError, CopyError, FileAlreadyExistsError, NotInstalled, MergeFileTreeError] m ()
- setHLS :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadMask m, MonadFail m, MonadUnliftIO m) => Version -> SetHLS -> Maybe FilePath -> Excepts '[NotInstalled] m ()
- installHLSBin :: (MonadMask m, MonadCatch m, MonadReader env m, HasPlatformReq env, HasGHCupInfo env, HasDirs env, HasSettings env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, MonadFail m) => Version -> InstallDir -> Bool -> Excepts '[AlreadyInstalled, CopyError, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, ArchiveResult, FileAlreadyExistsError, ProcessError, DirNotEmpty, UninstallFailed, MergeFileTreeError] m ()
- compileHLS :: (MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, MonadFail m) => HLSVer -> [Version] -> Maybe Int -> Maybe [VersionPattern] -> InstallDir -> Maybe (Either FilePath URI) -> Maybe URI -> Bool -> Maybe (Either FilePath [URI]) -> [Text] -> Excepts '[NoDownload, GPGError, DownloadFailed, DigestError, ContentLengthError, UnknownArchive, TarDirDoesNotExist, ArchiveResult, BuildFailed, NotInstalled] m Version
- getCabalVersion :: (MonadIO m, MonadFail m) => FilePath -> m Version
- unsetHLS :: (MonadMask m, MonadReader env m, HasDirs env, MonadIO m) => m ()
- module GHCup.Stack
- module GHCup.List
Documentation
fetchToolBindist :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => GHCTargetVersion -> Tool -> Maybe FilePath -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload] m FilePath Source #
rmTool :: (MonadReader env m, HasDirs env, HasLog env, MonadFail m, MonadMask m, MonadUnliftIO m) => ListResult -> Excepts '[NotInstalled, UninstallFailed] m () Source #
rmGhcup :: (MonadReader env m, HasDirs env, MonadIO m, MonadCatch m, HasLog env, MonadMask m, MonadUnliftIO m) => m () Source #
rmGhcupDirs :: (MonadReader env m, HasDirs env, MonadIO m, HasLog env, MonadCatch m, MonadMask m) => m [FilePath] Source #
getDebugInfo :: (Alternative m, MonadFail m, MonadReader env m, HasDirs env, HasLog env, MonadCatch m, MonadIO m) => Excepts '[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] m DebugInfo Source #
:: (MonadMask m, MonadReader env m, HasDirs env, HasPlatformReq env, HasGHCupInfo env, HasSettings env, MonadCatch m, HasLog env, MonadThrow m, MonadFail m, MonadResource m, MonadIO m, MonadUnliftIO m) | |
=> Maybe FilePath | full file destination to write ghcup into |
-> Bool | whether to force update regardless of currently installed version |
-> Bool | whether to throw an error if ghcup is shadowed |
-> Excepts '[CopyError, DigestError, ContentLengthError, GPGError, GPGError, DownloadFailed, NoDownload, NoUpdate, ToolShadowed] m Version |
Upgrade ghcup and place it in ~/.ghcup/bin/ghcup
,
if no path is provided.
:: (MonadMask m, MonadReader env m, HasDirs env, HasPlatformReq env, HasGHCupInfo env, HasSettings env, MonadCatch m, HasLog env, MonadThrow m, MonadFail m, MonadResource m, MonadIO m, MonadUnliftIO m) | |
=> Maybe FilePath | full file destination to write ghcup into |
-> Bool | whether to force update regardless of currently installed version |
-> Bool | whether to throw an error if ghcup is shadowed |
-> Version | |
-> Excepts '[CopyError, DigestError, ContentLengthError, GPGError, GPGError, DownloadFailed, NoDownload, NoUpdate, ToolShadowed] m Version |
Upgrade ghcup and place it in ~/.ghcup/bin/ghcup
,
if no path is provided.
whereIsTool :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => Tool -> GHCTargetVersion -> Excepts '[NotInstalled] m FilePath Source #
Reports the binary location of a given tool:
- for GHC, this reports:
~/.ghcup/ghc/<ver>/bin/ghc
- for cabal, this reports
~/.ghcup/bin/cabal-<ver>
- for hls, this reports
~/.ghcup/bin/haskell-language-server-wrapper-<ver>
- for stack, this reports
~/.ghcup/bin/stack-<ver>
- for ghcup, this reports the location of the currently running executable
checkIfToolInstalled :: (MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Tool -> Version -> m Bool Source #
Doesn't work for cross GHC.
checkIfToolInstalled' :: (MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Tool -> GHCTargetVersion -> m Bool Source #
rmOldGHC :: (MonadReader env m, HasGHCupInfo env, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => Excepts '[NotInstalled, UninstallFailed] m () Source #
rmUnsetTools :: (MonadReader env m, HasGHCupInfo env, HasPlatformReq env, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => Excepts '[NotInstalled, UninstallFailed] m () Source #
rmProfilingLibs :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => m () Source #
rmShareDir :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadFail m, MonadMask m, MonadUnliftIO m) => m () Source #
rmHLSNoGHC :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadMask m, MonadFail m, MonadUnliftIO m) => Excepts '[NotInstalled, UninstallFailed] m () Source #
module GHCup.Cabal
testGHCVer :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => GHCTargetVersion -> [Text] -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, ArchiveResult, TarDirDoesNotExist, UnknownArchive, TestFailed] m () Source #
testGHCBindist :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => DownloadInfo -> GHCTargetVersion -> [Text] -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, ArchiveResult, TarDirDoesNotExist, UnknownArchive, TestFailed] m () Source #
:: (MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasPlatformReq env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadFail m, MonadResource m) | |
=> FilePath | Path to the packed GHC bindist |
-> Maybe TarDir | Subdir of the archive |
-> GHCTargetVersion | The GHC version |
-> [Text] | additional make args |
-> Excepts '[ArchiveResult, UnknownArchive, TarDirDoesNotExist, TestFailed] m () |
:: (MonadReader env m, HasDirs env, HasSettings env, MonadThrow m, HasLog env, MonadIO m) | |
=> GHCupPath | Path to the unpacked GHC bindist (where the make file resides) |
-> GHCTargetVersion | The GHC version |
-> [Text] | additional configure args for bindist |
-> Excepts '[ProcessError] m () |
fetchGHCSrc :: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) => GHCTargetVersion -> Maybe FilePath -> Excepts '[DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload] m FilePath Source #
:: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m) | |
=> DownloadInfo | where/how to download |
-> GHCTargetVersion | the version to install |
-> InstallDir | |
-> Bool | Force install |
-> [Text] | additional configure args for bindist |
-> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError] m () |
Like installGHCBin
, except takes the DownloadInfo
as
argument instead of looking it up from GHCupDownloads
.
rmGHCVer :: (MonadReader env m, HasDirs env, MonadThrow m, HasLog env, MonadIO m, MonadFail m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> Excepts '[NotInstalled, UninstallFailed] m () Source #
Delete a ghc version and all its symlinks.
This may leave GHCup without a "set" version. Will try to fix the ghc-x.y symlink after removal (e.g. to an older version).
:: (MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasPlatformReq env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadFail m, MonadResource m) | |
=> FilePath | Path to the packed GHC bindist |
-> Maybe TarDir | Subdir of the archive |
-> InstallDirResolved | |
-> GHCTargetVersion | The GHC version |
-> Bool | Force install |
-> [Text] | additional configure args for bindist |
-> Excepts '[BuildFailed, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, MergeFileTreeError] m () |
Install a packed GHC distribution. This only deals with unpacking and the GHC build system and nothing else.
postGHCInstall :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> Excepts '[NotInstalled] m () Source #
Creates ghc-x.y.z
and ghc-x.y
symlinks. This is used for
both installing from source and bindist.
:: (MonadReader env m, HasPlatformReq env, HasDirs env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadMask m, MonadResource m, MonadFail m) | |
=> GHCupPath | Path to the unpacked GHC bindist (where the configure script resides) |
-> InstallDirResolved | Path to install to |
-> GHCTargetVersion | The GHC version |
-> Bool | Force install |
-> [Text] | additional configure args for bindist |
-> Excepts '[ProcessError, MergeFileTreeError] m () |
Install an unpacked GHC distribution. This only deals with the GHC build system and nothing else.
:: (MonadReader env m, HasPlatformReq env, HasDirs env, HasSettings env, MonadThrow m, HasLog env, MonadIO m, MonadUnliftIO m, MonadMask m, MonadResource m, MonadFail m) | |
=> GHCupPath | Path to the root of the tree |
-> InstallDirResolved | Path to install to |
-> GHCTargetVersion | The GHC version |
-> Bool | Force install |
-> Excepts '[MergeFileTreeError] m () |
:: (MonadFail m, MonadMask m, MonadCatch m, MonadReader env m, HasPlatformReq env, HasGHCupInfo env, HasDirs env, HasSettings env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, Alternative m) | |
=> GHCTargetVersion | the version to install |
-> InstallDir | |
-> Bool | force install |
-> [Text] | additional configure args for bindist |
-> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError, NoCompatiblePlatform, ParseError, UnsupportedSetupCombo, DistroNotFound, NoCompatibleArch] m () |
Installs GHC into ~/.ghcup/ghc/<ver>
and places the
following symlinks in ~/.ghcup/bin
:
ghc-x.y.z -> ../ghc/x.y.z/bin/ghc
ghc-x.y -> ../ghc/x.y.z/bin/ghc
(if x.y.z is the latest x.y version)
setGHC :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> SetGHC -> Maybe FilePath -> Excepts '[NotInstalled] m GHCTargetVersion Source #
Set GHC symlinks in ~/.ghcup/bin
for the requested GHC version. The behavior depends
on SetGHC
:
- SetGHCOnly:
~/.ghcup/bin/ghc -> ~/.ghcup/ghc/<ver>/bin/ghc
- SetGHC_XY:
~/.ghcup/bin/ghc-X.Y -> ~/.ghcup/ghc/<ver>/bin/ghc
- SetGHC_XYZ:
~/.ghcup/bin/ghc-<ver> -> ~/.ghcup/ghc/<ver>/bin/ghc
Additionally creates a ~/.ghcup/share -> ~/.ghcup/ghc/<ver>/share symlink
for SetGHCOnly
constructor.
unsetGHC :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadMask m) => Maybe Text -> Excepts '[NotInstalled] m () Source #
:: (MonadMask m, MonadReader env m, HasDirs env, HasPlatformReq env, HasGHCupInfo env, HasSettings env, MonadThrow m, MonadResource m, HasLog env, MonadIO m, MonadUnliftIO m, MonadFail m) | |
=> GHCVer | |
-> Maybe Text | cross target |
-> Maybe [VersionPattern] | |
-> Either Version FilePath | version to bootstrap with |
-> Maybe Int | jobs |
-> Maybe FilePath | build config |
-> Maybe (Either FilePath [URI]) | patches |
-> [Text] | additional args to ./configure |
-> Maybe String | build flavour |
-> Maybe BuildSystem | |
-> InstallDir | |
-> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, GHCupSetError, NoDownload, NotFoundInPATH, PatchFailed, UnknownArchive, TarDirDoesNotExist, NotInstalled, DirNotEmpty, ArchiveResult, FileDoesNotExistError, HadrianNotFound, InvalidBuildConfig, ProcessError, CopyError, BuildFailed, UninstallFailed, MergeFileTreeError] m GHCTargetVersion |
Compile a GHC from source. This behaves wrt symlinks and installation
the same as installGHCBin
.
:: (MonadMask m, MonadCatch m, MonadReader env m, HasPlatformReq env, HasDirs env, HasSettings env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, MonadFail m) | |
=> DownloadInfo | |
-> Version | |
-> InstallDir | isolated install path, if user passed any |
-> Bool | Force install |
-> Excepts '[AlreadyInstalled, CopyError, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, ArchiveResult, FileAlreadyExistsError, ProcessError, DirNotEmpty, UninstallFailed, MergeFileTreeError] m () |
Like 'installHLSBin, except takes the DownloadInfo
as
argument instead of looking it up from GHCupDownloads
.
rmHLSVer :: (MonadMask m, MonadReader env m, HasDirs env, MonadThrow m, HasLog env, MonadIO m, MonadFail m, MonadCatch m, MonadUnliftIO m) => Version -> Excepts '[NotInstalled, UninstallFailed] m () Source #
Delete a hls version. Will try to fix the hls symlinks after removal (e.g. setting it to an older version).
installHLSUnpackedLegacy Source #
:: (MonadReader env m, MonadFail m, HasLog env, MonadCatch m, MonadIO m) | |
=> FilePath | Path to the unpacked hls bindist (where the executable resides) |
-> InstallDirResolved | Path to install to |
-> Version | |
-> Bool | is it a force install |
-> Excepts '[CopyError, FileAlreadyExistsError] m () |
Install an unpacked hls distribution (legacy).
:: (MonadMask m, MonadUnliftIO m, MonadReader env m, MonadFail m, HasLog env, HasDirs env, HasSettings env, MonadCatch m, MonadIO m, MonadResource m, HasPlatformReq env) | |
=> FilePath | Path to the unpacked hls bindist (where the executable resides) |
-> InstallDirResolved | Path to install to |
-> Version | |
-> Bool | |
-> Excepts '[ProcessError, CopyError, FileAlreadyExistsError, NotInstalled, MergeFileTreeError] m () |
Install an unpacked hls distribution.
setHLS :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m, MonadMask m, MonadFail m, MonadUnliftIO m) => Version -> SetHLS -> Maybe FilePath -> Excepts '[NotInstalled] m () Source #
Set the haskell-language-server symlinks.
installHLSBin :: (MonadMask m, MonadCatch m, MonadReader env m, HasPlatformReq env, HasGHCupInfo env, HasDirs env, HasSettings env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, MonadFail m) => Version -> InstallDir -> Bool -> Excepts '[AlreadyInstalled, CopyError, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, ArchiveResult, FileAlreadyExistsError, ProcessError, DirNotEmpty, UninstallFailed, MergeFileTreeError] m () Source #
Installs hls binaries haskell-language-server-<ghcver>
into ~/.ghcup/bin/
, as well as haskell-languager-server-wrapper
.
:: (MonadMask m, MonadCatch m, MonadReader env m, HasDirs env, HasSettings env, HasPlatformReq env, HasGHCupInfo env, HasLog env, MonadResource m, MonadIO m, MonadUnliftIO m, MonadFail m) | |
=> HLSVer | |
-> [Version] | |
-> Maybe Int | |
-> Maybe [VersionPattern] | |
-> InstallDir | |
-> Maybe (Either FilePath URI) | |
-> Maybe URI | |
-> Bool | |
-> Maybe (Either FilePath [URI]) | patches |
-> [Text] | additional args to cabal install |
-> Excepts '[NoDownload, GPGError, DownloadFailed, DigestError, ContentLengthError, UnknownArchive, TarDirDoesNotExist, ArchiveResult, BuildFailed, NotInstalled] m Version |
module GHCup.Stack
module GHCup.List