hlint icon indicating copy to clipboard operation
hlint copied to clipboard

Still can't compile with GHC 9.10.1

Open LeventErkok opened this issue 1 year ago • 1 comments

I know this was closed in #1593. But I'm still having issues:

$ cabal new-install hlint
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: hlint-3.8 (user goal)
[__1] next goal: ghc-lib-parser (dependency of hlint +/-ghc-lib)
[__1] rejecting: ghc-lib-parser-9.10.1.20240511 (conflict: hlint +/-ghc-lib => ghc-lib-parser>=9.8 && <9.9)
[__1] trying: ghc-lib-parser-9.8.2.20240223
[__2] next goal: pretty (dependency of ghc-lib-parser)
[__2] rejecting: pretty-1.1.3.6/installed-b893 (conflict: ghc-lib-parser => base>=4.17 && <4.20, pretty => base==4.20.0.0/installed-8a80)
[__2] trying: pretty-1.1.3.6
[__3] next goal: base (dependency of hlint)
[__3] rejecting: base-4.20.0.0/installed-8a80 (conflict: ghc-lib-parser => base>=4.17 && <4.20)
[__3] skipping: base; 4.20.0.1, 4.20.0.0 (has the same characteristics that caused the previous version to fail: excluded by constraint '>=4.17 && <4.20' from 'ghc-lib-parser')
[__3] rejecting: base; 4.19.1.0, 4.19.0.0, 4.18.2.1, 4.18.2.0, 4.18.1.0, 4.18.0.0, 4.17.2.1, 4.17.2.0, 4.17.1.0, 4.17.0.0, 4.16.4.0, 4.16.3.0, 4.16.2.0, 4.16.1.0, 4.16.0.0, 4.15.1.0, 4.15.0.0, 4.14.3.0, 4.14.2.0, 4.14.1.0, 4.14.0.0, 4.13.0.0, 4.12.0.0, 4.11.1.0, 4.11.0.0, 4.10.1.0, 4.10.0.0, 4.9.1.0, 4.9.0.0, 4.8.2.0, 4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (constraint from non-reinstallable package requires installed instance)
[__3] fail (backjumping, conflict set: base, ghc-lib-parser, hlint)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, ghc-lib-parser, hlint, haskell-src-exts, template-haskell, aeson, pretty, haskell-src-exts:setup.Cabal
Try running with --minimize-conflict-set to improve the error message.

Also tried with allow-never:

$ cabal new-install hlint --allow-newer --overwrite-policy=always
... many lines deleted ...
Configuring library for hlint-3.8...
Preprocessing library for hlint-3.8...
Building library for hlint-3.8...
[ 1 of 62] Compiling EmbedData        ( src/EmbedData.hs, dist/build/EmbedData.o, dist/build/EmbedData.dyn_o )
[ 2 of 62] Compiling Extension        ( src/Extension.hs, dist/build/Extension.o, dist/build/Extension.dyn_o )
[ 3 of 62] Compiling Fixity           ( src/Fixity.hs, dist/build/Fixity.o, dist/build/Fixity.dyn_o )
src/Fixity.hs:55:49: error: [GHC-83865]
    • Couldn't match type ‘NoExtField’ with ‘NamespaceSpecifier’
      Expected: XFixitySig GhcPs
        Actual: NoExtField
    • In the first argument of ‘FixitySig’, namely ‘noExtField’
      In the expression:
        FixitySig noExtField [noLocA $ mkRdrUnqual (mkVarOcc name)] x
      In an equation for ‘toFixitySig’:
          toFixitySig (toFixity -> (name, x))
            = FixitySig noExtField [noLocA $ mkRdrUnqual (mkVarOcc name)] x
   |
55 | toFixitySig (toFixity -> (name, x)) = FixitySig noExtField [noLocA $ mkRdrUnqual (mkVarOcc name)] x
   |                                                 ^^^^^^^^^^

... many lines deleted ...

Versions I have:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.10.1
$ cabal --version
cabal-install version 3.12.1.0
compiled using version 3.12.1.0 of the Cabal library

Any help would be appreciated..

LeventErkok avatar Sep 01 '24 17:09 LeventErkok

@LeventErkok https://github.com/ndmitchell/hlint/issues/1593 got closed since the changes got landed . there hasn't been a release yet however. if you are stuck there's always the option of building from git

git clone https://github.com/ndmitchell/hlint.git
cd hlint
PATH=~/.ghcup/ghc/9.10.1/bin:~/.ghcup/bin:~/.cabal/bin:$PATH;export PATH
cabal build
cabal run exe:hlint -- --test # test
cabal install exe:hlint --overwrite-policy=always # install binary to ~/.cabal/bin/hlint

