DanielG / ghc-mod

Happy Haskell Hacking for editors. DEPRECATED
Other
677 stars 175 forks source link

Failed to install ghc-mod with ghc 7.10 & cabal 1.22 #437

Closed tonyday567 closed 9 years ago

tonyday567 commented 9 years ago

From a fresh clone, cabal install fails with:

Language/Haskell/GhcMod/Gap.hs:256:18: Not in scope: data constructor ‘ExposePackageId’ Perhaps you meant ‘ExposePackage’ (imported from DynFlags)

ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.0.20141222 ~/git/ghc-mod ghc710 master* cabal --version cabal-install version 1.22.0.0 using version 1.22.0.0 of the Cabal library

DanielG commented 9 years ago

This is all fixed in my fork, I'm just finishing up a few things before releasing it as for example case splitting is currently broken with 7.10 :/

tonyday567 commented 9 years ago

OK, thanks Daniel. Looking forward to the upgrade :)

ebenTill commented 9 years ago

Are there any updates on this? Also (expectedly) affects Cabel 1.23. Missing ghc-mod a lot!

DanielG commented 9 years ago

Working on it still, unfortunately I managed to break case splitting with my changes somehow so I can't release this yet :/

fhaust commented 9 years ago

Anything we could do to make this go away?

Fizzixnerd commented 9 years ago

Any word on an update on this?

vbettaque commented 9 years ago

I would also appreciate an update on this issue. It's really driving me nuts!

DanielG commented 9 years ago

The workaround is basically to downgrade ghc for now as work has me rather tied up at the moment so I don't have any time to fix this properly, sorry. The GHC 7.10 support is all mangled up with a whole lot of other far reaching changes in my fork so It's not really feasible to release anything without finishing all that up first. (See: https://github.com/kazu-yamamoto/ghc-mod/compare/master...DanielG:master)

taladar commented 9 years ago

Downgrading GHC also forces a downgrade of cabal-install below 1.22 since ghc-mod does not work with that one either.

cartazio commented 9 years ago

@DanielG would you like help from hackage trustees to cut a version that works with 7.10 sooner (how can @bergmark @hvr, myself, etc help?)

DanielG commented 9 years ago

Right now I'm trying to fix all the failures in the test suite, which I thought I already had working at some point, but It's going quite slowly as I only have a few hours every few days. I'm not sure anyone would really be able to help much there without digging quite deep into the code but if anyone wants to help with that or testing in general just swing by IRC and I can give some guidance on how to help. So far people have only been complaining ;)

Not sure how hackage trustees specifically would be any more help than just anyone willing to spend some time on this.

cartazio commented 9 years ago

I'll see if I can find some time. If you want some faster help, a post to haskell cafe or reddit might result in someone getting it sorted this weeke nd On Apr 3, 2015 5:56 PM, "Daniel Gröber" notifications@github.com wrote:

Right now I'm trying to fix all the failures in the test suite, which I thought I already had working at some point, but It's going quite slowly as I only have a few hours every few days. I'm not sure anyone would really be able to help much there without digging quite deep into the code but if anyone wants to help with that or testing in general just swing by IRC and I can give some guidance on how to help. So far people have only been complaining ;)

Not sure how hackage trustees specifically would be any more help than just anyone willing to spend some time on this.

— Reply to this email directly or view it on GitHub https://github.com/kazu-yamamoto/ghc-mod/issues/437#issuecomment-89432042 .

joshacheson commented 9 years ago

Anyone have advice regarding explicit steps I can take to work around this for now? I'm using https://ghcformacosx.github.io/ and have versions of ghc/cabal install up to date with that.

oblitum commented 9 years ago

@joshacheson exactly being up to date is the problem. Solving for now means: downgrade.

joshacheson commented 9 years ago

Yeah sorry, I'm just not quite sure how to downgrade / obtain an older version of this. Sorry for bein such a newb.

edit: I realize this isn't the obligation of anyone who works on ghc-mod to tell me this, but if oyu know off-hand it'd be a great help. Otherwise no worries.

oblitum commented 9 years ago

@joshacheson there's an older version at the same website. You just need to stick with that and wipe out the new one from your system (ghc, cabal, and the cabal home).

wuciawe commented 9 years ago

@joshacheson I just downgrade to ghc 7.8.4 and cabal 1.20.0.3, and succeed in installing ghc-mod

geraldus commented 9 years ago

Any progress on GHC 7.10 support? Having exact same error:

[ 9 of 38] Compiling Language.Haskell.GhcMod.Gap ( Language/Haskell/GhcMod/Gap.hs, dist/build/Language/Haskell/GhcMod/Gap.o )

Language/Haskell/GhcMod/Gap.hs:256:18:
    Not in scope: data constructor ‘ExposePackageId’
    Perhaps you meant ‘ExposePackage’ (imported from DynFlags)
behr328 commented 9 years ago

Experiencing the same issue here as well """"" Language/Haskell/GhcMod/Utils.hs:45:51: Warning: In the use of ‘strMsg’ (imported from Language.Haskell.GhcMod.Error, but defined in Control.Monad.Trans.Error): Deprecated: "Use Control.Monad.Trans.Except instead" [ 8 of 38] Compiling Language.Haskell.GhcMod.Types ( Language/Haskell/GhcMod/Types.hs, dist/build/Language/Haskell/GhcMod/Types.o ) [ 9 of 38] Compiling Language.Haskell.GhcMod.Gap ( Language/Haskell/GhcMod/Gap.hs, dist/build/Language/Haskell/GhcMod/Gap.o )

Language/Haskell/GhcMod/Gap.hs:256:18: Not in scope: data constructor ‘ExposePackageId’ Perhaps you meant ‘ExposePackage’ (imported from DynFlags) cabal: Error: some packages failed to install: ghc-mod-5.2.1.2 failed during the building phase. The exception was: ExitFailure 1

"""

oblitum commented 9 years ago

Guys, everybody will be having this issue! There're two options solely, help or downgrade.

hellerve commented 9 years ago

In case anyone wants to start working on this (I do not have the insight into GHC nor ghc-mod and don't feel competent enough to fix this), there is some things I found (take everything I say with a grain of salt): The missing data constructor ExposePackageId is still in DynFlags, according to the docs. However, in GHC commit 4accf60, it was integrated into the ExposePackage constructor, which in turn has a data constructor PackageIdArg, which should be equivalent.

I hope this helps.

jonschoning commented 9 years ago

DanielG has a lot of interconnected pending changes -- you'd need guidance from him first.

geraldus commented 9 years ago

I can confirm that Daniel's [1] fork (upcoming release) work well with GHC 7.8.4 and cabal-1.22. I've tried to look at sources of ghc-mod because of cabal-1.22 issue, but unfortunately my current experience is too small to make anything helpful. [1] https://github.com/DanielG/ghc-mod

I heard that GHC 7.10 should eliminate cabal-1.22 issue, and hoped that it's possible to build ghc-mod with it.

mvoidex commented 9 years ago

@geraldus , yeap, it compiles with ghc-7.10.1

jimenezrick commented 9 years ago

For me, Daniel's fork compiles and seems to work well with ghc-7.10.1 as well :)

geraldus commented 9 years ago

@mvoidex I can't build ghc-mod from package, error reported in topic head.

mvoidex commented 9 years ago

@geraldus, I mean Daniel's fork

Skyfold commented 9 years ago

It works and now I fully understand why there needs to be a way to easily have separate versions of ghc, cabal and other packages installed on the same system.

sofianito commented 9 years ago

how to downgrade ghc to 7.8.4 and cabal to 1.20.0.3 with homebrew?

geraldus commented 9 years ago

@sofianito Can't be certain, brew likely can't install arbitrary versions of its «kegs». Maybe the easiest way would be uninstall brew Haskell kegs and try Halcyon (which seems to be good drop-in replacement of brew in terms of Haskell).

fatlazycat commented 9 years ago

You can pin to a version of a keg once installed on homebrew. I use stackage to keep the version of cabal correct for ghc-mod.

oblitum commented 9 years ago

@geraldus https://ghcformacosx.github.io is also a good drop-in option for OS X. Both the latest as well as the previous version is available for download.

geraldus commented 9 years ago

@oblitum I use it for myself, very appreciate! (:

sofianito commented 9 years ago

Thanks for the hints.

@fatlazycat: Could you please provide commands to do it?

I had previously used ghcformacosx. I'll give a try to Halcyon

tonyday567 commented 9 years ago

I tend to follow this recipe: http://www.edsko.net/2013/02/10/comprehensive-haskell-sandboxes/ Works great and switching between environments is easy.

jimenezrick commented 9 years ago

I confirm I can install cleanly ghc-mod from this master branch using GHC 7.10.1 and cabal-install 1.22.2.0 using sandboxes.

quchen commented 9 years ago

It's not working for me with GHC 7.10.1 and cabal(-install) 1.22.2. Build log: https://gist.github.com/quchen/b1475a276b1f3d33c713

hellerve commented 9 years ago

@quchen, you did not read the issue comments. The working version (for GHC 7.10) can be found in DanielGs fork. It should work with GHC 7.10 and your cabal version, or at leas throw a different kind of compile error, because the one GHC generated in your gist is fixed.

EDIT: Sorry if I sounded a bit rude there. Did not mean to be all douchy about it.

radix commented 9 years ago

@hellerve I believe @quchen was responding to @jimenezrick, who specifically said "this master branch" was building for them on "GHC 7.10.1 and cabal-install 1.22.2.0 using sandboxes".

hellerve commented 9 years ago

@radix that makes sense. However i doubt that @jimenezrick really meant "this master" when he said it, but rather Daniels. Wording problems, maybe?

quchen commented 9 years ago

Anyway, now that I've cloned DanielG's master, despite the fact that the build is broken according to Travis, building GHC-mod worked with 7.10.1 and 1.22.2. Thanks @hellerve!

hellerve commented 9 years ago

Yay! I'm glad I could help.

As an aside: as Daniel said above, he is currently fixing the tests before merging the new release, so that may be the reason why travis claims the build is broken.

DanielG commented 9 years ago

Btw. the changes are in kazu/master now :)

The build is broken because of a bunch of issues which I haven't had time to investigate yet.

For ghc 7.10 the only remaining failures are case splitting and related functionality. For ghc 7.8 browse and check sometimes break in addition to case splitting and the other ones I don't remember.

jimenezrick commented 9 years ago

Yep, I was referring I can build cleanly this master (247e4e0e7616fe1fecc68fdcf80d6249ac4cee4f) inside a sandbox. @quchen @hellerve

Are you in Linux using sandboxes?

hellerve commented 9 years ago

@jimenezrick interesting. So I misunderstood.

No, I am on OS X, but I am always using sandboxes. I use Daniels fork for now and it seems to work for the features I am making use of. So, thanks very much, Daniel!

galderz commented 9 years ago

Getting started with both Emacs and Haskell and just encountered this :disappointed:. Given I'm a beginner in both, what would be the easiest way to get around this? Building master in a sandbox environment? Downgrading GHC + Cabal version in a sandboxed environment? Using Halcyon?

jimenezrick commented 9 years ago

For me, using GHC 7.10.1 and building ghc-mod from master in a sandbox just works :)

deepfire commented 9 years ago

Then we need a release! : -)

DanielG commented 9 years ago

Anyone willing to spend some time on this feel free to try and fix the build on travis, that would move the release quite a lot closer. After that the only item left on my TODO list is re-initializing ghc's state when compiler options change for ghci.

galderz commented 9 years ago

For me, using GHC 7.10.1 and building ghc-mod from master in a sandbox just works :)

That worked for me, but took me a while to figure out exact steps. For any beginners out there, here's some step-by-step instructions:

clone master into /opt/ghc-mod
cabal sandbox init --sandbox ./.cabal-sandbox/7.10.1
cabal install --only-dependencies --builddir=dist/7.10.1
cabal configure --builddir=dist/7.10.1
cabal build     --builddir=dist/7.10.1

Add to PATH: /opt/ghc-mod/dist/7.10.1/build/ghc-mod and /opt/ghc-mod/dist/7.10.1/build/ghc-modi

Add to Emacs load-path /opt/ghc-mod/elisp. E.g.

(progn (cd "/opt/ghc-mod/elisp") (normal-top-level-add-subdirs-to-load-path))

(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
    (let* ((my-lisp-dir "/opt/ghc-mod/elisp")
          (default-directory my-lisp-dir))
      (setq load-path (cons my-lisp-dir load-path))
          (normal-top-level-add-subdirs-to-load-path)))

I'm sure there are easier ways to do this, but works for me, in case anyone finds it useful