From 3a53c6012101dcb76786ee497ca4223a8e28ceab Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Oct 2024 13:44:38 -0400 Subject: [PATCH] Allow enabling the servant build flag with older versions of stm Allowing building with ghc 9.0.2 (debian stable). --- CHANGELOG | 2 ++ P2P/Http/Client.hs | 5 +++++ git-annex.cabal | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f0e476975c..7303170937 100644 --- 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 Thu, 17 Oct 2024 11:02:17 -0400 diff --git a/P2P/Http/Client.hs b/P2P/Http/Client.hs index 069124394b..9560f80dac 100644 --- a/P2P/Http/Client.hs +++ b/P2P/Http/Client.hs @@ -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 diff --git a/git-annex.cabal b/git-annex.cabal index a771676ff3..a02bf948d3 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -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