From 1ba96084e843146ecb24405e8b73809825ea9530 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 10 Apr 2023 23:18:41 +0200 Subject: [PATCH] Additionally test cabal2nix using GHC 9.4.4 We were also waiting on support in haskell-ci here. In nixpkgs this has been working for a long time. I don't know what the situation is with 9.6.1 at the moment, but I expect some dependencies do not work yet. doctest is disable for >= 9.4. It breaks in a way similar to https://github.com/sol/doctest/issues/327, but I haven't been able to find a workaround. --- .github/workflows/ci-skip-package-map.patch | 20 +++++------ .github/workflows/haskell-ci.yml | 33 +++++++++++-------- cabal2nix/cabal2nix.cabal | 2 +- .../distribution-nixpkgs.cabal | 2 +- hackage-db/hackage-db.cabal | 2 +- language-nix/language-nix.cabal | 2 +- 6 files changed, 33 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci-skip-package-map.patch b/.github/workflows/ci-skip-package-map.patch index d4b8b7595..000dfb467 100644 --- a/.github/workflows/ci-skip-package-map.patch +++ b/.github/workflows/ci-skip-package-map.patch @@ -1,13 +1,13 @@ diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml -index 7fca651d..c2b799c0 100644 +index 939508f1..6d33cb2f 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml -@@ -253,7 +253,7 @@ jobs: - cd ${PKGDIR_language_nix} || false - doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src - cd ${PKGDIR_distribution_nixpkgs} || false -- doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src -+ find src -type f -and -not -name 'PackageMap.hs' | xargs doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 - cd ${PKGDIR_hackage_db} || false - doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src - - name: hlint +@@ -251,7 +251,7 @@ jobs: + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_cabal2nix} || false ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_distribution_nixpkgs} || false ; fi +- if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ; fi ++ if [ $((HCNUMVER < 90400)) -ne 0 ] ; then find src -name '*.hs' -and -not -name 'PackageMap.hs' | xargs doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_hackage_db} || false ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_language_nix} || false ; fi diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 8136b30d3..493a416e0 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # This GitHub workflow config has been generated by a script via # -# haskell-ci '--branches' 'master' '--github-patches' '.github/workflows/ci-skip-package-map.patch' '--doctest' '--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen' 'github' 'cabal.project' +# haskell-ci '--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' # # To regenerate the script (for example after adjusting tested-with) run # @@ -10,7 +10,7 @@ # # version: 0.16 # -# REGENDATA ("0.16",["--branches","master","--github-patches",".github/workflows/ci-skip-package-map.patch","--doctest","--doctest-options=-i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen","github","cabal.project"]) +# REGENDATA ("0.16",["--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: @@ -32,6 +32,11 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.4.4 + compilerKind: ghc + compilerVersion: 9.4.4 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.2.7 compilerKind: ghc compilerVersion: 9.2.7 @@ -147,7 +152,7 @@ jobs: - name: cache (tools) uses: actions/cache/restore@v3 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-4176250c + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-dc7952fc path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -160,13 +165,13 @@ jobs: cabal-plan --version - name: install doctest run: | - $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' - doctest --version + 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.20' ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest --version ; fi - name: save cache (tools) uses: actions/cache/save@v3 if: always() with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-4176250c + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-dc7952fc path: ~/.haskell-ci-tools - name: checkout uses: actions/checkout@v3 @@ -243,14 +248,14 @@ jobs: $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: doctest run: | - cd ${PKGDIR_cabal2nix} || false - doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src - cd ${PKGDIR_distribution_nixpkgs} || false - find src -type f -and -not -name 'PackageMap.hs' | xargs doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 - cd ${PKGDIR_hackage_db} || false - doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src - cd ${PKGDIR_language_nix} || false - doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_cabal2nix} || false ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_distribution_nixpkgs} || false ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then find src -name '*.hs' -and -not -name 'PackageMap.hs' | xargs doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_hackage_db} || false ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_language_nix} || false ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -i ../../dist-newstyle/build/*/*/cabal2nix-*/build/autogen -XHaskell2010 src ; fi - name: cabal check run: | cd ${PKGDIR_cabal2nix} || false diff --git a/cabal2nix/cabal2nix.cabal b/cabal2nix/cabal2nix.cabal index 261790607..5cecd90d5 100644 --- a/cabal2nix/cabal2nix.cabal +++ b/cabal2nix/cabal2nix.cabal @@ -12,7 +12,7 @@ author: Peter Simons -- list all contributors: git log --pretty='%an' | sort | uniq maintainer: sternenseemann stability: stable -tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.7 +tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.7 || == 9.4.4 category: Distribution, Nix homepage: https://github.com/nixos/cabal2nix#readme bug-reports: https://github.com/nixos/cabal2nix/issues diff --git a/distribution-nixpkgs/distribution-nixpkgs.cabal b/distribution-nixpkgs/distribution-nixpkgs.cabal index f7e2f188f..d4ec635af 100644 --- a/distribution-nixpkgs/distribution-nixpkgs.cabal +++ b/distribution-nixpkgs/distribution-nixpkgs.cabal @@ -6,7 +6,7 @@ license: BSD3 license-file: LICENSE author: Peter Simons maintainer: sternenseemann -tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.7 +tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.7 || == 9.4.4 category: Distribution, Nix homepage: https://github.com/NixOS/cabal2nix/tree/master/distribution-nixpkgs#readme bug-reports: https://github.com/NixOS/cabal2nix/issues diff --git a/hackage-db/hackage-db.cabal b/hackage-db/hackage-db.cabal index 09002dc30..ef83b7373 100644 --- a/hackage-db/hackage-db.cabal +++ b/hackage-db/hackage-db.cabal @@ -9,7 +9,7 @@ license: BSD3 license-file: LICENSE author: Peter Simons, Alexander Altman, Ben James, Kevin Quick maintainer: Peter Simons -tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.7 +tested-with: GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.7 || == 9.4.4 category: Distribution homepage: https://github.com/NixOS/cabal2nix/tree/master/hackage-db#readme bug-reports: https://github.com/NixOS/cabal2nix/issues diff --git a/language-nix/language-nix.cabal b/language-nix/language-nix.cabal index 87831573e..3faa55c25 100644 --- a/language-nix/language-nix.cabal +++ b/language-nix/language-nix.cabal @@ -7,7 +7,7 @@ license: BSD3 license-file: LICENSE author: Peter Simons maintainer: simons@cryp.to -tested-with: GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7 +tested-with: GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.4 category: Distribution, Language, Nix homepage: https://github.com/NixOS/cabal2nix/tree/master/language-nix#readme bug-reports: https://github.com/NixOS/cabal2nix/issues