Allow enabling the servant build flag with older versions of stm
authorJoey Hess <joeyh@joeyh.name>
Thu, 17 Oct 2024 17:44:38 +0000 (13:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 17 Oct 2024 18:04:31 +0000 (14:04 -0400)
Allowing building with ghc 9.0.2 (debian stable).

CHANGELOG
P2P/Http/Client.hs
git-annex.cabal

index f0e476975c5e7fc187a02552cce9f66b500c6762..7303170937889b9f3540a21e0b3cf8aa1dca0096 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,8 @@ git-annex (10.20240928) UNRELEASED; urgency=medium
   * p2phttp: Support serving unauthenticated users while requesting
     authentication for operations that need it. Eg, --unauth-readonly
     can be combined with --authenv.
+  * Allow enabling the servant build flag with older versions of stm,
+    allowing building with ghc 9.0.2.
 
  -- Joey Hess <id@joeyh.name>  Thu, 17 Oct 2024 11:02:17 -0400
 
index 069124394b879de8434a0e10c8a561c5bfcbb0a0..9560f80dac248785537583309c1a4814d8df42d1 100644 (file)
@@ -533,6 +533,11 @@ clientKeepLocked lckid remoteuuid unablelock callback clientenv (ProtocolVersion
                _ :<|> _ :<|> _ :<|>
                _ :<|> _ :<|> _ :<|> _ :<|>
                v3 :<|> v2 :<|> v1 :<|> v0 :<|> _ = client p2pHttpAPI
+
+#if ! MIN_VERSION_stm(2,5,1)
+       writeTMVar t new = tryTakeTMVar t >> putTMVar t new
+#endif
+
 #else
 clientKeepLocked _ _ _ _ = ()
 #endif
index a771676ff39b4e38aee4c6e98382f0c8a17a62e2..a02bf948d37124443d20ab48145df6b9b40a2fc7 100644 (file)
@@ -321,8 +321,7 @@ Executable git-annex
       servant-client,
       servant-client-core,
       warp (>= 3.2.8),
-      warp-tls (>= 3.2.2),
-      stm (>= 2.5.1)
+      warp-tls (>= 3.2.2)
     CPP-Options: -DWITH_SERVANT
     Other-Modules:
       Command.P2PHttp