Skip to content

Latest stack fails to build on GHC 7.10.2 due to bad version of mono-traversable (transitive dependency) #768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tebello-thejane opened this issue Aug 12, 2015 · 9 comments
Milestone

Comments

@tebello-thejane
Copy link
Contributor

Trying to install stack on a clean GHC 7.10.2 (no global packages) tries to build mono-traversable-0.4.0, which fails to build on GHC 7.10.2.

Preprocessing library mono-traversable-0.4.0...
[1 of 6] Compiling Data.MonoTraversable ( src/Data/MonoTraversable.hs, dist/build/Data/MonoTraversable.o )

src/Data/MonoTraversable.hs:39:1: Warning:
    The import of ‘$, replicate’ from module ‘Prelude’ is redundant

src/Data/MonoTraversable.hs:72:1: Warning:
    Module ‘Control.Monad.Trans.Error’ is deprecated:
      Use Control.Monad.Trans.Except instead

src/Data/MonoTraversable.hs:131:24: Warning:
    In the use of type constructor or class ‘ErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"

src/Data/MonoTraversable.hs:192:36: Warning:
    In the use of type constructor or class ‘ErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"

src/Data/MonoTraversable.hs:324:32: Warning:
    In the use of ‘Unsafe.inlinePerformIO’
    (imported from Data.ByteString.Internal):
    Deprecated: "If you think you know what you are doing, use 'unsafePerformIO'. If you are sure you know what you are doing, use 'unsafeDupablePerformIO'. If you enjoy sharing an address space with a malevolent agent of chaos, try 'accursedUnutterablePerformIO'."

src/Data/MonoTraversable.hs:326:29: Warning:
    In the use of ‘Unsafe.inlinePerformIO’
    (imported from Data.ByteString.Internal):
    Deprecated: "If you think you know what you are doing, use 'unsafePerformIO'. If you are sure you know what you are doing, use 'unsafeDupablePerformIO'. If you enjoy sharing an address space with a malevolent agent of chaos, try 'accursedUnutterablePerformIO'."
makeCorePair: arity missing $cofoldMap_abvQ
[2 of 6] Compiling Data.GrowingAppend ( src/Data/GrowingAppend.hs, dist/build/Data/GrowingAppend.o )
[3 of 6] Compiling Data.Sequences   ( src/Data/Sequences.hs, dist/build/Data/Sequences.o )

src/Data/Sequences.hs:14:1: Warning:
    The import of ‘not’ from module ‘Prelude’ is redundant
[4 of 6] Compiling Data.MinLen      ( src/Data/MinLen.hs, dist/build/Data/MinLen.o )

src/Data/MinLen.hs:80:1:
    Couldn't match representation of type ‘f1 mono’
                             with that of ‘f1 (MinLen nat mono)’
    arising from trying to show that the representations of
      ‘(Element mono -> f1 (Element mono)) -> mono -> f1 mono’ and
      ‘(Element mono -> f1 (Element mono))
       -> MinLen nat mono -> f1 (MinLen nat mono)’ are the same
    Relevant role signatures:
      type role Element nominal
      type role MinLen phantom representational
    NB: We cannot know what roles the parameters to ‘f1’ have;
      we must assume that the role is nominal
    Relevant bindings include
      otraverse :: (Element (MinLen nat mono)
                    -> f (Element (MinLen nat mono)))
                   -> MinLen nat mono -> f (MinLen nat mono)
        (bound at src/Data/MinLen.hs:80:1)
    In the expression:
        ghc-prim-0.4.0.0:GHC.Prim.coerce
          (otraverse ::
             (Element mono -> f (Element mono)) -> mono -> f mono) ::
          forall (f :: * -> *). GHC.Base.Applicative f =>
          (Element (MinLen nat mono) -> f (Element (MinLen nat mono)))
          -> MinLen nat mono -> f (MinLen nat mono)
    In an equation for ‘otraverse’:
        otraverse
          = ghc-prim-0.4.0.0:GHC.Prim.coerce
              (otraverse ::
                 (Element mono -> f (Element mono)) -> mono -> f mono) ::
              forall (f :: * -> *). GHC.Base.Applicative f =>
              (Element (MinLen nat mono) -> f (Element (MinLen nat mono)))
              -> MinLen nat mono -> f (MinLen nat mono)
    When typechecking the code for  ‘otraverse’
      in a derived instance for ‘MonoTraversable (MinLen nat mono)’:
      To see the code I am typechecking, use -ddump-deriv
    In the instance declaration for ‘MonoTraversable (MinLen nat mono)’

