Copyright | (c) Julian Ospald 2020 |
---|---|
License | LGPL-3.0 |
Maintainer | hasufell@hasufell.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GHCup.GHC
Description
Synopsis
- data GHCVer
- 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, URIParseError] 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, URIParseError] 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, URIParseError] 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] -> Text -> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError, URIParseError] 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] -> Text -> Excepts '[BuildFailed, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, MergeFileTreeError] 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] -> 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] -> Text -> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError, NoCompatiblePlatform, ParseError, UnsupportedSetupCombo, DistroNotFound, NoCompatibleArch, URIParseError] 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 ()
- 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 ()
- 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 (Either Version FilePath) -> Maybe Int -> Maybe FilePath -> Maybe (Either FilePath [URI]) -> [Text] -> Maybe String -> Maybe BuildSystem -> InstallDir -> Text -> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, GHCupSetError, NoDownload, NotFoundInPATH, PatchFailed, UnknownArchive, TarDirDoesNotExist, NotInstalled, DirNotEmpty, ArchiveResult, FileDoesNotExistError, HadrianNotFound, InvalidBuildConfig, ProcessError, CopyError, BuildFailed, UninstallFailed, MergeFileTreeError, URIParseError] m GHCTargetVersion
- postGHCInstall :: (MonadReader env m, HasDirs env, HasLog env, MonadThrow m, MonadFail m, MonadIO m, MonadCatch m, MonadMask m, MonadUnliftIO m) => GHCTargetVersion -> Excepts '[NotInstalled] m ()
- ldOverride :: Version -> Platform -> [String]
- sanitizefGHCconfOptions :: MonadFail m => [String] -> m [String]
Documentation
Constructors
SourceDist Version | |
GitDist GitBranch | |
RemoteDist URI |
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, URIParseError] 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, URIParseError] m () Source #
Arguments
:: (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 () |
Arguments
:: (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, URIParseError] m FilePath Source #
Arguments
:: (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 |
-> Text | |
-> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError, URIParseError] m () |
Like installGHCBin
, except takes the DownloadInfo
as
argument instead of looking it up from GHCupDownloads
.
Arguments
:: (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 |
-> Text | |
-> 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.
Arguments
:: (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 |
-> Text | |
-> Excepts '[ProcessError, MergeFileTreeError] m () |
Install an unpacked GHC distribution. This only deals with the GHC build system and nothing else.
Arguments
:: (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 () |
Arguments
:: (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 |
-> Text | |
-> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, NoDownload, NotInstalled, UnknownArchive, TarDirDoesNotExist, DirNotEmpty, ArchiveResult, ProcessError, UninstallFailed, MergeFileTreeError, NoCompatiblePlatform, ParseError, UnsupportedSetupCombo, DistroNotFound, NoCompatibleArch, URIParseError] 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 #
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).
Arguments
:: (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 | GHC version to bootstrap with |
-> Maybe (Either Version FilePath) | GHC version to compile hadrian 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 | |
-> Text | |
-> Excepts '[AlreadyInstalled, BuildFailed, DigestError, ContentLengthError, GPGError, DownloadFailed, GHCupSetError, NoDownload, NotFoundInPATH, PatchFailed, UnknownArchive, TarDirDoesNotExist, NotInstalled, DirNotEmpty, ArchiveResult, FileDoesNotExistError, HadrianNotFound, InvalidBuildConfig, ProcessError, CopyError, BuildFailed, UninstallFailed, MergeFileTreeError, URIParseError] m GHCTargetVersion |
Compile a GHC from source. This behaves wrt symlinks and installation
the same as installGHCBin
.
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.