Skip to content

Commit 6aabab0

Browse files
committed
Only build 2 flavors of linux binaries
- glibc (dynamic) - musl (fully static) 'gmp' and 'zlib' are always statically linked.
1 parent 5cabbce commit 6aabab0

File tree

1 file changed

+68
-95
lines changed

1 file changed

+68
-95
lines changed

.github/workflows/reusable-release.yml

Lines changed: 68 additions & 95 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
@@ -30,6 +33,7 @@ env:
3033
GHC_TEST_VERSION: 9.6.7
3134
GHC_TEST_TARGETS: "install_bin install_lib update_package_db"
3235
CABAL_VERSION: ${{ inputs.cabal }}
36+
GMP_VERSION: ${{ inputs.gmp }}
3337
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
3438
BOOTSTRAP_HASKELL_MINIMAL: 1
3539
DEBIAN_FRONTEND: noninteractive
@@ -70,89 +74,19 @@ jobs:
7074
fail-fast: false
7175
matrix:
7276
branch: ${{ fromJSON(inputs.branches) }}
73-
platform: [ { image: "debian:11"
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-deb11"
78-
, ADD_CABAL_ARGS: "--enable-split-sections"
79-
},
80-
{ image: "debian:12"
81-
, installCmd: "apt-get update && apt-get install -y"
82-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
83-
, DISTRO: "Debian"
84-
, ARTIFACT: "x86_64-linux-deb12"
85-
, ADD_CABAL_ARGS: "--enable-split-sections"
86-
},
87-
{ image: "ubuntu:20.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-ubuntu20.04"
92-
, ADD_CABAL_ARGS: "--enable-split-sections"
93-
},
94-
{ image: "ubuntu:22.04"
95-
, installCmd: "apt-get update && apt-get install -y"
96-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
97-
, DISTRO: "Ubuntu"
98-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
99-
, ADD_CABAL_ARGS: "--enable-split-sections"
100-
},
101-
{ image: "ubuntu:24.04"
102-
, installCmd: "apt-get update && apt-get install -y"
103-
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
104-
, DISTRO: "Ubuntu"
105-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
106-
, ADD_CABAL_ARGS: "--enable-split-sections"
107-
},
108-
{ image: "fedora:33"
109-
, installCmd: "dnf install -y"
110-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
111-
, DISTRO: "Fedora"
112-
, ARTIFACT: "x86_64-linux-fedora33"
113-
, ADD_CABAL_ARGS: "--enable-split-sections"
114-
},
115-
{ image: "fedora:36"
116-
, installCmd: "dnf install -y"
117-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
118-
, DISTRO: "Fedora"
119-
, ARTIFACT: "x86_64-linux-fedora36"
120-
, ADD_CABAL_ARGS: "--enable-split-sections"
121-
},
122-
{ image: "fedora:38"
123-
, installCmd: "dnf install -y"
124-
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
125-
, DISTRO: "Fedora"
126-
, ARTIFACT: "x86_64-linux-fedora38"
127-
, ADD_CABAL_ARGS: "--enable-split-sections"
128-
},
129-
{ image: "rockylinux:8"
77+
platform: [ { image: "rockylinux:8"
13078
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
13179
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
132-
, DISTRO: "Unknown"
133-
, ARTIFACT: "x86_64-linux-rocky8"
80+
, DISTRO: "Rockylinux"
81+
, ARTIFACT: "x86_64-linux-glibc"
13482
, ADD_CABAL_ARGS: "--enable-split-sections"
13583
},
13684
{ image: "alpine:3.20"
13785
, installCmd: "apk update && apk add"
13886
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
139-
, DISTRO: "Unknown"
140-
, ARTIFACT: "x86_64-linux-unknown"
87+
, DISTRO: "Alpine"
88+
, ARTIFACT: "x86_64-linux-musl-static"
14189
, ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
142-
},
143-
{ image: "alpine:3.12"
144-
, installCmd: "apk update && apk add"
145-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
146-
, DISTRO: "Unknown"
147-
, ARTIFACT: "x86_64-linux-alpine312"
148-
, ADD_CABAL_ARGS: "--enable-split-sections"
149-
},
150-
{ image: "alpine:3.20"
151-
, installCmd: "apk update && apk add"
152-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
153-
, DISTRO: "Unknown"
154-
, ARTIFACT: "x86_64-linux-alpine320"
155-
, ADD_CABAL_ARGS: "--enable-split-sections"
15690
}
15791
]
15892
container:
@@ -172,6 +106,19 @@ jobs:
172106
with:
173107
ref: ${{ matrix.branch }}
174108

109+
- name: install GMP
110+
if: matrix.platform.DISTRO == 'Rockylinux'
111+
run: |
112+
set -eux
113+
114+
curl -O -L https://gmplib.org/download/gmp/gmp-${{ env.GMP_VERSION }}.tar.xz
115+
tar xf gmp-${{ env.GMP_VERSION }}.tar.xz
116+
cd gmp-${{ env.GMP_VERSION }}
117+
CFLAGS=-fPIC ./configure --prefix=$HOME/.local/ --disable-shared
118+
make install
119+
cd ..
120+
echo "extra-lib-dirs: $HOME/.local/lib/" >> cabal.release.project.local
121+
175122
- name: Run build
176123
run: |
177124
bash .github/scripts/build.bash
@@ -181,6 +128,14 @@ jobs:
181128
DISTRO: ${{ matrix.platform.DISTRO }}
182129
ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }}
183130

