Open venantius opened 6 years ago
At the moment time is a bit of a scarse resources around ghc-mod, it seems to have fallen out of stackage since lts-6 (i.e. GHC 7.10). Personally I don't use Stack and thus don't pay it much mind unless someone complains and sends patches :)
In principle ghc-mod should build with GHC 8.0.2 though so this is likely just a bounds issue. Maybe have a look at the Stackage Curator documentation if you want to help fixing this.
I'd be happy to execute any required metadata revisions on Hackage if you can figure out what needs fixing.
In the end I followed the advice in one of the other GitHub issues about GHC support and downgraded my resolver to lts-9.2.1
and that seems to have done the trick. It doesn't work with any more recent lts resolvers.
Just to confirm, looks like ghc-mod is not buildable with stack in the last few LTS releases. I'd suggest removing mentions of stack for the time being, e.g. https://github.com/DanielG/ghc-mod/wiki/Installing#using-the-stack-tool can be confusing unless you know of this issue.
I tried to understand the stackage curator thing but didn't get very far ... was confused that the only mention of ghc-mod
in the stackage repo is in a config option to disable tests (#611), and unclear how I would verify "what is needed" to get it going.
Instead switched my .stack/global-project/stack.yaml
to:
packages: []
resolver: "lts-9.21"
And now stack install ghc-mod
works.
DISCLAIMER: I am totally science-dogging this.
Aha I think I understand right now: we can't "add a temporary upper bound" in stackage for these packages, because they are super common packages (like base
), and this upper bound has to apply for everything in stackage. So what I believe needs to happen is a new version of ghc-mod
needs to be released that relaxes the upper bounds from the initial error message (this here from lts-11.22
):
In the dependencies for ghc-mod-5.8.0.0:
Cabal-2.0.1.1 from stack configuration does not match >=1.18 && <1.25 (latest matching version is 1.24.2.0)
base-4.10.1.0 from stack configuration does not match >=4.6.0.1 && <4.10 (latest matching version is 4.9.1.0)
cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version (latest matching version is 0.7.3.0)
extra-1.6.9 from stack configuration does not match <1.6 && >=1.4 (latest matching version is 1.5.3)
ghc-8.2.2 from stack configuration does not match >=7.6 && <8.2
haskell-src-exts-1.20.2 from stack configuration does not match <1.20 && >=1.18 (latest matching version is 1.19.1)
hlint-2.1.10 from stack configuration does not match <2.1 && >=2.0.8 (latest matching version is 2.0.15)
monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4 (latest matching version is 0.7.2)
optparse-applicative-0.14.2.0 from stack configuration does not match >=0.13.0.0 && <0.14 (latest matching version is 0.13.2.0)
Those constraints are from ghc-mod-5.8.0.0
and some have already been addressed on master. From my reading of the current ghc-mod.cabal
, this implies the following constraints need to be amended:
extra
haskell-src-exts
hlint
monad-journal
optparse-applicative
Further, cabal-helper
is not in stackage anymore? It may need to be added?
Ok there is definitely existing WIP that I believe would address this: https://github.com/DanielG/ghc-mod/pull/933 It currently seems stalled on the cabal-helper
dep. There is discussion of that (maybe relevant?) in https://github.com/DanielG/ghc-mod/issues/900
I'm running:
I get the following error:
[ian@localhost ~]$ stack install ghc-mod
Writing implicit global project config file to: /home/ian/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-12.22
Downloaded lts-12.22 build plan.
Preparing to install GHC (tinfo6) to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-tinfo6-8.4.4.
Unpacking GHC into /home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-8.4.4.temp/ Installed GHC.
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Downloading root
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Downloading timestamp
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Downloading snapshot
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Downloading mirrors
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Cannot update index (no local copy)
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Downloading index
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Updated package index downloaded
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc Update complete
Populated index cache.
Error: While constructing the build plan, the following exceptions were
encountered:
In the dependencies for ghc-mod-5.8.0.0:
Cabal-2.2.0.1 from stack configuration does not match >=1.18 && <1.25
(latest matching version is 1.24.2.0)
base-4.11.1.0 from stack configuration does not match >=4.6.0.1 && <4.10
(latest matching version is 4.9.1.0)
cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has
no specified version (latest matching version is 0.7.3.0)
djinn-ghc must match <0.1 && >=0.0.2.2, but the stack configuration has no
specified version (latest matching version is 0.0.2.3)
extra-1.6.13 from stack configuration does not match <1.6 && >=1.4 (latest
matching version is 1.5.3)
ghc-8.4.4 from stack configuration does not match >=7.6 && <8.2
ghc-syb-utils must match <0.3 && >=0.2.3, but the stack configuration has no
specified version (latest matching version is 0.2.3.3)
haskell-src-exts-1.20.3 from stack configuration does not
match <1.20 && >=1.18 (latest matching version
is 1.19.1)
hlint-2.1.11 from stack configuration does not match <2.1 && >=2.0.8
(latest matching version is 2.0.15)
monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4
(latest matching version is 0.7.2)
optparse-applicative-0.14.3.0 from stack configuration does not
match >=0.13.0.0 && <0.14 (latest matching
version is 0.13.2.0)
temporary-1.3 from stack configuration does not match <1.3 && >=1.2.0.3
(latest matching version is 1.2.1.1)
needed since ghc-mod is a build target.
Some different approaches to resolving this:
* Consider trying 'stack solver', which uses the cabal-install solver to
attempt to find some working build configuration. This can be convenient
when dealing with many complicated constraint errors, but results may be
unpredictable.
* Build requires unattainable version of base. Since base is a part of GHC,
you most likely need to use a different GHC version with the matching base.
Plan construction failed.
Forgive me if this issue turns out to be totally asanine; I'm new to this.
I created a new stack project, set the resolver to ghc 8.0.2, and tried to
stack build ghc-mod
. No luck - it failed to find a bunch of dependencies, and recommended I add them to extra-deps. I did so, tried again, and it told me to add more. And more. And more.So then I end up with this:
stack.yaml
I tried again and at this point there was a conflict around which version of
base
it wanted, and told me to try settingallow-newer: true
. I did, and this allowed about half the project to build before failing.I feel like I have to be missing something obvious here - what am I doing wrong?