Skip to content

Commit

Permalink
Merge pull request #632 from NixOS/ghc-9.10
Browse files Browse the repository at this point in the history
distribution-nixpkgs: adjust test suite for Cabal 3.12
  • Loading branch information
sternenseemann authored Nov 30, 2024
2 parents b5e2ba8 + f572903 commit 3d543b6
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 27 deletions.
70 changes: 49 additions & 21 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240501
# version: 0.19.20241121
#
# REGENDATA ("0.19.20240501",["--branches","master","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","--doctest-jobs=>= 8.8 && < 9.4","github","cabal.project"])
# REGENDATA ("0.19.20241121",["--branches","master","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","--doctest-jobs=>= 8.8 && < 9.4","github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -32,9 +32,19 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.6.5
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.6.5
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.3
compilerKind: ghc
compilerVersion: 9.8.3
setup-method: ghcup-vanilla
allow-failure: false
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
Expand All @@ -59,41 +69,59 @@ jobs:
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
- name: Install GHC (GHCup vanilla)
if: matrix.setup-method == 'ghcup-vanilla'
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
"$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -136,7 +164,7 @@ jobs:
- name: cache (tools)
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-dd324315
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-fb82843d
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
Expand All @@ -152,10 +180,10 @@ jobs:
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v4
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-dd324315
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-fb82843d
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -204,7 +232,7 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(cabal2nix|distribution-nixpkgs|hackage-db|language-nix)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(cabal2nix|distribution-nixpkgs|hackage-db|language-nix)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down Expand Up @@ -258,8 +286,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v4
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
4 changes: 2 additions & 2 deletions cabal2nix/cabal2nix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ author: Peter Simons <[email protected]>
-- list all contributors: git log --pretty='%an' | sort | uniq
maintainer: sternenseemann <[email protected]>
stability: stable
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.5
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.6 || == 9.8.3 || == 9.10.1
category: Distribution, Nix
homepage: https://github.com/nixos/cabal2nix#readme
bug-reports: https://github.com/nixos/cabal2nix/issues
Expand Down Expand Up @@ -48,7 +48,7 @@ library
Distribution.Nixpkgs.Haskell.Platform
other-modules: Paths_cabal2nix
hs-source-dirs: src
build-depends: base > 4.11
build-depends: base > 4.11 && <5
-- When changing the Cabal version, ensure that it builds
-- with all installation methods mentioned in the README!
, Cabal >= 3.0
Expand Down
2 changes: 1 addition & 1 deletion distribution-nixpkgs/distribution-nixpkgs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license: BSD3
license-file: LICENSE
author: Peter Simons <[email protected]>
maintainer: sternenseemann <[email protected]>
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.5
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.6 || == 9.8.3 || == 9.10.1
category: Distribution, Nix
homepage: https://github.com/NixOS/cabal2nix/tree/master/distribution-nixpkgs#readme
bug-reports: https://github.com/NixOS/cabal2nix/issues
Expand Down
2 changes: 1 addition & 1 deletion distribution-nixpkgs/test/data/all-system-tuples.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["aarch64-darwin","aarch64-genode","aarch64-linux","aarch64-netbsd","aarch64-none","aarch64_be-none","arm-none","armv5tel-linux","armv6l-linux","armv6l-netbsd","armv6l-none","armv7a-darwin","armv7a-linux","armv7a-netbsd","armv7l-linux","armv7l-netbsd","avr-none","i686-cygwin","i686-darwin","i686-freebsd","i686-genode","i686-linux","i686-netbsd","i686-none","i686-openbsd","i686-windows","javascript-ghcjs","loongarch64-linux","m68k-linux","m68k-netbsd","m68k-none","microblaze-linux","microblaze-none","microblazeel-linux","microblazeel-none","mips-linux","mips-none","mips64-linux","mips64-none","mips64el-linux","mipsel-linux","mipsel-netbsd","mmix-mmixware","msp430-none","or1k-none","powerpc-netbsd","powerpc-none","powerpc64-linux","powerpc64le-linux","powerpcle-none","riscv32-linux","riscv32-netbsd","riscv32-none","riscv64-linux","riscv64-netbsd","riscv64-none","rx-none","s390-linux","s390-none","s390x-linux","s390x-none","vc4-none","wasm32-wasi","wasm64-wasi","x86_64-cygwin","x86_64-darwin","x86_64-freebsd","x86_64-genode","x86_64-linux","x86_64-netbsd","x86_64-none","x86_64-openbsd","x86_64-redox","x86_64-solaris","x86_64-windows"]
["aarch64-darwin","aarch64-genode","aarch64-linux","aarch64-netbsd","aarch64-none","aarch64_be-none","arm-none","armv5tel-linux","armv6l-linux","armv6l-netbsd","armv6l-none","armv7a-darwin","armv7a-linux","armv7a-netbsd","armv7l-linux","armv7l-netbsd","avr-none","i686-cygwin","i686-darwin","i686-freebsd","i686-genode","i686-linux","i686-netbsd","i686-none","i686-openbsd","i686-windows","javascript-ghcjs","loongarch64-linux","m68k-linux","m68k-netbsd","m68k-none","microblaze-linux","microblaze-none","microblazeel-linux","microblazeel-none","mips-linux","mips-none","mips64-linux","mips64-none","mips64el-linux","mipsel-linux","mipsel-netbsd","mmix-mmixware","msp430-none","or1k-none","powerpc-netbsd","powerpc-none","powerpc64-linux","powerpc64le-linux","powerpcle-none","riscv32-linux","riscv32-netbsd","riscv32-none","riscv64-linux","riscv64-netbsd","riscv64-none","rx-none","s390-linux","s390-none","s390x-linux","s390x-none","vc4-none","wasm32-none","wasm32-wasi","wasm64-wasi","x86_64-cygwin","x86_64-darwin","x86_64-freebsd","x86_64-genode","x86_64-linux","x86_64-netbsd","x86_64-none","x86_64-openbsd","x86_64-redox","x86_64-solaris","x86_64-windows"]
12 changes: 12 additions & 0 deletions distribution-nixpkgs/test/hspec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ nixpkgsSystemMapping =
, ("i686-openbsd", Platform I386 OpenBSD)
, ("i686-windows", Platform I386 Windows)
, ("javascript-ghcjs", Platform JavaScript Ghcjs)
#if MIN_VERSION_Cabal(3,12,0)
, ("loongarch64-linux", Platform LoongArch64 Linux)
#else
, ("loongarch64-linux", Platform (OtherArch "loongarch64") Linux)
#endif
, ("m68k-linux", Platform M68k Linux)
, ("m68k-netbsd", Platform M68k NetBSD)
, ("m68k-none", Platform M68k (OtherOS "none"))
Expand All @@ -102,9 +106,15 @@ nixpkgsSystemMapping =
, ("riscv32-linux", Platform (OtherArch "riscv32") Linux)
, ("riscv32-netbsd", Platform (OtherArch "riscv32") NetBSD)
, ("riscv32-none", Platform (OtherArch "riscv32") (OtherOS "none"))
#if MIN_VERSION_Cabal(3,12,0)
, ("riscv64-linux", Platform RISCV64 Linux)
, ("riscv64-netbsd", Platform RISCV64 NetBSD)
, ("riscv64-none", Platform RISCV64 (OtherOS "none"))
#else
, ("riscv64-linux", Platform (OtherArch "riscv64") Linux)
, ("riscv64-netbsd", Platform (OtherArch "riscv64") NetBSD)
, ("riscv64-none", Platform (OtherArch "riscv64") (OtherOS "none"))
#endif
, ("rx-none", Platform (OtherArch "rx") (OtherOS "none"))
, ("s390-linux", Platform S390 Linux)
, ("s390-none", Platform S390 (OtherOS "none"))
Expand All @@ -117,9 +127,11 @@ nixpkgsSystemMapping =
#endif
, ("vc4-none", Platform (OtherArch "vc4") (OtherOS "none"))
#if MIN_VERSION_Cabal(3,8,1)
, ("wasm32-none", Platform Wasm32 (OtherOS "none"))
, ("wasm32-wasi", Platform Wasm32 Wasi)
, ("wasm64-wasi", Platform (OtherArch "wasm64") Wasi)
#else
, ("wasm32-none", Platform (OtherArch "wasm32") (OtherOS "none"))
, ("wasm32-wasi", Platform (OtherArch "wasm32") (OtherOS "wasi"))
, ("wasm64-wasi", Platform (OtherArch "wasm64") (OtherOS "wasi"))
#endif
Expand Down
2 changes: 1 addition & 1 deletion hackage-db/hackage-db.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license: BSD3
license-file: LICENSE
author: Peter Simons, Alexander Altman, Ben James, Kevin Quick
maintainer: sternenseemann <[email protected]>
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.5
tested-with: GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.6 || == 9.8.3 || == 9.10.1
category: Distribution
homepage: https://github.com/NixOS/cabal2nix/tree/master/hackage-db#readme
bug-reports: https://github.com/NixOS/cabal2nix/issues
Expand Down
2 changes: 1 addition & 1 deletion language-nix/language-nix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: BSD3
license-file: LICENSE
author: Peter Simons
maintainer: [email protected]
tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.5
tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.6 || == 9.8.3 || == 9.10.1
category: Distribution, Language, Nix
homepage: https://github.com/NixOS/cabal2nix/tree/master/language-nix#readme
bug-reports: https://github.com/NixOS/cabal2nix/issues
Expand Down

0 comments on commit 3d543b6

Please sign in to comment.