note that apply-refact remains unsupported with ghc-9.10.1 so if you rely on refactor it needs to be preinstalled using an older ghc. there's a poll on threads right now to help understand user sentiment on whether this should block a hlint ghc-9.10.1 release or not.

shayne-fletcher avatar Sep 01 '24 18:09 shayne-fletcher

Hlint master builds with GHC 9.10.1 and appears to work fine. How about doing a release?

jforberg avatar Dec 11 '24 16:12 jforberg

I need several more patches (55172169badabdb002ab94662c1ee728962d8a62, 5b87373f078d4ae44bc35fd0d50f418a90d764a1, and most importantly 7aafde56f6bc526aedb95fb282d8fd2b4ea290cc) to build on GHC 9.10. Unfortunately, these patches are not released in hlint-3.8, and no hlint-3.8.1 exists yet.

9999years avatar Feb 06 '25 20:02 9999years

I need several more patches (5517216, 5b87373, and most importantly 7aafde5) to build on GHC 9.10. Unfortunately, these patches are not released in hlint-3.8, and no hlint-3.8.1 exists yet.

3.10 was released a few days ago (https://github.com/ndmitchell/hlint/releases/tag/v3.10). that is ghc-9.10 compatible.

shayne-fletcher avatar Feb 07 '25 13:02 shayne-fletcher

@shayne-fletcher Great, thanks!

jforberg avatar Feb 07 '25 21:02 jforberg

3.10 was released a few days ago (https://github.com/ndmitchell/hlint/releases/tag/v3.10). that is ghc-9.10 compatible.

Hello, I'm noticing that 3.10 has the following bounds: ghc-lib-parser (>=9.12 && <9.13), ghc-lib-parser-ex (>=9.12.0.0 && <9.13.0).

How is this ghc-9.10 compatible? Don't I need to compile hlint with a ghc-lib-parser version that's tied to the GHC version?

thomasjm avatar Aug 28 '25 02:08 thomasjm

3.10 was released a few days ago (https://github.com/ndmitchell/hlint/releases/tag/v3.10). that is ghc-9.10 compatible.

Hello, I'm noticing that 3.10 has the following bounds: ghc-lib-parser (>=9.12 && <9.13), ghc-lib-parser-ex (>=9.12.0.0 && <9.13.0).

How is this ghc-9.10 compatible? Don't I need to compile hlint with a ghc-lib-parser version that's tied to the GHC version?

ghc-lib-parser-9.12.2.20250421 compiles with build compilers in the range 9.8.1 <= ghc-9.12.2

shayne-fletcher avatar Aug 28 '25 03:08 shayne-fletcher

Right, but if I have a GHC 9.10 project that wants to do parsing of Haskell code etc., I'm pretty sure I need to use the ghc-lib-parser corresponding to my version? (To be clear, I'm talking about compiling IHaskell, which is designed to interactively execute Haskell code for a specific GHC version.)

The problem I'm having is this:

  1. I try to use hlint-3.10 with my IHaskell build for GHC 9.10
  2. This requires that I use ghc-lib-parser_9_12_2_20250320 or similar
  3. But IHaskell also has other dependencies, like fourmolu, which also have dependency bounds on ghc-lib-parser.
  4. So now I have to update fourmolu to one that matches ghc-lib-parser-9.12x, and next thing I know I'm updating Cabal-syntax to the 9.12 version per the fourmolu constraint, and my build is broken because you apparently can't do that.

It looks to me like there's an hlint-3.9-shaped hole in between the hlint-3.8 (for 9.8.x) and hlint-3.10 (for 9.12.x) releases...

thomasjm avatar Aug 28 '25 05:08 thomasjm

FWIW, I got it working by manually changing the source to be from 7dfba720eaf6fa9bd0b23ae269334559aa722847.

It looks like there was a whole range of hlint commits from 74542f93459e1e3ab3070d707a1e9922c465ff05 to 7dfba720eaf6fa9bd0b23ae269334559aa722847 that have GHC 9.10 support. I think one of these could potentially be released as hlint-0.9 to improve this situation?

Btw, it looks like there is a heavy dependency on GHC version here, as evidenced by the size of the commits 7aafde56f6bc526aedb95fb282d8fd2b4ea290cc (adding 9.10 support) and ae1695c934e74e1bea31c6c7eac5a31b05ea381c (adding 9.12 support).

thomasjm avatar Aug 28 '25 05:08 thomasjm

we never did release a version of hlint that uses the GHC 9.10 parse tree. we sat 9.10 out due to issues with apply-refact support.

shayne-fletcher avatar Aug 28 '25 11:08 shayne-fletcher