1
1
{-# LANGUAGE OverloadedStrings #-}
2
- {-# LANGUAGE RecordWildCards #-}
2
+ {-# LANGUAGE RecordWildCards #-}
3
3
4
- import Control.Monad
5
- import Data.Maybe
4
+ import Control.Monad
5
+ import Data.Maybe
6
6
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
11
11
12
- import qualified Data.ByteString as BS
12
+ import qualified Data.ByteString as BS
13
13
14
- import qualified Data.List as L
14
+ import qualified Data.List as L
15
15
16
- import System.Directory
17
- import System.FilePath
18
- import System.Environment
16
+ import System.Directory
17
+ import System.Environment
18
+ import System.FilePath
19
19
20
20
-------------------------------------------------------------------------------
21
21
-- Configuration parameters
@@ -27,22 +27,23 @@ data Opsys
27
27
| Windows deriving (Eq )
28
28
29
29
osName :: Opsys -> String
30
- osName Darwin = " mac"
31
- osName Windows = " windows"
30
+ osName Darwin = " mac"
31
+ osName Windows = " windows"
32
32
osName (Linux d) = " linux-" ++ distroName d
33
33
34
34
data Distro
35
35
= Debian9
36
36
| Debian10
37
37
| Debian11
38
+ | Debian12
38
39
| Ubuntu1804
39
40
| Ubuntu2004
40
41
| Ubuntu2204
41
42
| Mint193
42
43
| Mint202
43
- | Fedora27
44
+ | Mint213
44
45
| Fedora33
45
- | Centos7
46
+ | Fedora40
46
47
| Rocky8
47
48
deriving (Eq , Enum , Bounded )
48
49
@@ -51,28 +52,26 @@ allDistros = [minBound .. maxBound]
51
52
52
53
data Arch = Amd64 | AArch64
53
54
archName :: Arch -> String
54
- archName Amd64 = " x86_64"
55
+ archName Amd64 = " x86_64"
55
56
archName AArch64 = " aarch64"
56
57
57
58
artifactName :: Arch -> Opsys -> String
58
59
artifactName arch opsys = archName arch ++ " -" ++ case opsys of
59
60
Linux distro -> " linux-" ++ distroName distro
60
- Darwin -> " apple-darwin"
61
- Windows -> " mingw64"
61
+ Darwin -> " apple-darwin"
62
+ Windows -> " mingw64"
62
63
63
64
data GHC
64
- = GHC948
65
- | GHC967
65
+ = GHC967
66
66
| GHC984
67
- | GHC9101
67
+ | GHC9102
68
68
| GHC9122
69
69
deriving (Eq , Enum , Bounded )
70
70
71
71
ghcVersion :: 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"
76
75
ghcVersion GHC9122 = " 9.12.2"
77
76
78
77
ghcVersionIdent :: GHC -> String
@@ -88,59 +87,63 @@ data Stage = Build GHC | Bindist | Test
88
87
-------------------------------------------------------------------------------
89
88
90
89
distroImage :: 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"
94
94
distroImage Ubuntu1804 = " ubuntu:18.04"
95
95
distroImage Ubuntu2004 = " ubuntu:20.04"
96
96
distroImage 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"
103
103
104
104
distroName :: 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"
108
109
distroName Ubuntu1804 = " ubuntu1804"
109
110
distroName Ubuntu2004 = " ubuntu2004"
110
111
distroName 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"
117
118
118
119
distroInstall :: Distro -> String
119
120
distroInstall 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"
120
121
distroInstall Debian10 = " apt-get update && apt-get install -y"
121
122
distroInstall Debian11 = " apt-get update && apt-get install -y"
123
+ distroInstall Debian12 = " apt-get update && apt-get install -y"
122
124
distroInstall Ubuntu1804 = " apt-get update && apt-get install -y"
123
125
distroInstall Ubuntu2004 = " apt-get update && apt-get install -y"
124
126
distroInstall Ubuntu2204 = " apt-get update && apt-get install -y"
125
127
distroInstall Mint193 = " apt-get update && apt-get install -y"
126
128
distroInstall Mint202 = " apt-get update && apt-get install -y"
127
- distroInstall Fedora27 = " dnf install -y"
129
+ distroInstall Mint213 = " apt-get update && apt-get install -y"
128
130
distroInstall 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"
130
132
distroInstall Rocky8 = " yum -y install epel-release && yum install -y --allowerasing"
131
133
132
134
distroTools :: Distro -> String
133
135
distroTools 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"
134
136
distroTools 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"
135
137
distroTools 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"
136
139
distroTools 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"
137
140
distroTools 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"
138
141
distroTools 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"
139
142
distroTools 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"
140
143
distroTools 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"
142
145
distroTools 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"
144
147
distroTools 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"
145
148
146
149
-------------------------------------------------------------------------------
@@ -160,13 +163,13 @@ envVars arch os = object $
160
163
baseEnv
161
164
++ [ " TARBALL_EXT" .= str (case os of
162
165
Windows -> " zip"
163
- _ -> " tar.xz" )
166
+ _ -> " tar.xz" )
164
167
, " ARCH" .= str (case arch of
165
- Amd64 -> " 64"
168
+ Amd64 -> " 64"
166
169
AArch64 -> " ARM64" )
167
170
, " ADD_CABAL_ARGS" .= str (case (os,arch) of
168
171
(Linux _, Amd64 ) -> " --enable-split-sections"
169
- _ -> " " )
172
+ _ -> " " )
170
173
, " ARTIFACT" .= artifactName arch os
171
174
]
172
175
++ [ " DEBIAN_FRONTEND" .= str " noninteractive"
@@ -181,21 +184,21 @@ envVars arch os = object $
181
184
182
185
-- | Runner selection
183
186
runner :: Arch -> Opsys -> [Value ]
184
- runner Amd64 (Linux _) = [" ubuntu-latest" ]
187
+ runner Amd64 (Linux _) = [" ubuntu-latest" ]
185
188
runner 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"
190
193
191
194
-- | Runner selection for bindist jobs
192
195
bindistRunner :: Arch -> Opsys -> [Value ]
193
- bindistRunner Amd64 (Linux _) = [" self-hosted" , " linux-space" , " maerwald" ]
196
+ bindistRunner Amd64 (Linux _) = [" self-hosted" , " linux-space" , " maerwald" ]
194
197
bindistRunner 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"
199
202
200
203
-------------------------------------------------------------------------------
201
204
-- Action generatation
@@ -215,7 +218,7 @@ bindistRunner AArch64 Windows = error "aarch64 windows not supported"
215
218
-- called 'actionName', located at 'actionPath'
216
219
data Action
217
220
= Action
218
- { actionName :: String
221
+ { actionName :: String
219
222
, actionDistro :: Distro
220
223
}
221
224
@@ -254,7 +257,7 @@ instance ToJSON Action where
254
257
255
258
configAction :: Config -> Maybe Action
256
259
configAction (MkConfig Amd64 (Linux d) _) = Just $ Action (distroActionName d) d
257
- configAction _ = Nothing
260
+ configAction _ = Nothing
258
261
259
262
distroActionName :: Distro -> String
260
263
distroActionName d = " action-" ++ distroName d
@@ -274,7 +277,7 @@ customAction d st = flip (ghAction stepName (actionPath d)) [] $ case st of
274
277
where
275
278
stepName = case st of
276
279
Build v -> " Build " ++ ghcVersion v
277
- Test -> " Test"
280
+ Test -> " Test"
278
281
Bindist -> " Bindist"
279
282
280
283
-------------------------------------------------------------------------------
0 commit comments