ci: binaries-linux-x64: try ghc 9.0 and cabal 3.8 again

This commit is contained in:
Simon Michael 2024-04-17 17:38:40 -10:00
parent dc4a0ff82c
commit 0bcad0a39c

View File

@ -41,72 +41,72 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-ghcup ${{ runner.os }}-ghcup
# - name: process cache of cabal-installed libs - name: process cache of cabal-installed libs
# id: cabal id: cabal
uses: actions/cache@v4
with:
path: ~/.cabal
key: ${{ runner.os }}-cabal-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-cabal
# - name: process cache of stack global package db
# id: stack-global
# uses: actions/cache@v4 # uses: actions/cache@v4
# with: # with:
# path: ~/.cabal # path: ~/.stack
# key: ${{ runner.os }}-cabal-${{ hashFiles('**.yaml') }} # key: ${{ runner.os }}-stack-global-20240417-${{ hashFiles('**.yaml') }}
# restore-keys: | # restore-keys: |
# ${{ runner.os }}-cabal # ${{ runner.os }}-stack-global-20240417
- name: process cache of stack global package db # - name: process cache of stack-installed programs in ~/.local/bin
id: stack-global # id: stack-programs
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
path: ~/.stack # path: ~/.local/bin
key: ${{ runner.os }}-stack-global-20240417-${{ hashFiles('**.yaml') }} # key: ${{ runner.os }}-stack-programs-20240417-${{ hashFiles('**.yaml') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-stack-global-20240417 # ${{ runner.os }}-stack-programs-20240417
- name: process cache of stack-installed programs in ~/.local/bin # - name: process cache of .stack-work
id: stack-programs # uses: actions/cache@v4
uses: actions/cache@v4 # with:
with: # path: .stack-work
path: ~/.local/bin # key: ${{ runner.os }}-stack-work-20240417-${{ hashFiles('**.yaml') }}
key: ${{ runner.os }}-stack-programs-20240417-${{ hashFiles('**.yaml') }} # restore-keys: |
restore-keys: | # ${{ runner.os }}-stack-work-20240417
${{ runner.os }}-stack-programs-20240417
- name: process cache of .stack-work # - name: process cache of hledger-lib/.stack-work
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
path: .stack-work # path: hledger-lib/.stack-work
key: ${{ runner.os }}-stack-work-20240417-${{ hashFiles('**.yaml') }} # key: ${{ runner.os }}-hledger-lib-stack-work-20240417-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-stack-work-20240417 # ${{ runner.os }}-hledger-lib-stack-work-20240417
- name: process cache of hledger-lib/.stack-work # - name: process cache of hledger/.stack-work
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
path: hledger-lib/.stack-work # path: hledger/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-20240417-${{ hashFiles('hledger-lib/package.yaml') }} # key: ${{ runner.os }}-hledger-stack-work-20240417-${{ hashFiles('hledger/package.yaml') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-hledger-lib-stack-work-20240417 # ${{ runner.os }}-hledger-stack-work-20240417
- name: process cache of hledger/.stack-work # - name: process cache of hledger-ui/.stack-work
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
path: hledger/.stack-work # path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-stack-work-20240417-${{ hashFiles('hledger/package.yaml') }} # key: ${{ runner.os }}-hledger-ui-stack-work-20240417-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-hledger-stack-work-20240417 # ${{ runner.os }}-hledger-ui-stack-work-20240417
- name: process cache of hledger-ui/.stack-work # - name: process cache of hledger-web/.stack-work
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
path: hledger-ui/.stack-work # path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-20240417-${{ hashFiles('hledger-ui/package.yaml') }} # key: ${{ runner.os }}-hledger-web-stack-work-20240417-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-hledger-ui-stack-work-20240417 # ${{ runner.os }}-hledger-web-stack-work-20240417
- name: process cache of hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-20240417-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-web-stack-work-20240417
# actions: # actions:
@ -115,11 +115,11 @@ jobs:
apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static
# needed by stack, at least; do it here in case it matters for ghcup too # needed by stack, at least; do it here in case it matters for ghcup too
- name: Fix $HOME for following steps (workaround from https://github.com/actions/runner/issues/863) # - name: Fix $HOME for following steps (workaround from https://github.com/actions/runner/issues/863)
run: | # run: |
apk --no-cache add sudo # apk --no-cache add sudo
echo "setting HOME=/root" # echo "setting HOME=/root"
echo HOME=/root | sudo tee -a $GITHUB_ENV # echo HOME=/root | sudo tee -a $GITHUB_ENV
- name: Add .ghcup/bin to PATH for following steps - name: Add .ghcup/bin to PATH for following steps
run: | run: |
@ -128,65 +128,67 @@ jobs:
- name: Install haskell tools with ghcup if needed - name: Install haskell tools with ghcup if needed
run: | run: |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --version if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --version
if [[ ! -x ~/.ghcup/bin/ghc-9.0.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.0.2 && ~/.ghcup/bin/ghcup set ghc 9.0.2; fi; printf "ghc: "; ghc --version
# if [[ ! -x ~/.ghcup/bin/ghc-9.8.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.8.2 && ~/.ghcup/bin/ghcup set ghc 9.8.2; fi; printf "ghc: "; ghc --version # if [[ ! -x ~/.ghcup/bin/ghc-9.8.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.8.2 && ~/.ghcup/bin/ghcup set ghc 9.8.2; fi; printf "ghc: "; ghc --version
if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.10.3.0 && ~/.ghcup/bin/ghcup set cabal 3.10.3.0; fi; printf "cabal: "; cabal --version if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.8.1.0 && ~/.ghcup/bin/ghcup set cabal 3.8.1.0; fi; printf "cabal: "; cabal --version
if [[ ! -x ~/.ghcup/bin/stack ]]; then ~/.ghcup/bin/ghcup install stack 2.15.5 && ~/.ghcup/bin/ghcup set stack 2.15.5; fi; printf "stack: "; stack --version # if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.10.3.0 && ~/.ghcup/bin/ghcup set cabal 3.10.3.0; fi; printf "cabal: "; cabal --version
# if [[ ! -x ~/.ghcup/bin/stack ]]; then ~/.ghcup/bin/ghcup install stack 2.15.5 && ~/.ghcup/bin/ghcup set stack 2.15.5; fi; printf "stack: "; stack --version
## build with cabal ## build with cabal
# failing with: lto1: fatal error: bytecode stream in file '/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../lib/libgmp.a' generated with LTO version 13.0 instead of the expected 13.1 # failing with: lto1: fatal error: bytecode stream in file '/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../lib/libgmp.a' generated with LTO version 13.0 instead of the expected 13.1
# - name: Update cabal package index - name: Update cabal package index
# run: | run: |
# cabal update cabal update
# - name: Build with cabal - name: Build with cabal
# run: | run: |
# cabal build --enable-executable-static hledger || (echo "ERROR: building hledger failed"; false) cabal build --enable-executable-static hledger || (echo "ERROR: building hledger failed"; false)
# cabal build --enable-executable-static hledger-ui || (echo "ERROR: building hledger-ui failed"; false) cabal build --enable-executable-static hledger-ui || (echo "ERROR: building hledger-ui failed"; false)
# cabal build --enable-executable-static hledger-web || (echo "ERROR: building hledger-web failed"; false) cabal build --enable-executable-static hledger-web || (echo "ERROR: building hledger-web failed"; false)
# - name: Gather binaries - name: Gather binaries
# run: | run: |
# mkdir tmp mkdir tmp
# cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-*/x/hledger/build/hledger/hledger tmp cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-*/x/hledger/build/hledger/hledger tmp
# cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-ui-*/x/hledger-ui/build/hledger-ui/hledger-ui tmp cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-ui-*/x/hledger-ui/build/hledger-ui/hledger-ui tmp
# cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-web-*/x/hledger-web/build/hledger-web/hledger-web tmp cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-web-*/x/hledger-web/build/hledger-web/hledger-web tmp
# cd tmp cd tmp
# strip hledger strip hledger
# strip hledger-ui strip hledger-ui
# strip hledger-web strip hledger-web
# tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
## build with stack ## build with stack
# --allow-different-user is needed because of #863 above, or because we're in a docker container and stack didn't notice # --allow-different-user is needed because of #863 above, or because we're in a docker container and stack didn't notice
# failing with: /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld.gold: error: /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__TMC_END__' which may overflow at runtime; recompile with -fPIC # failing with: /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld.gold: error: /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__TMC_END__' which may overflow at runtime; recompile with -fPIC
- name: Install GHC with stack # - name: Install GHC with stack
run: | # run: |
stack --allow-different-user setup --install-ghc # stack --allow-different-user setup --install-ghc
- name: Build with stack # - name: Build with stack
run: | # run: |
stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger # || (echo "ERROR: building hledger failed"; false) # stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger # || (echo "ERROR: building hledger failed"; false)
stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false) # stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false)
stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-web # || (echo "ERROR: building hledger-web failed"; false) # stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-web # || (echo "ERROR: building hledger-web failed"; false)
- name: Run built-in unit tests # - name: Run built-in unit tests
run: | # run: |
stack exec -- hledger test # stack exec -- hledger test
- name: Gather binaries # - name: Gather binaries
run: | # run: |
mkdir tmp # mkdir tmp
cd tmp # cd tmp
cp ~/.local/bin/hledger . # cp ~/.local/bin/hledger .
cp ~/.local/bin/hledger-ui . # cp ~/.local/bin/hledger-ui .
cp ~/.local/bin/hledger-web . # cp ~/.local/bin/hledger-web .
strip hledger # strip hledger
strip hledger-ui # strip hledger-ui
strip hledger-web # strip hledger-web
tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web # tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web
## ##