131+
- name: check linking
132+
if: matrix.platform.DISTRO == 'Rockylinux'
133+
run: |
134+
cd out
135+
tar xf *.${TARBALL_EXT}
136+
ldd cabal | grep --quiet gmp && exit 1
137+
rm cabal plan.json
138+
184139
- if: always()
185140
name: Upload artifact
186141
uses: ./.github/actions/upload
@@ -473,73 +428,91 @@ jobs:
473428
, installCmd: "apt-get update && apt-get install -y"
474429
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
475430
, DISTRO: "Debian"
476-
, ARTIFACT: "x86_64-linux-deb11"
431+
, ARTIFACT: "x86_64-linux-glibc"
477432
},
478433
{ image: "debian:12"
479434
, installCmd: "apt-get update && apt-get install -y"
480435
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
481436
, DISTRO: "Debian"
482-
, ARTIFACT: "x86_64-linux-deb12"
437+
, ARTIFACT: "x86_64-linux-glibc"
483438
},
484439
{ image: "ubuntu:20.04"
485440
, installCmd: "apt-get update && apt-get install -y"
486441
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
487442
, DISTRO: "Ubuntu"
488-
, ARTIFACT: "x86_64-linux-ubuntu20.04"
443+
, ARTIFACT: "x86_64-linux-glibc"
489444
},
490445
{ image: "ubuntu:22.04"
491446
, installCmd: "apt-get update && apt-get install -y"
492447
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
493448
, DISTRO: "Ubuntu"
494-
, ARTIFACT: "x86_64-linux-ubuntu22.04"
449+
, ARTIFACT: "x86_64-linux-glibc"
495450
},
496451
{ image: "ubuntu:24.04"
497452
, installCmd: "apt-get update && apt-get install -y"
498453
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}"
499454
, DISTRO: "Ubuntu"
500-
, ARTIFACT: "x86_64-linux-ubuntu24.04"
455+
, ARTIFACT: "x86_64-linux-glibc"
456+
},
457+
{ image: "linuxmintd/mint20.3-amd64"
458+
, installCmd: "apt-get update && apt-get install -y"
459+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
460+
, DISTRO: "Mint"
461+
, ARTIFACT: "x86_64-linux-glibc"
462+
},
463+
{ image: "linuxmintd/mint21.3-amd64"
464+
, installCmd: "apt-get update && apt-get install -y"
465+
, toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}"
466+
, DISTRO: "Mint"
467+
, ARTIFACT: "x86_64-linux-glibc"
501468
},
502469
{ image: "fedora:33"
503470
, installCmd: "dnf install -y"
504471
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
505472
, DISTRO: "Fedora"
506-
, ARTIFACT: "x86_64-linux-fedora33"
473+
, ARTIFACT: "x86_64-linux-glibc"
507474
},
508-
{ image: "fedora:36"
475+
{ image: "fedora:37"
509476
, installCmd: "dnf install -y"
510477
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
511478
, DISTRO: "Fedora"
512-
, ARTIFACT: "x86_64-linux-fedora36"
479+
, ARTIFACT: "x86_64-linux-glibc"
513480
},
514-
{ image: "fedora:38"
481+
{ image: "fedora:42"
515482
, installCmd: "dnf install -y"
516483
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
517484
, DISTRO: "Fedora"
518-
, ARTIFACT: "x86_64-linux-fedora38"
485+
, ARTIFACT: "x86_64-linux-glibc"
519486
},
520487
{ image: "rockylinux:8"
521488
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
522489
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
523-
, DISTRO: "Unknown"
524-
, ARTIFACT: "x86_64-linux-rocky8"
490+
, DISTRO: "Rockylinux"
491+
, ARTIFACT: "x86_64-linux-glibc"
492+
},
493+
{ image: "rockylinux:9"
494+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
495+
, toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}"
496+
, DISTRO: "Rockylinux"
497+
, ARTIFACT: "x86_64-linux-glibc"
525498
},
526499
{ image: "alpine:3.20"
527500
, installCmd: "apk update && apk add"
528501
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
529-
, DISTRO: "Unknown"
530-
, ARTIFACT: "x86_64-linux-unknown"
502+
, DISTRO: "Alpine"
503+
, ARTIFACT: "x86_64-linux-musl-static"
531504
},
532505
{ image: "alpine:3.12"
533506
, installCmd: "apk update && apk add"
534507
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
535-
, DISTRO: "Unknown"
536-
, ARTIFACT: "x86_64-linux-alpine312"
508+
, DISTRO: "Alpine"
509+
, ARTIFACT: "x86_64-linux-musl-static"
537510
},
538-
{ image: "alpine:3.20"
539-
, installCmd: "apk update && apk add"
540-
, toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}"
511+
{ image: "ghcr.io/void-linux/void-glibc:latest"
512+
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
513+
, toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}"
541514
, DISTRO: "Unknown"
542-
, ARTIFACT: "x86_64-linux-alpine320"
515+
, ARTIFACT: "x86_64-linux-musl-static"
543516
}
544517
]
545518
container:

0 commit comments

Comments
 (0)