Skip to content

Commit 06fedea

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 06fedea

File tree

2 files changed

+66
-109
lines changed

2 files changed

+66
-109
lines changed

.github/scripts/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,3 @@ case "${TARBALL_EXT}" in
5353
;;
5454
esac
5555

56-
rm "cabal${ext}" plan.json
57-

.github/workflows/reusable-release.yml

Lines changed: 66 additions & 107 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,10 +99,28 @@ 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
171118
119+
- name: check linking
120+
if: matrix.platform.DISTRO == 'Rockylinux'
121+
run: |
122+
ldd out/cabal | grep --quiet gmp && exit 1
123+
172124
env:
173125
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
174126
DISTRO: ${{ matrix.platform.DISTRO }}
@@ -456,6 +408,7 @@ jobs:
456408
env:
457409
TARBALL_EXT: tar.xz
458410
ARCH: 64
411+
ADD_CABAL_ARGS: ""
459412
strategy:
460413
fail-fast: false
461414
matrix:
@@ -464,85 +417,91 @@ jobs:
464417
, installCmd: "apt-get update && apt-get install -y"
465418
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
466419
, DISTRO: "Debian"
467-
, ARTIFACT: "x86_64-linux-deb11"
468-
, ADD_CABAL_ARGS: "--enable-split-sections"
420+
, ARTIFACT: "x86_64-linux-glibc"
469421
},
470422
{ image: "debian:12"
471423
, installCmd: "apt-get update && apt-get install -y"
472424
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
473425
, DISTRO: "Debian"
474-
, ARTIFACT: "x86_64-linux-deb12"
475-
, ADD_CABAL_ARGS: "--enable-split-sections"
426+
, ARTIFACT: "x86_64-linux-glibc"
476427
},
477428
{ image: "ubuntu:20.04"
478429
, installCmd: "apt-get update && apt-get install -y"
479430
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
480431
, DISTRO: "Ubuntu"
481-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
482-
, ADD_CABAL_ARGS: "--enable-split-sections"
432+
, ARTIFACT: "x86_64-linux-glibc"
483433
},
484434
{ image: "ubuntu:22.04"
485435
, installCmd: "apt-get update && apt-get install -y"
486436
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
487437
, DISTRO: "Ubuntu"
488-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
489-
, ADD_CABAL_ARGS: "--enable-split-sections"
438+
, ARTIFACT: "x86_64-linux-glibc"
490439
},
491440
{ image: "ubuntu:24.04"
492441
, installCmd: "apt-get update && apt-get install -y"
493442
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
494443
, DISTRO: "Ubuntu"
495-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
496-
, ADD_CABAL_ARGS: "--enable-split-sections"
444+
, ARTIFACT: "x86_64-linux-glibc"
445+
},
446+
{ image: "linuxmintd/mint20.3-amd64"
447+
, installCmd: "apt-get update && apt-get install -y"
448+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
449+
, DISTRO: "Mint"
450+
, ARTIFACT: "x86_64-linux-glibc"
451+
},
452+
{ image: "linuxmintd/mint21.3-amd64"
453+
, installCmd: "apt-get update && apt-get install -y"
454+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
455+
, DISTRO: "Mint"
456+
, ARTIFACT: "x86_64-linux-glibc"
497457
},
498458
{ image: "fedora:33"
499459
, installCmd: "dnf install -y"
500460
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
501461
, DISTRO: "Fedora"
502-
, ARTIFACT: "x86_64-linux-fedora33"
503-
, ADD_CABAL_ARGS: "--enable-split-sections"
462+
, ARTIFACT: "x86_64-linux-glibc"
504463
},
505-
{ image: "fedora:36"
464+
{ image: "fedora:37"
506465
, installCmd: "dnf install -y"
507466
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
508467
, DISTRO: "Fedora"
509-
, ARTIFACT: "x86_64-linux-fedora36"
510-
, ADD_CABAL_ARGS: "--enable-split-sections"
468+
, ARTIFACT: "x86_64-linux-glibc"
511469
},
512-
{ image: "fedora:38"
470+
{ image: "fedora:42"
513471
, installCmd: "dnf install -y"
514472
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
515473
, DISTRO: "Fedora"
516-
, ARTIFACT: "x86_64-linux-fedora38"
517-
, ADD_CABAL_ARGS: "--enable-split-sections"
474+
, ARTIFACT: "x86_64-linux-glibc"
518475
},
519476
{ image: "rockylinux:8"
520477
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
521478
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
522-
, DISTRO: "Unknown"
523-
, ARTIFACT: "x86_64-linux-rocky8"
524-
, ADD_CABAL_ARGS: "--enable-split-sections"
479+
, DISTRO: "Rockylinux"
480+
, ARTIFACT: "x86_64-linux-glibc"
481+
},
482+
{ image: "rockylinux:9"
483+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
484+
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
485+
, DISTRO: "Rockylinux"
486+
, ARTIFACT: "x86_64-linux-glibc"
525487
},
526488
{ image: "alpine:3.20"
527489
, installCmd: "apk update && apk add"
528490
, 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"
491+
, DISTRO: "Alpine"
492+
, ARTIFACT: "x86_64-linux-musl-static"
532493
},
533494
{ image: "alpine:3.12"
534495
, installCmd: "apk update && apk add"
535496
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
536-
, DISTRO: "Unknown"
537-
, ARTIFACT: "x86_64-linux-alpine312"
538-
, ADD_CABAL_ARGS: "--enable-split-sections"
497+
, DISTRO: "Alpine"
498+
, ARTIFACT: "x86_64-linux-musl-static"
539499
},
540-
{ image: "alpine:3.20"
541-
, installCmd: "apk update && apk add"
542-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
500+
{ image: "ghcr.io/void-linux/void-glibc:latest"
501+
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
502+
, toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}"
543503
, DISTRO: "Unknown"
544-
, ARTIFACT: "x86_64-linux-alpine320"
545-
, ADD_CABAL_ARGS: "--enable-split-sections"
504+
, ARTIFACT: "x86_64-linux-musl-static"
546505
}
547506
]
548507
container:

0 commit comments

Comments
 (0)