ndmitchell / hlint

Haskell source code suggestions
Other
1.48k stars 195 forks source link

hlint doesn't install on ghc 9.6.1 #1477

Closed GeorgeCo closed 1 year ago

GeorgeCo commented 1 year ago

hlint doesn't install on ghc 9.6.1

cabal install hlint
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.8.1.0 supports
'ghc' version < 9.6): /usr/local/bin/ghc is version 9.6.1
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.8.1.0 supports
'ghc' version < 9.6): /usr/local/bin/ghc is version 9.6.1
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: hlint-3.5 (user goal)
[__1] next goal: ghc-lib-parser (dependency of hlint +/-ghc-lib)
[__1] rejecting: ghc-lib-parser-9.6.1.20230312 (conflict: hlint +/-ghc-lib =>
ghc-lib-parser>=9.4 && <9.5)
[__1] trying: ghc-lib-parser-9.4.4.20221225
[__2] next goal: base (dependency of hlint)
[__2] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: ghc-lib-parser =>
base>=4.15 && <4.18)
[__2] skipping: base-4.18.0.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=4.15 && <4.18' from
'ghc-lib-parser')
[__2] rejecting: base-4.17.0.0, base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
base-4.16.1.0, base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0,
base-4.14.2.0, base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0,
base-4.11.1.0, base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0,
base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2,
base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0,
base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0,
base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0,
base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable package requires
installed instance)
[__2] 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, aeson,
haskell-src-exts, haskell-src-exts:setup.Cabal, template-haskell,
th-abstraction
Try running with --minimize-conflict-set to improve the error message.

with --allow-new it gets the following compile error

cabal install hlint --allow-new
...
Building     hlint-3.5 (lib)

Failed to build hlint-3.5.
Build log ( /Users/gcolpitts/.cabal/logs/ghc-9.6.1/hlnt-3.5-3e44558f.log ):
Configuring library for hlint-3.5..
Preprocessing library for hlint-3.5..
Building library for hlint-3.5..
[ 1 of 60] Compiling EmbedData        ( src/EmbedData.hs, dist/build/EmbedData.o, dist/build/EmbedData.dyn_o )
[ 2 of 60] Compiling Extension        ( src/Extension.hs, dist/build/Extension.o, dist/build/Extension.dyn_o )
[ 3 of 60] Compiling Fixity           ( src/Fixity.hs, dist/build/Fixity.o, dist/build/Fixity.dyn_o )
[ 4 of 60] Compiling GHC.Util.ApiAnnotation ( src/GHC/Util/ApiAnnotation.hs, dist/build/GHC/Util/ApiAnnotation.o, dist/build/GHC/Util/ApiAnnotation.dyn_o )
[ 5 of 60] Compiling GHC.Util.Brackets ( src/GHC/Util/Brackets.hs, dist/build/GHC/Util/Brackets.o, dist/build/GHC/Util/Brackets.dyn_o )

src/GHC/Util/Brackets.hs:55:7: error: [GHC-76037]
    Not in scope: data constructor ‘HsSpliceE’
    Suggested fix: Perhaps use ‘HsSpliceTy’ (imported from GHC.Hs)
   |
55 |       HsSpliceE{} -> True
   |       ^^^^^^^^^
[ 6 of 60] Compiling GHC.Util.DynFlags ( src/GHC/Util/DynFlags.hs, dist/build/GHC/Util/DynFlags.o, dist/build/GHC/Util/DynFlags.dyn_o )

src/GHC/Util/DynFlags.hs:11:45: error: [GHC-88464]
    Variable not in scope: fakeLlvmConfig
   |
11 | baseDynFlags = defaultDynFlags fakeSettings fakeLlvmConfig
   |                                             ^^^^^^^^^^^^^^
[ 7 of 60] Compiling GHC.Util.FreeVars ( src/GHC/Util/FreeVars.hs, dist/build/GHC/Util/FreeVars.o, dist/build/GHC/Util/FreeVars.dyn_o )

src/GHC/Util/FreeVars.hs:100:53: error: [GHC-83865]
    • Couldn't match expected type ‘OccName’ with actual type ‘RdrName’
    • In the expression: x
      In the first argument of ‘Set.fromList’, namely ‘[x]’
      In the expression: Set.fromList [x]
    |
100 |   freeVars (L _ (HsUnboundVar _ x)) = Set.fromList [x] -- Unbound variable; also used for "holes".
    |                                                     ^
...
shayne-fletcher commented 1 year ago

this is expected (and the failure to produce a build plan deliberate).

the current version of hlint requires a ghc-lib-parser-9.4.* these versions of ghc-lib-parser cannot be built by compilers > ghc-9.4.4

the next version of hlint will see it upgraded to the ghc-9.6.1 parse tree (https://github.com/ndmitchell/hlint/pull/1470). when released, that version will be buildable with compilers in the range [ghc-9.2.2, ghc-9.6.1].

GeorgeCo commented 1 year ago

Thanks Shayne!

On Tue, Mar 21, 2023 at 5:47 PM Shayne Fletcher @.***> wrote:

this is expected. the current version of hlint requires a ghc-lib-parser-9.4.* these versions of ghc-lib-parser cannot be built by compilers > 9.4.

the next version of hlint will upgrade hlint to the ghc-9.6.1 parse tree (

1470 https://github.com/ndmitchell/hlint/pull/1470). when released, it

will be buildable with compilers in the range [ghc-9.2.2, ghc-9.6.1].

— Reply to this email directly, view it on GitHub https://github.com/ndmitchell/hlint/issues/1477#issuecomment-1478559140, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQIJ63PNRM5R63VTRUSMZTW5IHXXANCNFSM6AAAAAAWCVS6WA . You are receiving this because you authored the thread.Message ID: @.***>

ndmitchell commented 1 year ago

Now works on master, but going to see how long an apply-refact release will be as per https://github.com/mpickering/apply-refact/pull/137. If it's not long I'll wait as then we can have the CI passing first. If it will take a bit longer I'll release without apply-refact support.

zliu41 commented 1 year ago

Sorry for the delay; I just released apply-refact-0.13.0.0.

georgefst commented 1 year ago

Is there anything now holding up a release?

With other ghc-lib-dependent tools (e.g. Ormolu/Fourmolu) having also upgraded to 9.6, HLint support for 9.6 is necessary to unblock usage of the latest versions of those tools (e.g. Fourmolu 0.12) in HLS, even for GHCs 9.2 and 9.4.

prikhi commented 1 year ago

@georgefst AFAICT, just the CI fixes in #1510 & #1507 unless somethings changed since April.

kazu-yamamoto commented 1 year ago

@ndmitchell master works well for GHC 9.6. May I ask you to release a new version of hlint?

andreasabel commented 1 year ago

In the natural flow of events, hlint dropped out of stackage nightly now, which moved to GHC 9.6: https://www.stackage.org/diff/lts-20.26/nightly-2023-06-24

michaelpj commented 1 year ago

A release is also the only thing blocking HLS hlint support for 9.6.

shayne-fletcher commented 1 year ago

A release is also the only thing blocking HLS hlint support for 9.6.

noted @michaelpj. spoke to @ndmitchell about it today. it's on the radar.

ndmitchell commented 1 year ago

Sorry for the delay - I've done all my release checks. CI running now. Once the CI goes green (which may take a few more iterations) there will be a release. Likely tomorrow sometime.

ndmitchell commented 1 year ago

Just released v3.6 which works with GHC 8.6.

kazu-yamamoto commented 1 year ago

@ndmitchell Thanks a lot!