Skip to content

Commit 60e619e

Browse files
committed
Only build 2 flavors of linux binaries
- glibc (dynamic) - musl (fully static) 'gmp' and 'zlib' are always statically linked.
1 parent 108c974 commit 60e619e

File tree

1 file changed

+69
-108
lines changed

1 file changed

+69
-108
lines changed

.github/workflows/reusable-release.yml

Lines changed: 69 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
ghc_targets:
1515
type: string
1616
default: "install_bin install_lib update_package_db"
17+
gmp:
18+
type: string
19+
default: 6.3.0
1720
cabal:
1821
type: string
1922
default: 3.14.2.0
@@ -25,6 +28,7 @@ env:
2528
GHC_VERSION: ${{ inputs.ghc }}
2629
GHC_TARGETS: ${{ inputs.ghc_targets }}
2730
CABAL_VERSION: ${{ inputs.cabal }}
31+
GMP_VERSION: ${{ inputs.gmp }}
2832
DEBIAN_FRONTEND: noninteractive
2933
TZ: Asia/Singapore
3034

@@ -63,89 +67,19 @@ jobs:
6367
fail-fast: false
6468
matrix:
6569
branch: ${{ fromJSON(inputs.branches) }}
66-
platform: [ { image: "debian:11"
67-
, installCmd: "apt-get update && apt-get install -y"
68-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
69-
, DISTRO: "Debian"
70-
, ARTIFACT: "x86_64-linux-deb11"
71-
, ADD_CABAL_ARGS: "--enable-split-sections"
72-
},
73-
{ image: "debian:12"
74-
, installCmd: "apt-get update && apt-get install -y"
75-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
76-
, DISTRO: "Debian"
77-
, ARTIFACT: "x86_64-linux-deb12"
78-
, ADD_CABAL_ARGS: "--enable-split-sections"
79-
},
80-
{ image: "ubuntu:20.04"
81-
, installCmd: "apt-get update && apt-get install -y"
82-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
83-
, DISTRO: "Ubuntu"
84-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
85-
, ADD_CABAL_ARGS: "--enable-split-sections"
86-
},
87-
{ image: "ubuntu:22.04"
88-
, installCmd: "apt-get update && apt-get install -y"
89-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
90-
, DISTRO: "Ubuntu"
91-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
92-
, ADD_CABAL_ARGS: "--enable-split-sections"
93-
},
94-
{ image: "ubuntu:24.04"
95-
, installCmd: "apt-get update && apt-get install -y"
96-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
97-
, DISTRO: "Ubuntu"
98-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
99-
, ADD_CABAL_ARGS: "--enable-split-sections"
100-
},
101-
{ image: "fedora:33"
102-
, installCmd: "dnf install -y"
103-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
104-
, DISTRO: "Fedora"
105-
, ARTIFACT: "x86_64-linux-fedora33"
106-
, ADD_CABAL_ARGS: "--enable-split-sections"
107-
},
108-
{ image: "fedora:36"
109-
, installCmd: "dnf install -y"
110-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
111-
, DISTRO: "Fedora"
112-
, ARTIFACT: "x86_64-linux-fedora36"
113-
, ADD_CABAL_ARGS: "--enable-split-sections"
114-
},
115-
{ image: "fedora:38"
116-
, installCmd: "dnf install -y"
117-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
118-
, DISTRO: "Fedora"
119-
, ARTIFACT: "x86_64-linux-fedora38"
120-
, ADD_CABAL_ARGS: "--enable-split-sections"
121-
},
122-
{ image: "rockylinux:8"
70+
platform: [ { image: "rockylinux:8"
12371
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
12472
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
125-
, DISTRO: "Unknown"
126-
, ARTIFACT: "x86_64-linux-rocky8"
73+
, DISTRO: "Rockylinux"
74+
, ARTIFACT: "x86_64-linux-glibc"
12775
, ADD_CABAL_ARGS: "--enable-split-sections"
12876
},
12977
{ image: "alpine:3.20"
13078
, installCmd: "apk update && apk add"
13179
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
132-
, DISTRO: "Unknown"
133-
, ARTIFACT: "x86_64-linux-unknown"
80+
, DISTRO: "Alpine"
81+
, ARTIFACT: "x86_64-linux-musl-static"
13482
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
135-
},
136-
{ image: "alpine:3.12"
137-
, installCmd: "apk update && apk add"
138-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
139-
, DISTRO: "Unknown"
140-
, ARTIFACT: "x86_64-linux-alpine312"
141-
, ADD_CABAL_ARGS: "--enable-split-sections"
142-
},
143-
{ image: "alpine:3.20"
144-
, installCmd: "apk update && apk add"
145-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
146-
, DISTRO: "Unknown"
147-
, ARTIFACT: "x86_64-linux-alpine320"
148-
, ADD_CABAL_ARGS: "--enable-split-sections"
14983
}
15084
]
15185
container:
@@ -165,15 +99,35 @@ jobs:
16599
with:
166100
ref: ${{ matrix.branch }}
167101

102+
- name: install GMP
103+
if: matrix.platform.DISTRO == 'Rockylinux'
104+
run: |
105+
set -eux
106+
107+
curl -O -L https://gmplib.org/download/gmp/gmp-${{ env.GMP_VERSION }}.tar.xz
108+
tar xf gmp-${{ env.GMP_VERSION }}.tar.xz
109+
cd gmp-${{ env.GMP_VERSION }}
110+
./configure --prefix=$HOME/.local/ --disable-shared
111+
make install
112+
cd ..
113+
echo "extra-lib-dirs: $HOME/.local/lib/" >> cabal.release.project.local
114+
168115
- name: Run build
169116
run: |
170117
bash .github/scripts/build.sh
171-
172118
env:
173119
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
174120
DISTRO: ${{ matrix.platform.DISTRO }}
175121
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }}
176122

