From 8fa4c3f179f412341602313c6fdf6dc785418097 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Mar 2025 12:56:18 -0600 Subject: [PATCH 01/11] Support GHC 9.8 --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 04071dc50..3d148890e 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -53,7 +53,7 @@ jobs: - "9.2" - "9.4" - "9.6" - # - "9.8" + - "9.8" - "9.10" # - "9.12" From 4b156bcb46d07eb9735dae24ce1e104f7c8430b6 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Mar 2025 12:58:21 -0600 Subject: [PATCH 02/11] both of em --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 3d148890e..971c204a7 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -55,7 +55,7 @@ jobs: - "9.6" - "9.8" - "9.10" - # - "9.12" + - "9.12" env: CONFIG: "--enable-tests --enable-benchmarks" From 0cd94357ebb4dabe6c691fe511cf72f0349611ee Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Mar 2025 13:55:56 -0600 Subject: [PATCH 03/11] neat --- cabal.project | 26 +++++++++++++++----------- persistent/persistent.cabal | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cabal.project b/cabal.project index 76238c86c..d7f8499c2 100644 --- a/cabal.project +++ b/cabal.project @@ -1,20 +1,24 @@ packages: - persistent - persistent-sqlite - persistent-test - persistent-mongoDB - persistent-mysql - persistent-postgresql - persistent-redis - persistent-qq + persistent + persistent-sqlite + persistent-test + persistent-mongoDB + persistent-mysql + persistent-postgresql + persistent-redis + persistent-qq -- required by nix. package postgresql-libpq - flags: +use-pkg-config + flags: +use-pkg-config + +allow-newer: + -- https://github.com/fizruk/http-api-data/pull/146 + http-api-data constraints: - -- https://github.com/mongodb-haskell/mongodb/pull/152 - mongoDB < 2.7.1.3 + -- https://github.com/mongodb-haskell/mongodb/pull/152 + mongoDB < 2.7.1.3 -- Needed to test that `persistent-redis` works with mtl-2.3 -- https://github.com/informatikr/hedis/pull/190 diff --git a/persistent/persistent.cabal b/persistent/persistent.cabal index d9cd19951..62fee6a40 100644 --- a/persistent/persistent.cabal +++ b/persistent/persistent.cabal @@ -36,7 +36,7 @@ library , resourcet >= 1.1.10 , scientific , silently - , template-haskell >= 2.13 && < 2.23 + , template-haskell >= 2.13 && < 2.24 , text >= 1.2 , th-lift-instances >= 0.1.14 && < 0.2 , time >= 1.6 From afa664530511afee6393997935ceedf89c8e2af7 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Mar 2025 13:57:13 -0600 Subject: [PATCH 04/11] no --- cabal.project | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cabal.project b/cabal.project index d7f8499c2..946995b44 100644 --- a/cabal.project +++ b/cabal.project @@ -16,10 +16,6 @@ allow-newer: -- https://github.com/fizruk/http-api-data/pull/146 http-api-data -constraints: - -- https://github.com/mongodb-haskell/mongodb/pull/152 - mongoDB < 2.7.1.3 - -- Needed to test that `persistent-redis` works with mtl-2.3 -- https://github.com/informatikr/hedis/pull/190 -- source-repository-package From 50c3ebe1784f7c480cbab7a64c677063db1d3f81 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Mar 2025 14:04:46 -0600 Subject: [PATCH 05/11] sigh, docker limits --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 971c204a7..aab41f640 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -73,7 +73,7 @@ jobs: with: mongodb-version: '5.0' - name: Start Redis - uses: supercharge/redis-github-action@1.4.0 + uses: shogo82148/actions-setup-redis@v1 - run: sudo apt-get update && sudo apt-get install -y libpcre3-dev - run: cabal v2-update - run: cabal v2-freeze $CONFIG From e44a65d956cde89d0011e90c92fa398e9219b238 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Mar 2025 20:22:32 -0600 Subject: [PATCH 06/11] lol --- cabal.project | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 946995b44..b42793254 100644 --- a/cabal.project +++ b/cabal.project @@ -14,7 +14,15 @@ package postgresql-libpq allow-newer: -- https://github.com/fizruk/http-api-data/pull/146 - http-api-data + http-api-data:base + , postgresql-simple:base + , postgresql-simple:template-haskell + , bytestring-lexing:base + +source-repository-package + type: git + location: https://github.com/parsonsmatt/mysql + tag: 1e7dc274bf9a2919c9dd4298ed46c1bd1a1b677d -- Needed to test that `persistent-redis` works with mtl-2.3 -- https://github.com/informatikr/hedis/pull/190 From 6f099d3bfbdc4312dd684f4ddf68ad88bb22ab7c Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Wed, 19 Mar 2025 13:56:33 -0600 Subject: [PATCH 07/11] hascallstack --- persistent-test/src/DataTypeTest.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/persistent-test/src/DataTypeTest.hs b/persistent-test/src/DataTypeTest.hs index 5d7a5fd0d..195f3d119 100644 --- a/persistent-test/src/DataTypeTest.hs +++ b/persistent-test/src/DataTypeTest.hs @@ -117,10 +117,10 @@ specsWith runDb mmigration checks apprxChecks doubleFn = describe "data type spe key <- insert x Just y <- get key liftIO $ do - let check :: (Eq a, Show a) => String -> (entity -> a) -> IO () + let check :: (Eq a, Show a, HasCallStack) => String -> (entity -> a) -> IO () check s f = (s, f x) @=? (s, f y) -- Check floating-point near equality - let check' :: (Fractional p, Show p, Real p) => String -> (entity -> p) -> IO () + let check' :: (Fractional p, Show p, Real p, HasCallStack) => String -> (entity -> p) -> IO () check' s f | abs (f x - f y) < 0.000001 = return () | otherwise = (s, f x) @=? (s, f y) From e0ee5a6f8434f85179c7f7e068dc0d6ee5091118 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Thu, 20 Mar 2025 12:25:43 -0600 Subject: [PATCH 08/11] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- persistent/persistent.cabal | 148 ++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 76 deletions(-) diff --git a/persistent/persistent.cabal b/persistent/persistent.cabal index 1c6a35bd4..374b90326 100644 --- a/persistent/persistent.cabal +++ b/persistent/persistent.cabal @@ -21,84 +21,80 @@ extra-source-files: README.md library - build-depends: - base >= 4.11.1.0 && < 5 - , aeson >= 1.0 && < 2.3 - , attoparsec - , attoparsec-aeson >= 2.1.0.0 && < 2.3 - , base64-bytestring - , blaze-html >= 0.9 - , bytestring >= 0.10 - , conduit >= 1.3 - , containers >= 0.5 - , deepseq - , fast-logger >= 2.4 - , http-api-data >= 0.3 - , lift-type >= 0.1.0.0 && < 0.2.0.0 - , monad-logger >= 0.3.28 - , mtl - , path-pieces >= 0.2 - , resource-pool >= 0.2.3 - , resourcet >= 1.1.10 - , scientific - , silently - , template-haskell >= 2.13 && < 2.24 - , text >= 1.2 - , th-lift-instances >= 0.1.14 && < 0.2 - , time >= 1.6 - , transformers >= 0.5 - , unliftio - , unliftio-core - , unordered-containers - , vault - , vector - - default-extensions: - FlexibleContexts - , MultiParamTypeClasses - , OverloadedStrings - , TypeFamilies - - exposed-modules: - Database.Persist - Database.Persist.Types - Database.Persist.Names - Database.Persist.PersistValue - Database.Persist.EntityDef - Database.Persist.EntityDef.Internal - Database.Persist.FieldDef - Database.Persist.FieldDef.Internal - Database.Persist.ImplicitIdDef - Database.Persist.ImplicitIdDef.Internal - Database.Persist.TH - Database.Persist.TH.Internal - - Database.Persist.Quasi - Database.Persist.Quasi.Internal - - Database.Persist.Sql - Database.Persist.Sql.Migration - Database.Persist.Sql.Types.Internal - Database.Persist.Sql.Util + build-depends: + aeson >=1.0 && <2.3 + , attoparsec + , attoparsec-aeson >=2.1.0.0 && <2.3 + , base >=4.11.1.0 && <5 + , base64-bytestring + , blaze-html >=0.9 + , bytestring >=0.10 + , conduit >=1.3 + , containers >=0.5 + , deepseq + , fast-logger >=2.4 + , http-api-data >=0.3 + , lift-type >=0.1.0.0 && <0.2.0.0 + , monad-logger >=0.3.28 + , mtl + , path-pieces >=0.2 + , resource-pool >=0.2.3 + , resourcet >=1.1.10 + , scientific + , silently + , template-haskell >=2.13 && <2.24 + , text >=1.2 + , th-lift-instances >=0.1.14 && <0.2 + , time >=1.6 + , transformers >=0.5 + , unliftio + , unliftio-core + , unordered-containers + , vault + , vector - Database.Persist.SqlBackend - Database.Persist.SqlBackend.StatementCache - Database.Persist.SqlBackend.SqlPoolHooks - Database.Persist.SqlBackend.Internal - Database.Persist.SqlBackend.Internal.InsertSqlResult - Database.Persist.SqlBackend.Internal.IsolationLevel - Database.Persist.SqlBackend.Internal.SqlPoolHooks - Database.Persist.SqlBackend.Internal.Statement - Database.Persist.SqlBackend.Internal.StatementCache - Database.Persist.SqlBackend.Internal.MkSqlBackend + default-extensions: + FlexibleContexts + MultiParamTypeClasses + OverloadedStrings + TypeFamilies - Database.Persist.Class - Database.Persist.Class.PersistEntity - Database.Persist.Class.PersistQuery - Database.Persist.Class.PersistUnique - Database.Persist.Class.PersistConfig - Database.Persist.Class.PersistField - Database.Persist.Class.PersistStore + exposed-modules: + Database.Persist + Database.Persist.Class + Database.Persist.Class.PersistConfig + Database.Persist.Class.PersistEntity + Database.Persist.Class.PersistField + Database.Persist.Class.PersistQuery + Database.Persist.Class.PersistStore + Database.Persist.Class.PersistUnique + Database.Persist.EntityDef + Database.Persist.EntityDef.Internal + Database.Persist.FieldDef + Database.Persist.FieldDef.Internal + Database.Persist.ImplicitIdDef + Database.Persist.ImplicitIdDef.Internal + Database.Persist.Names + Database.Persist.PersistValue + Database.Persist.Quasi + Database.Persist.Quasi.Internal + Database.Persist.Sql + Database.Persist.Sql.Migration + Database.Persist.Sql.Types.Internal + Database.Persist.Sql.Util + Database.Persist.SqlBackend + Database.Persist.SqlBackend.Internal + Database.Persist.SqlBackend.Internal.InsertSqlResult + Database.Persist.SqlBackend.Internal.IsolationLevel + Database.Persist.SqlBackend.Internal.MkSqlBackend + Database.Persist.SqlBackend.Internal.SqlPoolHooks + Database.Persist.SqlBackend.Internal.Statement + Database.Persist.SqlBackend.Internal.StatementCache + Database.Persist.SqlBackend.SqlPoolHooks + Database.Persist.SqlBackend.StatementCache + Database.Persist.TH + Database.Persist.TH.Internal + Database.Persist.Types other-modules: Database.Persist.Compatible.TH From 18409a141e88fc34b08df3a4627662a5847cba75 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Thu, 20 Mar 2025 12:51:51 -0600 Subject: [PATCH 09/11] fmt --- persistent/persistent.cabal | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/persistent/persistent.cabal b/persistent/persistent.cabal index 374b90326..6ea58bcad 100644 --- a/persistent/persistent.cabal +++ b/persistent/persistent.cabal @@ -96,12 +96,27 @@ library Database.Persist.TH.Internal Database.Persist.Types + other-modules: + Database.Persist.Sql.Class + Database.Persist.Sql.Internal + Database.Persist.Sql.Orphan.PersistQuery + Database.Persist.Sql.Orphan.PersistStore + Database.Persist.Sql.Orphan.PersistUnique + Database.Persist.Sql.Raw + Database.Persist.Sql.Run + Database.Persist.Sql.Types + Database.Persist.Types.Base + Database.Persist.Types.Span + + -- These modules only make sense for compilers with access to DerivingVia + if impl(ghc >=8.6.1) + exposed-modules: Database.Persist.Compatible other-modules: Database.Persist.Compatible.TH Database.Persist.Compatible.Types - ghc-options: -Wall -Werror=incomplete-patterns - default-language: Haskell2010 + ghc-options: -Wall -Werror=incomplete-patterns + default-language: Haskell2010 test-suite test type: exitcode-stdio-1.0 From 53c39612d4fc44e0f69aa17ecfd44fdb29697974 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Thu, 20 Mar 2025 15:33:23 -0600 Subject: [PATCH 10/11] maybe you will work --- persistent/bench/Main.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/persistent/bench/Main.hs b/persistent/bench/Main.hs index 143ba7d89..e0e232a59 100644 --- a/persistent/bench/Main.hs +++ b/persistent/bench/Main.hs @@ -132,8 +132,11 @@ instance NFData DerivStrategy where instance NFData DerivClause where #endif -#if MIN_VERSION_template_haskell(2,22,0) +#if MIN_VERSION_template_haskell(2,20,0) instance NFData BndrVis where +#endif + +#if MIN_VERSION_template_haskell(2,22,0) instance NFData NamespaceSpecifier where #endif From db618c7941d7e559494d15ea4d1489bbda7ce93f Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Thu, 20 Mar 2025 15:40:34 -0600 Subject: [PATCH 11/11] ok now it works --- persistent/bench/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistent/bench/Main.hs b/persistent/bench/Main.hs index e0e232a59..5d50ee342 100644 --- a/persistent/bench/Main.hs +++ b/persistent/bench/Main.hs @@ -132,7 +132,7 @@ instance NFData DerivStrategy where instance NFData DerivClause where #endif -#if MIN_VERSION_template_haskell(2,20,0) +#if MIN_VERSION_template_haskell(2,21,0) instance NFData BndrVis where #endif