src/Data/MinLen.hs:80:1:
    Couldn't match representation of type ‘m1 mono’
                             with that of ‘m1 (MinLen nat mono)’
    arising from trying to show that the representations of
      ‘(Element mono -> m1 (Element mono)) -> mono -> m1 mono’ and
      ‘(Element mono -> m1 (Element mono))
       -> MinLen nat mono -> m1 (MinLen nat mono)’ are the same
    Relevant role signatures:
      type role Element nominal
      type role MinLen phantom representational
    NB: We cannot know what roles the parameters to ‘m1’ have;
      we must assume that the role is nominal
    Relevant bindings include
      omapM :: (Element (MinLen nat mono)
                -> m (Element (MinLen nat mono)))
               -> MinLen nat mono -> m (MinLen nat mono)
        (bound at src/Data/MinLen.hs:80:1)
    In the expression:
        ghc-prim-0.4.0.0:GHC.Prim.coerce
          (omapM :: (Element mono -> m (Element mono)) -> mono -> m mono) ::
          forall (m :: * -> *). GHC.Base.Monad m =>
          (Element (MinLen nat mono) -> m (Element (MinLen nat mono)))
          -> MinLen nat mono -> m (MinLen nat mono)
    In an equation for ‘omapM’:
        omapM
          = ghc-prim-0.4.0.0:GHC.Prim.coerce
              (omapM :: (Element mono -> m (Element mono)) -> mono -> m mono) ::
              forall (m :: * -> *). GHC.Base.Monad m =>
              (Element (MinLen nat mono) -> m (Element (MinLen nat mono)))
              -> MinLen nat mono -> m (MinLen nat mono)
    When typechecking the code for  ‘omapM’
      in a derived instance for ‘MonoTraversable (MinLen nat mono)’:
      To see the code I am typechecking, use -ddump-deriv
    In the instance declaration for ‘MonoTraversable (MinLen nat mono)’
cabal: Error: some packages failed to install:
chunked-data-0.2.0 depends on mono-traversable-0.4.0 which failed to install.
conduit-combinators-1.0.2 depends on mono-traversable-0.4.0 which failed to
install.
mono-traversable-0.4.0 failed during the building phase. The exception was:
ExitFailure 1
stack-0.1.3.0 depends on mono-traversable-0.4.0 which failed to install.

@snoyberg
Copy link
Contributor

This should really be a bug report against cabal, not stack. There's a bug in the cabal dependency solver leading it to make this selection. As usual: I recommend building stuff with stack, not cabal, to avoid dependency hell ;).

@snoyberg snoyberg added this to the Support milestone Aug 12, 2015
@tebello-thejane
Copy link
Contributor Author

Hehe.

So what's the cabal bug causing this? How is cabal not behaving as expected?

And how do I install a global application using stack, outside of a stack-ified project?

@snoyberg
Copy link
Contributor

I don't know what the cabal bug is, but it's certainly problematic that it's deciding to use a more-than-year-old version of mono-traversable when more recent versions work just fine. You can probably work around this with cabal install --constraint 'mono-traversable >= 0.9' stack.

There's a guide to upgrading stack at https://github.com/commercialhaskell/stack/wiki/Downloads#upgrade. Does stack upgrade not work for you?

@tebello-thejane
Copy link
Contributor Author

Well, of course stack install stack works outside of a stack-ified project.

Would be nice to have stack build via cabal, though. We haven't abandoned cabal yet.

@tebello-thejane
Copy link
Contributor Author

stack install stack fails with

Using latest snapshot resolver: lts-2.22
Writing global (non-project-specific) config file to: /home/thejanet/.stack/global/stack.yaml
Note: You can change the snapshot via the resolver field there.
Downloaded lts-2.22 build plan.    
Caching build plan
While constructing the BuildPlan the following exceptions were encountered:

--  While attempting to add dependency,
    Could not find package path in known packages

--  Failure when adding dependencies:    
      base: needed (<0 && <0), latest is 4.8.1.0, but 4.7.0.2 found
      path: needed (-any && >=0.5.1), latest is 0.5.2, but not present in build plan
    needed for package: stack-9.9.9

Recommended action: try adding the following to your extra-deps in /home/thejanet/.stack/global/stack.yaml
- path-0.5.2

You may also want to try the 'stack solver' command

which I guess makes sense.

But stack upgrade seems to works just fine (it's building as I type this with no hitches so far). Thanks. :-)

@snoyberg
Copy link
Contributor

I'm in favor in general of getting stack to build with cabal (that's why the Travis build uses cabal). But I'm not going to spend a lot of effort on it, especially when there's a bug in cabal. If someone else wants to look into this, I'd be greatful.

@tebello-thejane
Copy link
Contributor Author

I'll try to whip up a bug report for cabal. Thanks.

@tebello-thejane
Copy link
Contributor Author

Reported here: haskell/cabal#2759

Could we at least note this somewhere, so that new users won't find themselves unable to install stack for the first time? I would not have been able to install the latest stack had I not already had stack installed.

@borsboom
Copy link
Contributor

I've added a note to the README. Note that we generally recommend new users use the binaries rather than building from source (which requires a pre-existing GHC and cabal-install).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants