gitlib icon indicating copy to clipboard operation
gitlib copied to clipboard

Hackage version builds neither with GHC 8.0 nor 8.2

Open DanielG opened this issue 7 years ago • 8 comments

gitlib-3.1.1 fails to build with GHC 8.0 and 8.2 with the error:

Git/Working.hs:18:33: error:
    Not in scope: type constructor or class ‘MonadBaseControl’

this seems to be fixed in master, so please release a new version on Hackage.

DanielG avatar Apr 03 '18 09:04 DanielG

The lack of upper bounds on this package allowed conduit to change the API it provides and stop building on hackage. Revised bounds are needed.

glguy avatar May 07 '18 02:05 glguy

Any updates on this? also running into this issue...

luc-tielen avatar Jun 07 '18 06:06 luc-tielen

I'm currently building gitlib on Travis, which works for 8.0, 8.2 and 8.4. There was a release made just a week ago to address the unliftIO issue. Can you show me the error you're seeing?

jwiegley avatar Jun 09 '18 05:06 jwiegley

Hey John, thanks for replying.

My stack.yaml (in a new project) contains the following additional config:

extra-deps:
  - gitlib-libgit2-3.1.1
  - gitlib-3.1.1

package.yaml contains default config except for the dependencies:

dependencies:
  - base >= 4.7 && < 5
  - gitlib-libgit2

