Skip to content

Commit 0559b37

Browse files
committed
Only build 2 flavors of linux binaries
- glibc (dynamic) - musl (fully static) 'gmp' and 'zlib' are always statically linked.
1 parent 4e18b1f commit 0559b37

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 install_extra"
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
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
2933
BOOTSTRAP_HASKELL_MINIMAL: 1
3034
DEBIAN_FRONTEND: noninteractive
@@ -65,89 +69,19 @@ jobs:
6569
fail-fast: false
6670
matrix:
6771
branch: ${{ fromJSON(inputs.branches) }}
68-
platform: [ { image: "debian:11"
69-
, installCmd: "apt-get update && apt-get install -y"
70-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
71-
, DISTRO: "Debian"
72-
, ARTIFACT: "x86_64-linux-deb11"
73-
, ADD_CABAL_ARGS: "--enable-split-sections"
74-
},
75-
{ image: "debian:12"
76-
, installCmd: "apt-get update && apt-get install -y"
77-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
78-
, DISTRO: "Debian"
79-
, ARTIFACT: "x86_64-linux-deb12"
80-
, ADD_CABAL_ARGS: "--enable-split-sections"
81-
},
82-
{ image: "ubuntu:20.04"
83-
, installCmd: "apt-get update && apt-get install -y"
84-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
85-
, DISTRO: "Ubuntu"
86-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
87-
, ADD_CABAL_ARGS: "--enable-split-sections"
88-
},
89-
{ image: "ubuntu:22.04"
90-
, installCmd: "apt-get update && apt-get install -y"
91-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
92-
, DISTRO: "Ubuntu"
93-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
94-
, ADD_CABAL_ARGS: "--enable-split-sections"
95-
},
96-
{ image: "ubuntu:24.04"
97-
, installCmd: "apt-get update && apt-get install -y"
98-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
99-
, DISTRO: "Ubuntu"
100-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
101-
, ADD_CABAL_ARGS: "--enable-split-sections"
102-
},
103-
{ image: "fedora:33"
104-
, installCmd: "dnf install -y"
105-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
106-
, DISTRO: "Fedora"
107-
, ARTIFACT: "x86_64-linux-fedora33"
108-
, ADD_CABAL_ARGS: "--enable-split-sections"
109-
},
110-
{ image: "fedora:36"
111-
, installCmd: "dnf install -y"
112-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
113-
, DISTRO: "Fedora"
114-
, ARTIFACT: "x86_64-linux-fedora36"
115-
, ADD_CABAL_ARGS: "--enable-split-sections"
116-
},
117-
{ image: "fedora:38"
118-
, installCmd: "dnf install -y"
119-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
120-
, DISTRO: "Fedora"
121-
, ARTIFACT: "x86_64-linux-fedora38"
122-
, ADD_CABAL_ARGS: "--enable-split-sections"
123-
},
124-
{ image: "rockylinux:8"
72+
platform: [ { image: "rockylinux:8"
12573
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
12674
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
127-
, DISTRO: "Unknown"
128-
, ARTIFACT: "x86_64-linux-rocky8"
75+
, DISTRO: "Rockylinux"
76+
, ARTIFACT: "x86_64-linux-glibc"
12977
, ADD_CABAL_ARGS: "--enable-split-sections"
13078
},
13179
{ image: "alpine:3.20"
13280
, installCmd: "apk update && apk add"
13381
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
134-
, DISTRO: "Unknown"
135-
, ARTIFACT: "x86_64-linux-unknown"
82+
, DISTRO: "Alpine"
83+
, ARTIFACT: "x86_64-linux-musl-static"
13684
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
137-
},
138-
{ image: "alpine:3.12"
139-
, installCmd: "apk update && apk add"
140-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
141-
, DISTRO: "Unknown"
142-
, ARTIFACT: "x86_64-linux-alpine312"
143-
, ADD_CABAL_ARGS: "--enable-split-sections"
144-
},
145-
{ image: "alpine:3.20"
146-
, installCmd: "apk update && apk add"
147-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
148-
, DISTRO: "Unknown"
149-
, ARTIFACT: "x86_64-linux-alpine320"
150-
, ADD_CABAL_ARGS: "--enable-split-sections"
15185
}
15286
]
15387
container:
@@ -167,15 +101,35 @@ jobs:
167101
with:
168102
ref: ${{ matrix.branch }}
169103

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

125+
- name: check linking
126+
if: matrix.platform.DISTRO == 'Rockylinux'
127+
run: |
128+
cd out
129+
tar xf *.${TARBALL_EXT}
130+
ldd cabal | grep --quiet gmp && exit 1
131+
rm cabal plan.json
132+
179133
- if: always()
180134
name: Upload artifact
181135
uses: ./.github/actions/upload
@@ -462,6 +416,7 @@ jobs:
462416
ARCH: 64
463417
GHC_VERSION: 9.6.7
464418
GHC_TARGETS: "install_bin install_lib update_package_db"
419+
ADD_CABAL_ARGS: ""
465420
strategy:
466421
fail-fast: false
467422
matrix:
@@ -470,85 +425,91 @@ jobs:
470425
, installCmd: "apt-get update && apt-get install -y"
471426
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
472427
, DISTRO: "Debian"
473-
, ARTIFACT: "x86_64-linux-deb11"
474-
, ADD_CABAL_ARGS: "--enable-split-sections"
428+
, ARTIFACT: "x86_64-linux-glibc"
475429
},
476430
{ image: "debian:12"
477431
, installCmd: "apt-get update && apt-get install -y"
478432
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
479433
, DISTRO: "Debian"
480-
, ARTIFACT: "x86_64-linux-deb12"
481-
, ADD_CABAL_ARGS: "--enable-split-sections"
434+
, ARTIFACT: "x86_64-linux-glibc"
482435
},
483436
{ image: "ubuntu:20.04"
484437
, installCmd: "apt-get update && apt-get install -y"
485438
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
486439
, DISTRO: "Ubuntu"
487-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
488-
, ADD_CABAL_ARGS: "--enable-split-sections"
440+
, ARTIFACT: "x86_64-linux-glibc"
489441
},
490442
{ image: "ubuntu:22.04"
491443
, installCmd: "apt-get update && apt-get install -y"
492444
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
493445
, DISTRO: "Ubuntu"
494-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
495-
, ADD_CABAL_ARGS: "--enable-split-sections"
446+
, ARTIFACT: "x86_64-linux-glibc"
496447
},
497448
{ image: "ubuntu:24.04"
498449
, installCmd: "apt-get update && apt-get install -y"
499450
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
500451
, DISTRO: "Ubuntu"
501-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
502-
, ADD_CABAL_ARGS: "--enable-split-sections"
452+
, ARTIFACT: "x86_64-linux-glibc"
453+
},
454+
{ image: "linuxmintd/mint20.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"
459+
},
460+
{ image: "linuxmintd/mint21.3-amd64"
461+
, installCmd: "apt-get update && apt-get install -y"
462+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
463+
, DISTRO: "Mint"
464+
, ARTIFACT: "x86_64-linux-glibc"
503465
},
504466
{ image: "fedora:33"
505467
, installCmd: "dnf install -y"
506468
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
507469
, DISTRO: "Fedora"
508-
, ARTIFACT: "x86_64-linux-fedora33"
509-
, ADD_CABAL_ARGS: "--enable-split-sections"
470+
, ARTIFACT: "x86_64-linux-glibc"
510471
},
511-
{ image: "fedora:36"
472+
{ image: "fedora:37"
512473
, installCmd: "dnf install -y"
513474
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
514475
, DISTRO: "Fedora"
515-
, ARTIFACT: "x86_64-linux-fedora36"
516-
, ADD_CABAL_ARGS: "--enable-split-sections"
476+
, ARTIFACT: "x86_64-linux-glibc"
517477
},
518-
{ image: "fedora:38"
478+
{ image: "fedora:42"
519479
, installCmd: "dnf install -y"
520480
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
521481
, DISTRO: "Fedora"
522-
, ARTIFACT: "x86_64-linux-fedora38"
523-
, ADD_CABAL_ARGS: "--enable-split-sections"
482+
, ARTIFACT: "x86_64-linux-glibc"
524483
},
525484
{ image: "rockylinux:8"
526485
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
527486
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
528-
, DISTRO: "Unknown"
529-
, ARTIFACT: "x86_64-linux-rocky8"
530-
, ADD_CABAL_ARGS: "--enable-split-sections"
487+
, DISTRO: "Rockylinux"
488+
, ARTIFACT: "x86_64-linux-glibc"
489+
},
490+
{ image: "rockylinux:9"
491+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
492+
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
493+
, DISTRO: "Rockylinux"
494+
, ARTIFACT: "x86_64-linux-glibc"
531495
},
532496
{ image: "alpine:3.20"
533497
, installCmd: "apk update && apk add"
534498
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
535-
, DISTRO: "Unknown"
536-
, ARTIFACT: "x86_64-linux-unknown"
537-
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
499+
, DISTRO: "Alpine"
500+
, ARTIFACT: "x86_64-linux-musl-static"
538501
},
539502
{ image: "alpine:3.12"
540503
, installCmd: "apk update && apk add"
541504
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
542-
, DISTRO: "Unknown"
543-
, ARTIFACT: "x86_64-linux-alpine312"
544-
, ADD_CABAL_ARGS: "--enable-split-sections"
505+
, DISTRO: "Alpine"
506+
, ARTIFACT: "x86_64-linux-musl-static"
545507
},
546-
{ image: "alpine:3.20"
547-
, installCmd: "apk update && apk add"
548-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
508+
{ image: "ghcr.io/void-linux/void-glibc:latest"
509+
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
510+
, toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}"
549511
, DISTRO: "Unknown"
550-
, ARTIFACT: "x86_64-linux-alpine320"
551-
, ADD_CABAL_ARGS: "--enable-split-sections"
512+
, ARTIFACT: "x86_64-linux-musl-static"
552513
}
553514
]
554515
container:

0 commit comments

Comments
 (0)