creswick / chatter

A library of Natural Language Processing algorithms for Haskell.
Other
73 stars 24 forks source link

chatter doesn't work on latest Stackage with GHC 8 #23

Open varosi opened 8 years ago

varosi commented 8 years ago
C:\Users\User\AppData\Local\Temp\stack3168\chatter-0.5.2.1\src\NLP\ML\AvgPerceptron.hs:86:10: error:
        * No instance for (NFData Class)
            arising from a use of `Control.DeepSeq.$dmrnf'
        * In the expression: Control.DeepSeq.$dmrnf
          In an equation for `rnf': rnf = Control.DeepSeq.$dmrnf
          In the instance declaration for `NFData Perceptron'
creswick commented 8 years ago

@varosi Was this caused by a stale dependency? It looks like you solved the problem -- it'd be great if you could leave a quick note here about what happened. (it's bound to happen to someone else eventually!)

varosi commented 8 years ago

Sorry, it is still not working. My fault.

This is the error after removing all the version constraints in .cabal file and leave Stack decide right combination of libraries. As I see cereal-text have some hard-coded constraints not compatible with GHC 8 (i.e. base-4.9) as first problem:

stack solver Using configuration file: stack.yaml Using cabal packages:

  • chatter.cabal

Using resolver: nightly-2016-06-01 Using compiler: ghc-8.0.1 Asking cabal to calculate a build plan... Trying with packages from nightly-2016-06-01 as hard constraints... Attempt failed.

Cabal errors begin cabal.exe: Could not resolve dependencies: trying: chatter-0.8.0.2 (user goal) trying: base-4.9.0.0/installed-4.9... (dependency of chatter-0.8.0.2) next goal: cereal-text (dependency of chatter-0.8.0.2) rejecting: cereal-text-0.1.0.1 (conflict: base==4.9.0.0/installed-4.9..., cereal-text => base>=4.0 && <4.9) rejecting: cereal-text-0.1.0.0 (conflict: base==4.9.0.0/installed-4.9..., cereal-text => base>=4.0 && <4.8) Dependency tree exhaustively searched. <<<< Cabal errors end

Could not parse cabal-install errors:

Cabal errors begin cabal.exe: Could not resolve dependencies: trying: chatter-0.8.0.2 (user goal) trying: base-4.9.0.0/installed-4.9... (dependency of chatter-0.8.0.2) next goal: cereal-text (dependency of chatter-0.8.0.2) rejecting: cereal-text-0.1.0.1 (conflict: base==4.9.0.0/installed-4.9..., cereal-text => base>=4.0 && <4.9) rejecting: cereal-text-0.1.0.0 (conflict: base==4.9.0.0/installed-4.9..., cereal-text => base>=4.0 && <4.8) Dependency tree exhaustively searched. <<<< Cabal errors end

varosi commented 8 years ago

I have put one pull request about it - https://github.com/ulikoehler/cereal-text/pull/2

creswick commented 8 years ago

I put some comments on the PR (which I declined; see the PR comments for details), but I'll reply more to the specific issue here.

It seems like this is just a symptom of the unfortunate gap between ghc versions, where lots of dependencies still need to make updates. It may be the case that chatter's dependencies need to change based on the version of GHC in use, which I am not sure Stack supports (Cabal does, via flags, but I don't know how to account for that with stack).

I'd rather not make changes to chatter to account for what is (typically) a temporary situation. It's not practical to package patched versions of the dependencies, and while it's certainly reasonable to ignore the version constraints when trying a new ghc, I think that's best done with the new cabal flags (e.g., --upgrade-dependencies and --allow-newer).

Looking in more detail, it looks like the initial problem you ran into was with a fairly old version of Chatter, so I'm assuming you did get past that.

I think the best path forward is to try the next release of cereal-text, setting that version as a lower bound in the chatter.cabal file (and making any necessary changes to the stack configuration), and see if that works for the target GHCs -- I'd like to support 7.8-8.x, at least for the short term.

varosi commented 8 years ago

My patch was not that good and I'll try to make you better to support GHC 7.6, 7.8, 7.10 and 8.

Stackage is actually done that problem with linking hard library dependencies (like == 1.10.0.2), exact cabal and exact GHC version for each Stackage set. Stack is using this combination, so there are stronger guarantees about building against Stackage set.

creswick commented 8 years ago

Thanks for the new PRs! I'm hoping to get to them later this week.

On Thu, Jun 2, 2016 at 4:12 AM varosi notifications@github.com wrote:

My patch was not that good and I'll try to make you better to support GHC 7.6, 7.8, 7.10 and 8.

Stackage is actually done that problem with linking hard library dependencies (like == 1.10.0.2), exact cabal and exact GHC version for each Stackage set. Stack is using this combination, so there are stronger guarantees about building against Stackage set.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/creswick/chatter/issues/23#issuecomment-223262346, or mute the thread https://github.com/notifications/unsubscribe/AAPusHtdsfCedh6_PUucJkJpd3IGQO8eks5qHrqfgaJpZM4IqDu2 .

varosi commented 8 years ago

You're welcome! I hope they are okay now.

creswick commented 8 years ago

@varosi could you try chatter-0.9.0.0 and see if it's working now? (I just pushed it to hackage)

varosi commented 8 years ago

It is working for LTS-6.1 which is setup in GitHub in stack.yaml, which is great! But when I try with latest nightly of Stackage (with GHC 8) there is still a problem with upper bounds of cereal module. Current cereal used for latest nightly on Stackage is cereal-0.5.3.0. So may be the constraint should be < 0.5.4.0 ?