Build output contains lots of conduit warnings + error related due to unliftIO (the one you mentioned previously?

$ stack ghci
gitlib-3.1.1: configure
gitlib-3.1.1: build

Error:
--  While building custom Setup.hs for package gitlib-3.1.1 using:
      /Users/luc/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/luc/personal/repo-analyzer/.stack-work/logs/gitlib-3.1.1.log

    Configuring gitlib-3.1.1...
    Preprocessing library for gitlib-3.1.1..
    Building library for gitlib-3.1.1..
    [ 1 of 15] Compiling Git.Tutorial     ( Git/Tutorial.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Tutorial.o )
    [ 2 of 15] Compiling Git.Types        ( Git/Types.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Types.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:9:1: warning: [-Wunused-imports]
        The import of ‘Control.Applicative’ is redundant
          except perhaps to import instances from ‘Control.Applicative’
        To import instances alone, use: import Control.Applicative()
      |
    9 | import           Control.Applicative
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:60:25: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Producer’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    60 |     sourceReferences :: Producer m RefName
       |                         ^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:68:22: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Producer’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    68 |                   -> Producer m (ObjectOid r) -- ^ All the objects in between
       |                      ^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:83:36: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Producer’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    83 |     sourceTreeEntries :: Tree r -> Producer m (TreeFilePath, TreeEntry r)
       |                                    ^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:85:29: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Source’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    85 |     diffContentsWithTree :: Source m (Either TreeFilePath ByteString)
       |                             ^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:86:39: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Producer’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    86 |                          -> Tree r -> Producer m ByteString
       |                                       ^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:178:21: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Source’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
        |
    178 | type ByteSource m = Source m ByteString
        |                     ^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:251:52: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Producer’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
        |
    251 | sourceCommitParents :: MonadGit r m => Commit r -> Producer m (Commit r)
        |                                                    ^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Types.hs:256:57: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
        |
    256 | lookupCommitParents commit = sourceCommitParents commit $$ sinkList
        |                                                         ^^
    [ 3 of 15] Compiling Git.Tree.Builder ( Git/Tree/Builder.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Tree/Builder.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:59:1: warning: [-Worphans]
        Orphan instance: instance Functor m => Functor (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    59 | instance Functor m => Functor (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:62:1: warning: [-Worphans]
        Orphan instance: instance Monad m => Monad (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    62 | instance Monad m => Monad (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:66:1: warning: [-Worphans]
        Orphan instance:
          instance (Functor m, Monad m) => Applicative (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    66 | instance (Functor m, Monad m) => Applicative (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:70:1: warning: [-Worphans]
        Orphan instance:
          instance (Functor m, MonadPlus m) => Alternative (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    70 | instance (Functor m, MonadPlus m) => Alternative (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:74:1: warning: [-Worphans]
        Orphan instance: instance MonadPlus m => MonadPlus (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    74 | instance (MonadPlus m) => MonadPlus (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:78:1: warning: [-Worphans]
        Orphan instance: instance MonadFix m => MonadFix (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    78 | instance (MonadFix m) => MonadFix (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:81:1: warning: [-Worphans]
        Orphan instance: instance MonadTrans (TreeT r)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    81 | instance MonadTrans (TreeT r) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree/Builder.hs:84:1: warning: [-Worphans]
        Orphan instance: instance MonadIO m => MonadIO (TreeT r m)
        To avoid this
            move the instance declaration to the module of the class or of the type, or
            wrap the type with a newtype and declare the instance on the new type.
       |
    84 | instance (MonadIO m) => MonadIO (TreeT r m) where
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
    [ 4 of 15] Compiling Git.Repository   ( Git/Repository.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Repository.o )
    [ 5 of 15] Compiling Git.Reference    ( Git/Reference.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Reference.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Reference.hs:7:35: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
      |
    7 | listReferences = sourceReferences $$ sinkList
      |                                   ^^
    [ 6 of 15] Compiling Git.Object       ( Git/Object.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Object.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Object.hs:16:40: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    16 |     sourceObjects mhave need alsoTrees $$ sinkList
       |                                        ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Object.hs:27:38: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Conduit’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    27 | expandTreeObjects :: MonadGit r m => Conduit (ObjectOid r) m (ObjectOid r)
       |                                      ^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Object.hs:33:13: warning: [-Wdeprecations]
        In the use of ‘=$=’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use .|"
       |
    33 |             =$= awaitForever (\ent -> case ent of
       |             ^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Object.hs:42:35: warning: [-Wdeprecations]
        In the use of ‘$=’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use .|"
       |
    42 |     sourceObjects mhave need True $= expandTreeObjects $$ sinkList
       |                                   ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Object.hs:42:56: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    42 |     sourceObjects mhave need True $= expandTreeObjects $$ sinkList
       |                                                        ^^
    [ 7 of 15] Compiling Git.Blob         ( Git/Blob.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Blob.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:4:1: warning: [-Wunused-imports]
        The import of ‘Control.Applicative’ is redundant
          except perhaps to import instances from ‘Control.Applicative’
        To import instances alone, use: import Control.Applicative()
      |
    4 | import           Control.Applicative
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:32:36: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    32 |     B.concat . BL.toChunks <$> (bs $$ sinkLazy)
       |                                    ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:34:36: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    34 |     B.concat . BL.toChunks <$> (bs $$ sinkLazy)
       |                                    ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:43:51: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    43 | blobContentsToLazyByteString (BlobStream bs) = bs $$ sinkLazy
       |                                                   ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:44:58: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    44 | blobContentsToLazyByteString (BlobSizedStream bs _) = bs $$ sinkLazy
       |                                                          ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:52:56: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    52 | writeBlob path (BlobStringLazy bs)     = sourceLazy bs $$ sinkFile path
       |                                                        ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:53:46: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    53 | writeBlob path (BlobStream str)        = str $$ sinkFile path
       |                                              ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:54:46: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    54 | writeBlob path (BlobSizedStream str _) = str $$ sinkFile path
       |                                              ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:58:51: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    58 | treeBlobEntries tree = sourceTreeBlobEntries tree $$ sinkList
       |                                                   ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:62:18: warning: [-Wdeprecations]
        In the use of type constructor or class ‘Producer’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use ConduitT directly"
       |
    62 |     => Tree r -> Producer m (TreeFilePath, BlobOid r, BlobKind)
       |                  ^^^^^^^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Blob.hs:64:28: warning: [-Wdeprecations]
        In the use of ‘=$=’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use .|"
       |
    64 |     sourceTreeEntries tree =$= awaitForever go
       |                            ^^^
    [ 8 of 15] Compiling Git.Tree         ( Git/Tree.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Tree.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Tree.hs:15:47: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    15 | listTreeEntries tree = sourceTreeEntries tree $$ sinkList
       |                                               ^^
    [ 9 of 15] Compiling Git.Commit       ( Git/Commit.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Commit.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Commit.hs:71:9: warning: [-Wdeprecations]
        In the use of ‘$=’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use .|"
       |
    71 |         $= mapMC (\(CommitObjOid c) -> return c)
       |         ^^

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Commit.hs:72:9: warning: [-Wdeprecations]
        In the use of ‘$$’
        (imported from Conduit, but defined in conduit-1.3.0.2:Data.Conduit.Internal.Conduit):
        Deprecated: "Use runConduit and .|"
       |
    72 |         $$ sinkList
       |         ^^
    [10 of 15] Compiling Git.Commit.Push  ( Git/Commit/Push.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Commit/Push.o )
    [11 of 15] Compiling Git              ( Git.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git.o )
    [12 of 15] Compiling Git.Tree.Working ( Git/Tree/Working.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Tree/Working.o )
    [13 of 15] Compiling Git.Tree.Builder.Pure ( Git/Tree/Builder/Pure.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Tree/Builder/Pure.o )
    [14 of 15] Compiling Git.Utils        ( Git/Utils.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Utils.o )
    [15 of 15] Compiling Git.Working      ( Git/Working.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Working.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack48756/gitlib-3.1.1/Git/Working.hs:18:33: error:
        Not in scope: type constructor or class ‘MonadBaseControl’
       |
    18 | checkoutFiles :: (MonadGit r m, MonadBaseControl IO m, MonadIO m,
       |                                 ^^^^^^^^^^^^^^^^


Warning: Build failed, but trying to launch GHCi anyway

If you need more information, let me know.

luc-tielen avatar Jun 09 '18 09:06 luc-tielen

@luc-tielen You're using the older (broken) version of gitlib, you need to update to 3.1.2 in your stack.yaml. The bounds haven't been revised yet on 3.1.1

glguy avatar Jun 09 '18 16:06 glguy

Right, silly me..

Output from stack build is now:

Process exited with code: ExitFailure 1
    Logs have been written to: /Users/luc/personal/repo-analyzer/.stack-work/logs/text-icu-0.7.0.1.log

    Configuring text-icu-0.7.0.1...
    Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2: Missing dependencies on foreign
    libraries:
    * Missing C libraries: icuuc, icui18n, icudata
...

So then I did stack build --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include (on MacOSX), which gives:

...
gitlib-libgit2-3.1.1: configure
gitlib-libgit2-3.1.1: build
Progress: 13/14
--  While building custom Setup.hs for package gitlib-libgit2-3.1.1 using:
      /Users/luc/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/luc/personal/repo-analyzer/.stack-work/logs/gitlib-libgit2-3.1.1.log

    Configuring gitlib-libgit2-3.1.1...
    Warning: The package has an extraneous version range for a dependency on an
    internal library: gitlib-libgit2 >=3.1.1. This version range includes the
    current package but isn't needed as the current package's library will always
    be used.
    Preprocessing library for gitlib-libgit2-3.1.1..
    Building library for gitlib-libgit2-3.1.1..
    [1 of 5] Compiling Git.Libgit2.Types ( Git/Libgit2/Types.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Libgit2/Types.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack78178/gitlib-libgit2-3.1.1/Git/Libgit2/Types.hs:12:1: warning: [-Wunused-imports]
        The import of ‘Control.Applicative’ is redundant
          except perhaps to import instances from ‘Control.Applicative’
        To import instances alone, use: import Control.Applicative()
       |
    12 | import           Control.Applicative
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [2 of 5] Compiling Git.Libgit2.Backend ( Git/Libgit2/Backend.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Libgit2/Backend.o )
    [3 of 5] Compiling Git.Libgit2.Trace ( Git/Libgit2/Trace.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Libgit2/Trace.o )
    [4 of 5] Compiling Git.Libgit2.Internal ( Git/Libgit2/Internal.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Libgit2/Internal.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack78178/gitlib-libgit2-3.1.1/Git/Libgit2/Internal.hs:10:1: warning: [-Wunused-imports]
        The import of ‘Control.Applicative’ is redundant
          except perhaps to import instances from ‘Control.Applicative’
        To import instances alone, use: import Control.Applicative()
       |
    10 | import           Control.Applicative
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [5 of 5] Compiling Git.Libgit2      ( Git/Libgit2.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Git/Libgit2.o )

    /private/var/folders/lm/s6mxqg6s6g1fvsgxlj06469m0000gn/T/stack78178/gitlib-libgit2-3.1.1/Git/Libgit2.hs:263:38: error:
        • Could not deduce (MonadUnliftIO m)
            arising from a use of ‘readFromSource’
          from the context: MonadLg m
            bound by the type signature for:
                       lgCreateBlob :: forall (m :: * -> *).
                                       MonadLg m =>
                                       Git.BlobContents (ReaderT LgRepo m) -> ReaderT LgRepo m BlobOid
            at Git/Libgit2.hs:(253,1)-(255,40)
          Possible fix:
            add (MonadUnliftIO m) to the context of
              the type signature for:
                lgCreateBlob :: forall (m :: * -> *).
                                MonadLg m =>
                                Git.BlobContents (ReaderT LgRepo m) -> ReaderT LgRepo m BlobOid
        • In the expression: readFromSource repo ptr src
          In a case alternative:
              Git.BlobStream src -> readFromSource repo ptr src
          In a stmt of a 'do' block:
            r <- case b of
                   Git.BlobString bs -> createBlob repo ptr bs
                   Git.BlobStringLazy bs
                     -> createBlob repo ptr (B.concat (BL.toChunks bs))
                   Git.BlobStream src -> readFromSource repo ptr src
                   Git.BlobSizedStream src _ -> readFromSource repo ptr src
        |
    263 |         Git.BlobStream src        -> readFromSource repo ptr src
        |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is with LTS-11.13 in Stack (GHC-8.2.2).

On a side note, is it normal that gitlib and gitlib-libgit2 now have different versions 3.1.1 vs 3.1.2? Similar error seems to occur in both?

stack.yaml contains

extra-deps:
  - gitlib-libgit2-3.1.1
  - gitlib-3.1.2

luc-tielen avatar Jun 09 '18 16:06 luc-tielen

I am having the same exact error message (luc-tielen's second compile log) when I try to build. Is there something we're doing wrong here? What is the recommended method here?

(For the record I'm using LTS-11.14, while luc-tielen is using 11.13)

Luabee avatar Jun 21 '18 21:06 Luabee

It appears to be an issue with Stack. I was able to successfully build (with countless warnings) using Cabal with sandboxing.

Luabee avatar Jun 21 '18 23:06 Luabee