Skip to content

stack-2.9 for LTS-21 #6159

Closed
Closed
@juhp

Description

@juhp

I would really like to see stack-2.9 in current Stackage Nightly (ie for coming lts-21).
We have stack-2.9.1 in lts-20, but newer persistent and unix-compat versions in current nightly
prevent stack-2.9.3 from building in nightly.

I think the changes (backport) needed is rather small:

diff --git a/package.yaml b/package.yaml
index 5ef569c37..d698b5b27 100644
--- a/package.yaml
+++ b/package.yaml
@@ -102,7 +102,7 @@ dependencies:
 # In order for Cabal (the tool) to build Stack, it needs to be told of the
 # upper bound on persistent. See
 # https://github.com/commercialhaskell/stack/pull/5677#issuecomment-1193318542
-- persistent >= 2.13.3.5 && < 2.14
+- persistent >= 2.13.3.5 && < 2.15
 - persistent-sqlite
 - persistent-template
 - pretty
diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs
index 11795d56b..cde3b7989 100644
--- a/src/Stack/Config.hs
+++ b/src/Stack/Config.hs
@@ -7,6 +7,7 @@
 {-# LANGUAGE RecordWildCards     #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeFamilies        #-}
+{-# LANGUAGE CPP                 #-}
 
 -- | The general Stack configuration that starts everything off. This should
 -- be smart to fallback if there is no stack.yaml, instead relying on
@@ -89,7 +90,11 @@ import           System.Console.ANSI
 import           System.Environment
 import           System.Info.ShortPathName ( getShortPathName )
 import           System.PosixCompat.Files ( fileOwner, getFileStatus )
+#if MIN_VERSION_unix(0,7,0)
+import           System.Posix.User ( getEffectiveUserID )
+#else
 import           System.PosixCompat.User ( getEffectiveUserID )
+#endif
 
 -- | If deprecated path exists, use it and print a warning.
 -- Otherwise, return the new path.
diff --git a/src/Stack/Docker.hs b/src/Stack/Docker.hs
index 6c2888a81..8fbc1c0c3 100644
--- a/src/Stack/Docker.hs
+++ b/src/Stack/Docker.hs
@@ -7,6 +7,7 @@
 {-# LANGUAGE RankNTypes          #-}
 {-# LANGUAGE RecordWildCards     #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE CPP                 #-}
 
 -- | Run commands in Docker containers
 module Stack.Docker
@@ -66,7 +67,11 @@ import           System.IO.Unsafe ( unsafePerformIO )
 import           System.Posix.Signals
 import qualified System.Posix.User as PosixUser
 #endif
+#if MIN_VERSION_unix(0,7,0)
+import           System.Posix.User as User
+#else
 import qualified System.PosixCompat.User as User
+#endif
 import qualified System.PosixCompat.Files as Files
 import           System.Terminal ( hIsTerminalDeviceOrMinTTY )
 import           Text.ParserCombinators.ReadP ( readP_to_S )
diff --git a/src/Stack/Storage/Util.hs b/src/Stack/Storage/Util.hs
index 058f5fef3..d2741833c 100644
--- a/src/Stack/Storage/Util.hs
+++ b/src/Stack/Storage/Util.hs
@@ -4,6 +4,7 @@
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE TypeFamilies          #-}
 {-# LANGUAGE TypeOperators         #-}
+{-# LANGUAGE CPP                   #-}
 
 -- | Utils for the other Stack.Storage modules
 module Stack.Storage.Util
@@ -26,6 +27,9 @@ updateSet ::
        , PersistEntity record
        , MonadIO m
        , PersistQueryWrite backend
+#if MIN_VERSION_persistent(2,14,0)
+       , SafeToInsert record
+#endif
        )
     => (parentid -> value -> record)
     -> EntityField record parentid
@@ -51,6 +55,9 @@ updateList ::
        , PersistEntity record
        , MonadIO m
        , PersistQueryWrite backend
+#if MIN_VERSION_persistent(2,14,0)
+       , SafeToInsert record
+#endif
        )
     => (parentid -> Int -> value -> record)
     -> EntityField record parentid
diff --git a/stack.cabal b/stack.cabal
index a3e884227..a68f3cd2b 100644
--- a/stack.cabal
+++ b/stack.cabal
@@ -1,6 +1,6 @@
 cabal-version: 2.0
 
--- This file has been generated from package.yaml by hpack version 0.35.1.
+-- This file has been generated from package.yaml by hpack version 0.35.2.
 --
 -- see: https://github.com/sol/hpack
 
@@ -316,7 +316,7 @@ library
     , pantry >=0.8.1
     , path
     , path-io
-    , persistent >=2.13.3.5 && <2.14
+    , persistent >=2.13.3.5 && <2.15
     , persistent-sqlite
     , persistent-template
     , pretty
@@ -440,7 +440,7 @@ executable stack
     , pantry >=0.8.1
     , path
     , path-io
-    , persistent >=2.13.3.5 && <2.14
+    , persistent >=2.13.3.5 && <2.15
     , persistent-sqlite
     , persistent-template
     , pretty
@@ -565,7 +565,7 @@ executable stack-integration-test
     , pantry >=0.8.1
     , path
     , path-io
-    , persistent >=2.13.3.5 && <2.14
+    , persistent >=2.13.3.5 && <2.15
     , persistent-sqlite
     , persistent-template
     , pretty
@@ -695,7 +695,7 @@ test-suite stack-test
     , pantry >=0.8.1
     , path
     , path-io
-    , persistent >=2.13.3.5 && <2.14
+    , persistent >=2.13.3.5 && <2.15
     , persistent-sqlite
     , persistent-template
     , pretty

Would you consider doing a (edit) 2.9 point release for this, please?
I think it would need a 2.9 branch.

Also it would be great to coordinate better with having stack in Stackage more consistently going forward. :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions