Closed konnik closed 1 year ago
I have never seen that error and our CI succeeds for almost this arch/platform/ghc/cabal combination.
Perhaps you have an old happy
version lying around somewhere? Do you have anything in ~/.cabal/bin
or installed something via stack install
or brew some time ago?
Can't remember I have installed happy
before (btw, I have no clue what happy
is... :-) ) and I can't find happy
in my path:
$ which happy
Tried to build with latest stack (using ghcup for managing cabal and ghc) and that worked out ok so it seems to be an issue with cabal?
One thing I found searching for similar issues is this: https://github.com/haskell/cabal/issues/8489 I'm too much of a newbie to make any sense of the discussion there though :-)
Let's take a look:
happy
: https://hackage.haskell.org/package/happy-1.20.1.1/changelog
%shift
directive was introduced in 1.20ghc-lib-parser
clearly has some %shift
s so needs at least 1.20.ghc-lib-parser
cabal file: https://hackage.haskell.org/package/ghc-lib-parser-9.6.2.20230523/ghc-lib-parser.cabal
happy >= 1.19
, uh ohSo ghc-lib-parser
has a too-lax lower bound on happy.
However, normally cabal picks the latest versions of packages. I would try building with --constraint 'happy >= 1.20
and see if it tells you why it thinks it can't pick that.
I did manage to build HLS with cabal 3.8.1.0. After that I switched to cabal 3.10.1.0 and now cabal build
worked.
But I suspect that that was because of ghc-lib-parser
was already built and reused?
I then tried to build with the --constraint 'happy >= 1.20'
parameter but that did not force a rebuild of ghc-lib-parser
. Is there a way of cleaning an already built dependency?
Okay, I don't understand why that isn't changing things. Maybe happy
is special somehow, but I would still expect cabal to give a solver error, I can't see how it's happy with both. Still, if you got it to work, I suspect this isn't worth more investigation unless you feel like it.
I can try to do some investigation on my own to see if I can narrow down the root of the problem further. But perfectly it's fine to close this issue because I don't think it's HLS's "fault". Thanks for the help.
Just for the record I have now found the cause of this issue. See: https://github.com/digital-asset/ghc-lib/issues/484
I have some trouble trying to build HLS from source to be able to try som some HLS plugin hacking.
Your environment
MacOS X 11.7.9 (old intel mac)
From ghcup:
What's wrong?
Following the instructions https://haskell-language-server.readthedocs.io/en/latest/contributing/contributing.html#building
Any suggestions how to fix this error? Thanks in advance.