11{-# LANGUAGE OverloadedStrings #-}
2- {-# LANGUAGE RecordWildCards #-}
2+ {-# LANGUAGE RecordWildCards #-}
33
4- import Control.Monad
5- import Data.Maybe
4+ import Control.Monad
5+ import Data.Maybe
66
7- import Data.Aeson hiding ( encode )
8- import Data.Aeson.Types ( Pair )
9- import qualified Data.Aeson.Key as K
10- import Data.Yaml
7+ import Data.Aeson hiding (encode )
8+ import qualified Data.Aeson.Key as K
9+ import Data.Aeson.Types ( Pair )
10+ import Data.Yaml
1111
12- import qualified Data.ByteString as BS
12+ import qualified Data.ByteString as BS
1313
14- import qualified Data.List as L
14+ import qualified Data.List as L
1515
16- import System.Directory
17- import System.FilePath
18- import System.Environment
16+ import System.Directory
17+ import System.Environment
18+ import System.FilePath
1919
2020-------------------------------------------------------------------------------
2121-- Configuration parameters
@@ -27,22 +27,23 @@ data Opsys
2727 | Windows deriving (Eq )
2828
2929osName :: Opsys -> String
30- osName Darwin = " mac"
31- osName Windows = " windows"
30+ osName Darwin = " mac"
31+ osName Windows = " windows"
3232osName (Linux d) = " linux-" ++ distroName d
3333
3434data Distro
3535 = Debian9
3636 | Debian10
3737 | Debian11
38+ | Debian12
3839 | Ubuntu1804
3940 | Ubuntu2004
4041 | Ubuntu2204
4142 | Mint193
4243 | Mint202
43- | Fedora27
44+ | Mint213
4445 | Fedora33
45- | Centos7
46+ | Fedora40
4647 | Rocky8
4748 deriving (Eq , Enum , Bounded )
4849
@@ -51,28 +52,26 @@ allDistros = [minBound .. maxBound]
5152
5253data Arch = Amd64 | AArch64
5354archName :: Arch -> String
54- archName Amd64 = " x86_64"
55+ archName Amd64 = " x86_64"
5556archName AArch64 = " aarch64"
5657
5758artifactName :: Arch -> Opsys -> String
5859artifactName arch opsys = archName arch ++ " -" ++ case opsys of
5960 Linux distro -> " linux-" ++ distroName distro
60- Darwin -> " apple-darwin"
61- Windows -> " mingw64"
61+ Darwin -> " apple-darwin"
62+ Windows -> " mingw64"
6263
6364data GHC
64- = GHC948
65- | GHC967
65+ = GHC967
6666 | GHC984
67- | GHC9101
67+ | GHC9102
6868 | GHC9122
6969 deriving (Eq , Enum , Bounded )
7070
7171ghcVersion :: GHC -> String
72- ghcVersion GHC948 = " 9.4.8"
73- ghcVersion GHC967 = " 9.6.7"
74- ghcVersion GHC984 = " 9.8.4"
75- ghcVersion GHC9101 = " 9.10.1"
72+ ghcVersion GHC967 = " 9.6.7"
73+ ghcVersion GHC984 = " 9.8.4"
74+ ghcVersion GHC9102 = " 9.10.2"
7675ghcVersion GHC9122 = " 9.12.2"
7776
7877ghcVersionIdent :: GHC -> String
@@ -88,59 +87,63 @@ data Stage = Build GHC | Bindist | Test
8887-------------------------------------------------------------------------------
8988
9089distroImage :: Distro -> String
91- distroImage Debian9 = " debian:9"
92- distroImage Debian10 = " debian:10"
93- distroImage Debian11 = " debian:11"
90+ distroImage Debian9 = " debian:9"
91+ distroImage Debian10 = " debian:10"
92+ distroImage Debian11 = " debian:11"
93+ distroImage Debian12 = " debian:12"
9494distroImage Ubuntu1804 = " ubuntu:18.04"
9595distroImage Ubuntu2004 = " ubuntu:20.04"
9696distroImage Ubuntu2204 = " ubuntu:22.04"
97- distroImage Mint193 = " linuxmintd/mint19.3-amd64"
98- distroImage Mint202 = " linuxmintd/mint20.2-amd64"
99- distroImage Fedora27 = " fedora:27 "
100- distroImage Fedora33 = " fedora:33"
101- distroImage Centos7 = " centos:7 "
102- distroImage Rocky8 = " rockylinux:8"
97+ distroImage Mint193 = " linuxmintd/mint19.3-amd64"
98+ distroImage Mint202 = " linuxmintd/mint20.2-amd64"
99+ distroImage Mint213 = " linuxmintd/mint21.3-amd64 "
100+ distroImage Fedora33 = " fedora:33"
101+ distroImage Fedora40 = " fedora:40 "
102+ distroImage Rocky8 = " rockylinux:8"
103103
104104distroName :: Distro -> String
105- distroName Debian9 = " deb9"
106- distroName Debian10 = " deb10"
107- distroName Debian11 = " deb11"
105+ distroName Debian9 = " deb9"
106+ distroName Debian10 = " deb10"
107+ distroName Debian11 = " deb11"
108+ distroName Debian12 = " deb12"
108109distroName Ubuntu1804 = " ubuntu1804"
109110distroName Ubuntu2004 = " ubuntu2004"
110111distroName Ubuntu2204 = " ubuntu2204"
111- distroName Mint193 = " mint193"
112- distroName Mint202 = " mint202"
113- distroName Fedora27 = " fedora27 "
114- distroName Fedora33 = " fedora33"
115- distroName Centos7 = " centos7 "
116- distroName Rocky8 = " unknown"
112+ distroName Mint193 = " mint193"
113+ distroName Mint202 = " mint202"
114+ distroName Mint213 = " mint213 "
115+ distroName Fedora33 = " fedora33"
116+ distroName Fedora40 = " fedora40 "
117+ distroName Rocky8 = " unknown"
117118
118119distroInstall :: Distro -> String
119120distroInstall Debian9 = " sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && sed -i 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list && sed -i /-updates/d /etc/apt/sources.list && apt-get update && apt-get install -y"
120121distroInstall Debian10 = " apt-get update && apt-get install -y"
121122distroInstall Debian11 = " apt-get update && apt-get install -y"
123+ distroInstall Debian12 = " apt-get update && apt-get install -y"
122124distroInstall Ubuntu1804 = " apt-get update && apt-get install -y"
123125distroInstall Ubuntu2004 = " apt-get update && apt-get install -y"
124126distroInstall Ubuntu2204 = " apt-get update && apt-get install -y"
125127distroInstall Mint193 = " apt-get update && apt-get install -y"
126128distroInstall Mint202 = " apt-get update && apt-get install -y"
127- distroInstall Fedora27 = " dnf install -y"
129+ distroInstall Mint213 = " apt-get update && apt-get install -y"
128130distroInstall Fedora33 = " dnf install -y"
129- distroInstall Centos7 = " sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && yum -y install epel-release && yum install -y"
131+ distroInstall Fedora40 = " dnf install -y"
130132distroInstall Rocky8 = " yum -y install epel-release && yum install -y --allowerasing"
131133
132134distroTools :: Distro -> String
133135distroTools Debian9 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
134136distroTools Debian10 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
135137distroTools Debian11 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
138+ distroTools Debian12 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
136139distroTools Ubuntu1804 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
137140distroTools Ubuntu2004 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
138141distroTools Ubuntu2204 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
139142distroTools Mint193 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
140143distroTools Mint202 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
141- distroTools Fedora27 = " autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
144+ distroTools Mint213 = " libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
142145distroTools Fedora33 = " autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
143- distroTools Centos7 = " autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
146+ distroTools Fedora40 = " autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
144147distroTools Rocky8 = " autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
145148
146149-------------------------------------------------------------------------------
@@ -160,13 +163,13 @@ envVars arch os = object $
160163 baseEnv
161164 ++ [ " TARBALL_EXT" .= str (case os of
162165 Windows -> " zip"
163- _ -> " tar.xz" )
166+ _ -> " tar.xz" )
164167 , " ARCH" .= str (case arch of
165- Amd64 -> " 64"
168+ Amd64 -> " 64"
166169 AArch64 -> " ARM64" )
167170 , " ADD_CABAL_ARGS" .= str (case (os,arch) of
168171 (Linux _, Amd64 ) -> " --enable-split-sections"
169- _ -> " " )
172+ _ -> " " )
170173 , " ARTIFACT" .= artifactName arch os
171174 ]
172175 ++ [ " DEBIAN_FRONTEND" .= str " noninteractive"
@@ -181,21 +184,21 @@ envVars arch os = object $
181184
182185-- | Runner selection
183186runner :: Arch -> Opsys -> [Value ]
184- runner Amd64 (Linux _) = [" ubuntu-latest" ]
187+ runner Amd64 (Linux _) = [" ubuntu-latest" ]
185188runner AArch64 (Linux _) = [" self-hosted" , " Linux" , " ARM64" , " maerwald" ]
186- runner Amd64 Darwin = [" macOS-13" ]
187- runner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
188- runner Amd64 Windows = [" windows-latest" ]
189- runner AArch64 Windows = error " aarch64 windows not supported"
189+ runner Amd64 Darwin = [" macOS-13" ]
190+ runner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
191+ runner Amd64 Windows = [" windows-latest" ]
192+ runner AArch64 Windows = error " aarch64 windows not supported"
190193
191194-- | Runner selection for bindist jobs
192195bindistRunner :: Arch -> Opsys -> [Value ]
193- bindistRunner Amd64 (Linux _) = [" self-hosted" , " linux-space" , " maerwald" ]
196+ bindistRunner Amd64 (Linux _) = [" self-hosted" , " linux-space" , " maerwald" ]
194197bindistRunner AArch64 (Linux _) = [" self-hosted" , " Linux" , " ARM64" , " maerwald" ]
195- bindistRunner Amd64 Darwin = [" macOS-13" ]
196- bindistRunner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
197- bindistRunner Amd64 Windows = [" windows-latest" ]
198- bindistRunner AArch64 Windows = error " aarch64 windows not supported"
198+ bindistRunner Amd64 Darwin = [" macOS-13" ]
199+ bindistRunner AArch64 Darwin = [" self-hosted" , " macOS" , " ARM64" ]
200+ bindistRunner Amd64 Windows = [" windows-latest" ]
201+ bindistRunner AArch64 Windows = error " aarch64 windows not supported"
199202
200203-------------------------------------------------------------------------------
201204-- Action generatation
@@ -215,7 +218,7 @@ bindistRunner AArch64 Windows = error "aarch64 windows not supported"
215218-- called 'actionName', located at 'actionPath'
216219data Action
217220 = Action
218- { actionName :: String
221+ { actionName :: String
219222 , actionDistro :: Distro
220223 }
221224
@@ -254,7 +257,7 @@ instance ToJSON Action where
254257
255258configAction :: Config -> Maybe Action
256259configAction (MkConfig Amd64 (Linux d) _) = Just $ Action (distroActionName d) d
257- configAction _ = Nothing
260+ configAction _ = Nothing
258261
259262distroActionName :: Distro -> String
260263distroActionName d = " action-" ++ distroName d
@@ -274,7 +277,7 @@ customAction d st = flip (ghAction stepName (actionPath d)) [] $ case st of
274277 where
275278 stepName = case st of
276279 Build v -> " Build " ++ ghcVersion v
277- Test -> " Test"
280+ Test -> " Test"
278281 Bindist -> " Bindist"
279282
280283-------------------------------------------------------------------------------
0 commit comments