Compare commits
4 Commits
better-cle
...
ci-git
| Author | SHA1 | Date | |
|---|---|---|---|
|
3a154b301b
|
|||
|
9bf21daf9e
|
|||
|
ece03220c9
|
|||
|
f838112e8b
|
@@ -1,8 +1,8 @@
|
||||
stages:
|
||||
- checks
|
||||
- quick-test
|
||||
- test
|
||||
- expensive-test
|
||||
- linting
|
||||
- quick-tests
|
||||
- tests
|
||||
- expensive-tests
|
||||
- release
|
||||
|
||||
variables:
|
||||
@@ -232,7 +232,7 @@ variables:
|
||||
######## stack test ########
|
||||
|
||||
test:linux:stack:
|
||||
stage: test
|
||||
stage: tests
|
||||
before_script:
|
||||
- ./.gitlab/before_script/linux/install_deps_minimal.sh
|
||||
script:
|
||||
@@ -244,7 +244,7 @@ test:linux:stack:
|
||||
######## bootstrap test ########
|
||||
|
||||
test:linux:bootstrap_script:
|
||||
stage: quick-test
|
||||
stage: quick-tests
|
||||
before_script:
|
||||
- ./.gitlab/before_script/linux/install_deps_minimal.sh
|
||||
script:
|
||||
@@ -258,7 +258,7 @@ test:linux:bootstrap_script:
|
||||
needs: []
|
||||
|
||||
test:windows:bootstrap_powershell_script:
|
||||
stage: quick-test
|
||||
stage: quick-tests
|
||||
script:
|
||||
- ./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir $CI_PROJECT_DIR -BootstrapUrl $CI_PROJECT_DIR/bootstrap-haskell -InBash
|
||||
after_script:
|
||||
@@ -276,7 +276,7 @@ test:windows:bootstrap_powershell_script:
|
||||
######## linux test ########
|
||||
|
||||
test:linux:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:linux
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -284,7 +284,7 @@ test:linux:
|
||||
needs: []
|
||||
|
||||
test:linux:hls:
|
||||
stage: expensive-test
|
||||
stage: expensive-tests
|
||||
extends:
|
||||
- .test_ghcup_version
|
||||
- .debian
|
||||
@@ -301,7 +301,7 @@ test:linux:hls:
|
||||
- ./.gitlab/script/ghcup_hls.sh
|
||||
|
||||
test:linux:cross-armv7:
|
||||
stage: expensive-test
|
||||
stage: expensive-tests
|
||||
extends:
|
||||
- .test_ghcup_version
|
||||
- .debian
|
||||
@@ -319,21 +319,22 @@ test:linux:cross-armv7:
|
||||
- ./.gitlab/script/ghcup_cross.sh
|
||||
|
||||
test:linux:git:hadrian:
|
||||
stage: expensive-test
|
||||
stage: expensive-tests
|
||||
extends:
|
||||
- .test_ghcup_version
|
||||
- .debian
|
||||
- .alpine:64bit
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
GHC_GIT_TAG: "ghc-9.0.1-release"
|
||||
GHC_GIT_VERSION: "9.0.1"
|
||||
GHC_VERSION: "8.8.4"
|
||||
GHC_GIT_TAG: "ghc-8.10.7-release"
|
||||
GHC_GIT_VERSION: "8.10.7"
|
||||
CABAL_VERSION: "3.6.2.0"
|
||||
CROSS: ""
|
||||
needs: []
|
||||
when: manual
|
||||
allow_failure: true
|
||||
before_script:
|
||||
- ./.gitlab/before_script/linux/install_deps.sh
|
||||
- apk add --no-cache python3 autoconf automake
|
||||
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
||||
script:
|
||||
- ./.gitlab/script/ghcup_git.sh
|
||||
|
||||
@@ -341,7 +342,7 @@ test:linux:git:hadrian:
|
||||
######## linux 32bit test ########
|
||||
|
||||
test:linux:32bit:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:linux32
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -351,7 +352,7 @@ test:linux:32bit:
|
||||
######## arm tests ########
|
||||
|
||||
test:linux:armv7:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:armv7
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -361,7 +362,7 @@ test:linux:armv7:
|
||||
needs: []
|
||||
|
||||
test:linux:aarch64:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:aarch64
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -373,7 +374,7 @@ test:linux:aarch64:
|
||||
######## darwin test ########
|
||||
|
||||
test:mac:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:darwin
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -381,7 +382,7 @@ test:mac:
|
||||
needs: []
|
||||
|
||||
test:mac:aarch64:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:darwin:aarch64
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -393,7 +394,7 @@ test:mac:aarch64:
|
||||
######## freebsd test ########
|
||||
|
||||
test:freebsd12:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:freebsd12
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -403,7 +404,7 @@ test:freebsd12:
|
||||
needs: []
|
||||
|
||||
test:freebsd13:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:freebsd13
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -415,7 +416,7 @@ test:freebsd13:
|
||||
######## windows test ########
|
||||
|
||||
test:windows:
|
||||
stage: test
|
||||
stage: tests
|
||||
extends: .test_ghcup_version:windows
|
||||
variables:
|
||||
GHC_VERSION: "8.10.7"
|
||||
@@ -587,7 +588,7 @@ release:windows:
|
||||
######## hlint ########
|
||||
|
||||
hlint:
|
||||
stage: checks
|
||||
stage: linting
|
||||
extends:
|
||||
- .debian
|
||||
script:
|
||||
@@ -602,7 +603,7 @@ hlint:
|
||||
######## mkdocs ########
|
||||
|
||||
mkdocs:
|
||||
stage: checks
|
||||
stage: linting
|
||||
extends:
|
||||
- .debian
|
||||
before_script:
|
||||
@@ -619,7 +620,7 @@ shellcheck:
|
||||
image: "koalaman/shellcheck-alpine"
|
||||
tags:
|
||||
- x86_64-linux
|
||||
stage: checks
|
||||
stage: linting
|
||||
script:
|
||||
- shellcheck scripts/bootstrap/bootstrap-haskell
|
||||
allow_failure: true
|
||||
|
||||
@@ -41,7 +41,20 @@ cabal --version
|
||||
|
||||
eghcup debug-info
|
||||
|
||||
eghcup compile ghc -j $(nproc) -g ${GHC_GIT_TAG} -b ${GHC_VERSION} -- --enable-unregisterised
|
||||
(
|
||||
cd /tmp
|
||||
ecabal install --installdir="$CI_PROJECT_DIR/.local/bin" --overwrite-policy=always --install-method=copy --constraint="happy == 1.19.12" happy
|
||||
ecabal install --installdir="$CI_PROJECT_DIR/.local/bin" --overwrite-policy=always --install-method=copy --constraint="alex == 3.2.6" alex
|
||||
)
|
||||
|
||||
ls -la "$CI_PROJECT_DIR/.local/bin"
|
||||
which alex
|
||||
which happy
|
||||
"$CI_PROJECT_DIR/.local/bin/alex" --version
|
||||
"$CI_PROJECT_DIR/.local/bin/happy" --version
|
||||
|
||||
|
||||
eghcup compile ghc -j $(nproc) -g ${GHC_GIT_TAG} -b ${GHC_VERSION} --hadrian -- --enable-unregisterised
|
||||
eghcup set ghc ${GHC_GIT_VERSION}
|
||||
|
||||
[ `$(eghcup whereis ghc ${GHC_GIT_VERSION}) --numeric-version` = "${GHC_GIT_VERSION}" ]
|
||||
|
||||
@@ -434,7 +434,6 @@ install' _ (_, ListResult {..}) = do
|
||||
, NoUpdate
|
||||
, TarDirDoesNotExist
|
||||
, FileAlreadyExistsError
|
||||
, ProcessError
|
||||
]
|
||||
|
||||
run (do
|
||||
|
||||
@@ -1852,7 +1852,6 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
||||
, NextVerNotFound
|
||||
, NoToolVersionSet
|
||||
, FileAlreadyExistsError
|
||||
, ProcessError
|
||||
]
|
||||
|
||||
let runInstTool mInstPlatform action' = do
|
||||
@@ -1954,12 +1953,6 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
||||
, NotInstalled
|
||||
, DirNotEmpty
|
||||
, ArchiveResult
|
||||
, FileDoesNotExistError
|
||||
, HadrianNotFound
|
||||
, InvalidBuildConfig
|
||||
, ProcessError
|
||||
, CopyError
|
||||
, BuildFailed
|
||||
]
|
||||
|
||||
let runCompileHLS =
|
||||
|
||||
@@ -2239,11 +2239,13 @@ ghcupDownloads:
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &cabal-3410-64
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~cabal/cabal-install-3.4.1.0/cabal-install-3.4.1.0-x86_64-linux-deb10.tar.xz
|
||||
dlHash: 019351d5ddc282f2195aca6d432699a31ad0ff75b01eeddff2402f5f3ca2104e
|
||||
Linux_Alpine:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.1.0/cabal-install-3.4.1.0-x86_64-linux-alpine-static.tar.xz
|
||||
dlHash: f8cae8b5e6346b56676f734de1afd9b4b5f27eab6ab87852c19a30f7850f17fe
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *cabal-3410-64
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~cabal/cabal-install-3.4.1.0/cabal-install-3.4.1.0-x86_64-darwin.tar.xz
|
||||
@@ -2339,11 +2341,13 @@ ghcupDownloads:
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &cabal-3620-32
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz
|
||||
dlHash: 4759b56e9257e02f29fa374a6b25d6cb2f9d80c7e3a55d4f678a8e570925641c
|
||||
Linux_Alpine:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz
|
||||
dlHash: 7810d31f35ca7649355647abc6406ad2a3696648ce848e49409e86bd70f6a2c6
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *cabal-3620-32
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/cabal-install-3.6.2.0-x86_64-darwin.tar.xz
|
||||
|
||||
23
lib/GHCup.hs
23
lib/GHCup.hs
@@ -205,7 +205,6 @@ installGHCBindist :: ( MonadFail m
|
||||
, TarDirDoesNotExist
|
||||
, DirNotEmpty
|
||||
, ArchiveResult
|
||||
, ProcessError
|
||||
]
|
||||
m
|
||||
()
|
||||
@@ -284,7 +283,6 @@ installPackedGHC :: ( MonadMask m
|
||||
, TarDirDoesNotExist
|
||||
, DirNotEmpty
|
||||
, ArchiveResult
|
||||
, ProcessError
|
||||
] m ()
|
||||
installPackedGHC dl msubdir inst ver forceInstall = do
|
||||
PlatformRequest {..} <- lift getPlatformReq
|
||||
@@ -294,7 +292,7 @@ installPackedGHC dl msubdir inst ver forceInstall = do
|
||||
|
||||
-- unpack
|
||||
tmpUnpack <- lift mkGhcupTmpDir
|
||||
liftE $ cleanUpOnError tmpUnpack (unpackToDir tmpUnpack dl)
|
||||
liftE $ unpackToDir tmpUnpack dl
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform tmpUnpack
|
||||
|
||||
-- the subdir of the archive where we do the work
|
||||
@@ -404,13 +402,12 @@ installGHCBin :: ( MonadFail m
|
||||
, TarDirDoesNotExist
|
||||
, DirNotEmpty
|
||||
, ArchiveResult
|
||||
, ProcessError
|
||||
]
|
||||
m
|
||||
()
|
||||
installGHCBin ver isoFilepath forceInstall = do
|
||||
dlinfo <- liftE $ getDownloadInfo GHC ver
|
||||
liftE $ installGHCBindist dlinfo ver isoFilepath forceInstall
|
||||
installGHCBindist dlinfo ver isoFilepath forceInstall
|
||||
|
||||
|
||||
-- | Like 'installCabalBin', except takes the 'DownloadInfo' as
|
||||
@@ -475,7 +472,7 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do
|
||||
|
||||
-- unpack
|
||||
tmpUnpack <- lift withGHCupTmpDir
|
||||
liftE $ cleanUpOnError tmpUnpack (unpackToDir tmpUnpack dl)
|
||||
liftE $ unpackToDir tmpUnpack dl
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform tmpUnpack
|
||||
|
||||
-- the subdir of the archive where we do the work
|
||||
@@ -617,7 +614,7 @@ installHLSBindist dlinfo ver isoFilepath forceInstall = do
|
||||
|
||||
-- unpack
|
||||
tmpUnpack <- lift withGHCupTmpDir
|
||||
liftE $ cleanUpOnError tmpUnpack (unpackToDir tmpUnpack dl)
|
||||
liftE $ unpackToDir tmpUnpack dl
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform tmpUnpack
|
||||
|
||||
-- the subdir of the archive where we do the work
|
||||
@@ -787,7 +784,7 @@ compileHLS targetHLS ghcs jobs ov isolateDir cabalProject cabalProjectLocal patc
|
||||
|
||||
-- unpack
|
||||
tmpUnpack <- lift mkGhcupTmpDir
|
||||
liftE $ cleanUpOnError tmpUnpack (unpackToDir tmpUnpack dl)
|
||||
liftE $ unpackToDir tmpUnpack dl
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform tmpUnpack
|
||||
|
||||
workdir <- maybe (pure tmpUnpack)
|
||||
@@ -1004,7 +1001,7 @@ installStackBindist dlinfo ver isoFilepath forceInstall = do
|
||||
|
||||
-- unpack
|
||||
tmpUnpack <- lift withGHCupTmpDir
|
||||
liftE $ cleanUpOnError tmpUnpack (unpackToDir tmpUnpack dl)
|
||||
liftE $ unpackToDir tmpUnpack dl
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform tmpUnpack
|
||||
|
||||
-- the subdir of the archive where we do the work
|
||||
@@ -2117,12 +2114,6 @@ compileGHC :: ( MonadMask m
|
||||
, NotInstalled
|
||||
, DirNotEmpty
|
||||
, ArchiveResult
|
||||
, FileDoesNotExistError
|
||||
, HadrianNotFound
|
||||
, InvalidBuildConfig
|
||||
, ProcessError
|
||||
, CopyError
|
||||
, BuildFailed
|
||||
]
|
||||
m
|
||||
GHCTargetVersion
|
||||
@@ -2144,7 +2135,7 @@ compileGHC targetGhc ov bstrap jobs mbuildConfig patchdir aargs buildFlavour had
|
||||
|
||||
-- unpack
|
||||
tmpUnpack <- lift mkGhcupTmpDir
|
||||
liftE $ cleanUpOnError tmpUnpack (unpackToDir tmpUnpack dl)
|
||||
liftE $ unpackToDir tmpUnpack dl
|
||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform tmpUnpack
|
||||
|
||||
workdir <- maybe (pure tmpUnpack)
|
||||
|
||||
@@ -74,6 +74,7 @@ import System.Win32.Console
|
||||
import System.Win32.File hiding ( copyFile )
|
||||
import System.Win32.Types
|
||||
#endif
|
||||
import Text.PrettyPrint.HughesPJClass hiding ( (<>) )
|
||||
import Text.Regex.Posix
|
||||
import URI.ByteString
|
||||
|
||||
@@ -925,7 +926,11 @@ getChangeLog dls tool (Right tag) =
|
||||
--
|
||||
-- 1. the build directory, depending on the KeepDirs setting
|
||||
-- 2. the install destination, depending on whether the build failed
|
||||
runBuildAction :: ( MonadReader env m
|
||||
runBuildAction :: ( Pretty (V e)
|
||||
, Show (V e)
|
||||
, PopVariant BuildFailed e
|
||||
, ToVariantMaybe BuildFailed e
|
||||
, MonadReader env m
|
||||
, HasDirs env
|
||||
, HasSettings env
|
||||
, MonadIO m
|
||||
@@ -938,43 +943,26 @@ runBuildAction :: ( MonadReader env m
|
||||
=> FilePath -- ^ build directory (cleaned up depending on Settings)
|
||||
-> Maybe FilePath -- ^ dir to *always* clean up on exception
|
||||
-> Excepts e m a
|
||||
-> Excepts e m a
|
||||
-> Excepts '[BuildFailed] m a
|
||||
runBuildAction bdir instdir action = do
|
||||
Settings {..} <- lift getSettings
|
||||
let exAction = do
|
||||
forM_ instdir $ \dir ->
|
||||
hideError doesNotExistErrorType $ recyclePathForcibly dir
|
||||
lift $ hideError doesNotExistErrorType $ recyclePathForcibly dir
|
||||
when (keepDirs == Never)
|
||||
$ rmBDir bdir
|
||||
$ lift $ rmBDir bdir
|
||||
v <-
|
||||
flip onException (lift exAction)
|
||||
$ onE_ exAction action
|
||||
flip onException exAction
|
||||
$ catchAllE
|
||||
(\es -> do
|
||||
exAction
|
||||
throwE (BuildFailed bdir es)
|
||||
) action
|
||||
|
||||
when (keepDirs == Never || keepDirs == Errors) $ lift $ rmBDir bdir
|
||||
pure v
|
||||
|
||||
|
||||
-- | Clean up the given directory if the action fails,
|
||||
-- depending on the Settings.
|
||||
cleanUpOnError :: ( MonadReader env m
|
||||
, HasDirs env
|
||||
, HasSettings env
|
||||
, MonadIO m
|
||||
, MonadMask m
|
||||
, HasLog env
|
||||
, MonadUnliftIO m
|
||||
, MonadFail m
|
||||
, MonadCatch m
|
||||
)
|
||||
=> FilePath -- ^ build directory (cleaned up depending on Settings)
|
||||
-> Excepts e m a
|
||||
-> Excepts e m a
|
||||
cleanUpOnError bdir action = do
|
||||
Settings {..} <- lift getSettings
|
||||
let exAction = when (keepDirs == Never) $ rmBDir bdir
|
||||
flip onException (lift exAction) $ onE_ exAction action
|
||||
|
||||
|
||||
|
||||
-- | Remove a build directory, ignoring if it doesn't exist and gracefully
|
||||
-- printing other errors without crashing.
|
||||
rmBDir :: (MonadReader env m, HasLog env, MonadUnliftIO m, MonadIO m) => FilePath -> m ()
|
||||
|
||||
Reference in New Issue
Block a user