123+
- name: check linking
124+
if: matrix.platform.DISTRO == 'Rockylinux'
125+
run: |
126+
cd out
127+
tar xf *.${TARBALL_EXT}
128+
ldd cabal | grep --quiet gmp && exit 1
129+
rm cabal plan.json
130+
177131
- if: always()
178132
name: Upload artifact
179133
uses: ./.github/actions/upload
@@ -456,6 +410,7 @@ jobs:
456410
env:
457411
TARBALL_EXT: tar.xz
458412
ARCH: 64
413+
ADD_CABAL_ARGS: ""
459414
strategy:
460415
fail-fast: false
461416
matrix:
@@ -464,85 +419,91 @@ jobs:
464419
, installCmd: "apt-get update && apt-get install -y"
465420
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
466421
, DISTRO: "Debian"
467-
, ARTIFACT: "x86_64-linux-deb11"
468-
, ADD_CABAL_ARGS: "--enable-split-sections"
422+
, ARTIFACT: "x86_64-linux-glibc"
469423
},
470424
{ image: "debian:12"
471425
, installCmd: "apt-get update && apt-get install -y"
472426
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
473427
, DISTRO: "Debian"
474-
, ARTIFACT: "x86_64-linux-deb12"
475-
, ADD_CABAL_ARGS: "--enable-split-sections"
428+
, ARTIFACT: "x86_64-linux-glibc"
476429
},
477430
{ image: "ubuntu:20.04"
478431
, installCmd: "apt-get update && apt-get install -y"
479432
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
480433
, DISTRO: "Ubuntu"
481-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
482-
, ADD_CABAL_ARGS: "--enable-split-sections"
434+
, ARTIFACT: "x86_64-linux-glibc"
483435
},
484436
{ image: "ubuntu:22.04"
485437
, installCmd: "apt-get update && apt-get install -y"
486438
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
487439
, DISTRO: "Ubuntu"
488-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
489-
, ADD_CABAL_ARGS: "--enable-split-sections"
440+
, ARTIFACT: "x86_64-linux-glibc"
490441
},
491442
{ image: "ubuntu:24.04"
492443
, installCmd: "apt-get update && apt-get install -y"
493444
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
494445
, DISTRO: "Ubuntu"
495-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
496-
, ADD_CABAL_ARGS: "--enable-split-sections"
446+
, ARTIFACT: "x86_64-linux-glibc"
447+
},
448+
{ image: "linuxmintd/mint20.3-amd64"
449+
, installCmd: "apt-get update && apt-get install -y"
450+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
451+
, DISTRO: "Mint"
452+
, ARTIFACT: "x86_64-linux-glibc"
453+
},
454+
{ image: "linuxmintd/mint21.3-amd64"
455+
, installCmd: "apt-get update && apt-get install -y"
456+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
457+
, DISTRO: "Mint"
458+
, ARTIFACT: "x86_64-linux-glibc"
497459
},
498460
{ image: "fedora:33"
499461
, installCmd: "dnf install -y"
500462
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
501463
, DISTRO: "Fedora"
502-
, ARTIFACT: "x86_64-linux-fedora33"
503-
, ADD_CABAL_ARGS: "--enable-split-sections"
464+
, ARTIFACT: "x86_64-linux-glibc"
504465
},
505-
{ image: "fedora:36"
466+
{ image: "fedora:37"
506467
, installCmd: "dnf install -y"
507468
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
508469
, DISTRO: "Fedora"
509-
, ARTIFACT: "x86_64-linux-fedora36"
510-
, ADD_CABAL_ARGS: "--enable-split-sections"
470+
, ARTIFACT: "x86_64-linux-glibc"
511471
},
512-
{ image: "fedora:38"
472+
{ image: "fedora:42"
513473
, installCmd: "dnf install -y"
514474
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
515475
, DISTRO: "Fedora"
516-
, ARTIFACT: "x86_64-linux-fedora38"
517-
, ADD_CABAL_ARGS: "--enable-split-sections"
476+
, ARTIFACT: "x86_64-linux-glibc"
518477
},
519478
{ image: "rockylinux:8"
520479
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
521480
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
522-
, DISTRO: "Unknown"
523-
, ARTIFACT: "x86_64-linux-rocky8"
524-
, ADD_CABAL_ARGS: "--enable-split-sections"
481+
, DISTRO: "Rockylinux"
482+
, ARTIFACT: "x86_64-linux-glibc"
483+
},
484+
{ image: "rockylinux:9"
485+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
486+
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
487+
, DISTRO: "Rockylinux"
488+
, ARTIFACT: "x86_64-linux-glibc"
525489
},
526490
{ image: "alpine:3.20"
527491
, installCmd: "apk update && apk add"
528492
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
529-
, DISTRO: "Unknown"
530-
, ARTIFACT: "x86_64-linux-unknown"
531-
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
493+
, DISTRO: "Alpine"
494+
, ARTIFACT: "x86_64-linux-musl-static"
532495
},
533496
{ image: "alpine:3.12"
534497
, installCmd: "apk update && apk add"
535498
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
536-
, DISTRO: "Unknown"
537-
, ARTIFACT: "x86_64-linux-alpine312"
538-
, ADD_CABAL_ARGS: "--enable-split-sections"
499+
, DISTRO: "Alpine"
500+
, ARTIFACT: "x86_64-linux-musl-static"
539501
},
540-
{ image: "alpine:3.20"
541-
, installCmd: "apk update && apk add"
542-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
502+
{ image: "ghcr.io/void-linux/void-glibc:latest"
503+
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
504+
, toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}"
543505
, DISTRO: "Unknown"
544-
, ARTIFACT: "x86_64-linux-alpine320"
545-
, ADD_CABAL_ARGS: "--enable-split-sections"
506+
, ARTIFACT: "x86_64-linux-musl-static"
546507
}
547508
]
548509
container:

0 commit comments

Comments
 (0)