haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 213 forks source link

Support for ghc-8.10.1 #1712

Open mouse07410 opened 4 years ago

mouse07410 commented 4 years ago

Fails. With "normal" Cabal config - fails to construct dependency tree:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.1
$ ./cabal-hie-install hie-8.10.1
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.0.0.0 supports
'ghc' version < 8.10): /Users/ur20980/.ghcup/bin/ghc is version 8.10.1
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: fake-package-0 (user goal)
[__1] trying: base-4.14.0.0/installed-4.1... (dependency of fake-package)
[__2] trying: hie-install-0.8.1.0 (user goal)
[__3] trying: hie-install:-run-from-stack
[__4] next goal: cabal-install-parsers (dependency of hie-install
-run-from-stack)
[__4] rejecting: cabal-install-parsers-0.2, cabal-install-parsers-0.1
(conflict: base==4.14.0.0/installed-4.1..., cabal-install-parsers =>
base>=4.10 && <4.14)
[__4] fail (backjumping, conflict set: base, cabal-install-parsers,
hie-install, hie-install:run-from-stack)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, cabal-install-parsers,
hie-install, hie-install:run-from-stack, fake-package
Try running with --minimize-conflict-set to improve the error message.

If --allow-newer: True is set:

$ ./cabal-hie-install hie-8.10.1
Resolving dependencies...
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - binary-orphans-1.0.1 (lib) (requires build)
 - base-compat-0.11.1 (lib) (requires build)
 - base-orphans-0.8.2 (lib) (requires build)
 - base16-bytestring-0.1.1.6 (lib:base16-bytestring) (requires build)
 - clock-0.8 (lib) (requires build)
 - cryptohash-sha256-0.11.101.0 (lib) (requires build)
 - dlist-0.8.0.7 (lib) (requires build)
 - heaps-0.3.6.1 (lib) (requires build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - hashable-1.3.0.0 (lib) (requires build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - js-flot-0.8.3 (lib) (requires build)
 - js-jquery-3.3.1 (lib) (requires build)
 - integer-logarithms-1.0.3 (lib) (requires build)
 - network-uri-2.6.3.0 (lib) (requires build)
 - primitive-0.7.0.1 (lib) (requires build)
 - random-1.1 (lib) (requires build)
 - semigroups-0.19.1 (lib) (requires build)
 - utf8-string-1.0.1.1 (lib:utf8-string) (requires build)
 - tagged-0.8.6 (lib) (requires build)
 - th-abstraction-0.3.2.0 (lib) (requires build)
 - tar-0.5.1.1 (lib) (requires build)
 - text-binary-0.2.1.1 (lib:text-binary) (requires build)
 - base-compat-batteries-0.11.1 (lib) (requires build)
 - time-compat-1.9.3 (lib) (requires build)
 - lukko-0.1.1.2 (lib) (requires download & build)
 - unordered-containers-0.2.10.0 (lib) (requires build)
 - case-insensitive-1.2.1.0 (lib) (requires build)
 - vector-0.12.1.2 (lib) (requires build)
 - scientific-0.3.6.2 (lib) (requires build)
 - uuid-types-1.0.3 (lib) (requires build)
 - extra-1.7.1 (lib) (requires build)
 - vector-binary-instances-0.2.5.1 (lib) (requires build)
 - attoparsec-0.13.2.3 (lib) (requires build)
 - filepattern-0.1.2 (lib) (requires build)
 - aeson-1.4.7.1 (lib) (requires download & build)
 - shake-0.18.5 (lib) (requires build)
 - binary-instances-1.0.0.1 (lib) (requires download & build)
 - cabal-install-parsers-0.2 (lib) (requires build)
 - hie-install-0.8.1.0 (lib) (first run)
 - fake-package-0 (exe:script) (first run)
Downloading  lukko-0.1.1.2
Starting     base16-bytestring-0.1.1.6 (all, legacy fallback)
Starting     binary-orphans-1.0.1 (lib)
Starting     base-orphans-0.8.2 (lib)
Starting     base-compat-0.11.1 (lib)
Downloaded   lukko-0.1.1.2
Downloading  aeson-1.4.7.1
Downloaded   aeson-1.4.7.1
Downloading  binary-instances-1.0.0.1
Downloaded   binary-instances-1.0.0.1
Building     base-orphans-0.8.2 (lib)
Haddock      base-orphans-0.8.2 (lib)
Building     base16-bytestring-0.1.1.6 (all, legacy fallback)
Building     base-compat-0.11.1 (lib)
Installing   base-orphans-0.8.2 (lib)
Building     binary-orphans-1.0.1 (lib)
Haddock      base16-bytestring-0.1.1.6 (all, legacy fallback)
Haddock      binary-orphans-1.0.1 (lib)
Installing   base16-bytestring-0.1.1.6 (all, legacy fallback)
Completed    base-orphans-0.8.2 (lib)
Starting     clock-0.8 (lib)
Installing   binary-orphans-1.0.1 (lib)
Completed    base16-bytestring-0.1.1.6 (all, legacy fallback)
Starting     cryptohash-sha256-0.11.101.0 (lib)
Completed    binary-orphans-1.0.1 (lib)
Starting     dlist-0.8.0.7 (lib)
Building     clock-0.8 (lib)
Building     dlist-0.8.0.7 (lib)
Haddock      dlist-0.8.0.7 (lib)
Building     cryptohash-sha256-0.11.101.0 (lib)
Haddock      clock-0.8 (lib)
Installing   dlist-0.8.0.7 (lib)
Completed    dlist-0.8.0.7 (lib)
Starting     heaps-0.3.6.1 (lib)
Installing   clock-0.8 (lib)
Completed    clock-0.8 (lib)
Starting     hsc2hs-0.68.7 (exe:hsc2hs)
Haddock      base-compat-0.11.1 (lib)
Haddock      cryptohash-sha256-0.11.101.0 (lib)
Building     heaps-0.3.6.1 (lib)
Installing   cryptohash-sha256-0.11.101.0 (lib)
Building     hsc2hs-0.68.7 (exe:hsc2hs)
Completed    cryptohash-sha256-0.11.101.0 (lib)
Starting     hashable-1.3.0.0 (lib)
Building     hashable-1.3.0.0 (lib)
Installing   base-compat-0.11.1 (lib)
Completed    base-compat-0.11.1 (lib)
Starting     js-dgtable-0.5.2 (lib)
Haddock      heaps-0.3.6.1 (lib)
Haddock      hashable-1.3.0.0 (lib)
Installing   heaps-0.3.6.1 (lib)
Installing   hashable-1.3.0.0 (lib)
Completed    heaps-0.3.6.1 (lib)
Starting     js-flot-0.8.3 (lib)
Building     js-dgtable-0.5.2 (lib)
Completed    hashable-1.3.0.0 (lib)
Starting     js-jquery-3.3.1 (lib)
Haddock      js-dgtable-0.5.2 (lib)
Installing   js-dgtable-0.5.2 (lib)
Building     js-flot-0.8.3 (lib)
Installing   hsc2hs-0.68.7 (exe:hsc2hs)
Completed    hsc2hs-0.68.7 (exe:hsc2hs)
Building     js-jquery-3.3.1 (lib)
Starting     integer-logarithms-1.0.3 (lib)
Completed    js-dgtable-0.5.2 (lib)
Starting     network-uri-2.6.3.0 (lib)
Haddock      js-jquery-3.3.1 (lib)
Installing   js-jquery-3.3.1 (lib)
Building     integer-logarithms-1.0.3 (lib)
Building     network-uri-2.6.3.0 (lib)
Completed    js-jquery-3.3.1 (lib)
Starting     primitive-0.7.0.1 (lib)
Haddock      integer-logarithms-1.0.3 (lib)
Building     primitive-0.7.0.1 (lib)
Installing   integer-logarithms-1.0.3 (lib)
Haddock      js-flot-0.8.3 (lib)
Completed    integer-logarithms-1.0.3 (lib)
Starting     random-1.1 (lib)
Installing   js-flot-0.8.3 (lib)
Completed    js-flot-0.8.3 (lib)
Starting     semigroups-0.19.1 (lib)
Building     random-1.1 (lib)
Building     semigroups-0.19.1 (lib)
Haddock      semigroups-0.19.1 (lib)
Haddock      network-uri-2.6.3.0 (lib)
Installing   semigroups-0.19.1 (lib)
Completed    semigroups-0.19.1 (lib)
Starting     utf8-string-1.0.1.1 (all, legacy fallback)
Installing   network-uri-2.6.3.0 (lib)
Completed    network-uri-2.6.3.0 (lib)
Starting     tagged-0.8.6 (lib)
Building     utf8-string-1.0.1.1 (all, legacy fallback)
Haddock      random-1.1 (lib)
Building     tagged-0.8.6 (lib)
Installing   random-1.1 (lib)
Completed    random-1.1 (lib)
Starting     th-abstraction-0.3.2.0 (lib)
Haddock      primitive-0.7.0.1 (lib)
Haddock      utf8-string-1.0.1.1 (all, legacy fallback)
Haddock      tagged-0.8.6 (lib)
Building     th-abstraction-0.3.2.0 (lib)
Installing   utf8-string-1.0.1.1 (all, legacy fallback)
Installing   tagged-0.8.6 (lib)
Completed    utf8-string-1.0.1.1 (all, legacy fallback)
Starting     tar-0.5.1.1 (lib)
Completed    tagged-0.8.6 (lib)
Starting     text-binary-0.2.1.1 (all, legacy fallback)
Installing   primitive-0.7.0.1 (lib)
Building     tar-0.5.1.1 (lib)
Building     text-binary-0.2.1.1 (all, legacy fallback)
Completed    primitive-0.7.0.1 (lib)
Starting     time-compat-1.9.3 (lib)
Haddock      text-binary-0.2.1.1 (all, legacy fallback)
Installing   text-binary-0.2.1.1 (all, legacy fallback)
Building     time-compat-1.9.3 (lib)
Completed    text-binary-0.2.1.1 (all, legacy fallback)
Starting     base-compat-batteries-0.11.1 (lib)
Building     base-compat-batteries-0.11.1 (lib)
Haddock      th-abstraction-0.3.2.0 (lib)
Haddock      time-compat-1.9.3 (lib)
Installing   th-abstraction-0.3.2.0 (lib)
Installing   time-compat-1.9.3 (lib)
Completed    th-abstraction-0.3.2.0 (lib)
Starting     unordered-containers-0.2.10.0 (lib)
Completed    time-compat-1.9.3 (lib)
Starting     case-insensitive-1.2.1.0 (lib)
Building     unordered-containers-0.2.10.0 (lib)
Haddock      tar-0.5.1.1 (lib)
Building     case-insensitive-1.2.1.0 (lib)
Haddock      case-insensitive-1.2.1.0 (lib)
Installing   case-insensitive-1.2.1.0 (lib)
Completed    case-insensitive-1.2.1.0 (lib)
Starting     lukko-0.1.1.2 (lib)
Haddock      base-compat-batteries-0.11.1 (lib)
Installing   tar-0.5.1.1 (lib)
Completed    tar-0.5.1.1 (lib)
Starting     extra-1.7.1 (lib)
Building     extra-1.7.1 (lib)
Installing   base-compat-batteries-0.11.1 (lib)
Building     lukko-0.1.1.2 (lib)
Completed    base-compat-batteries-0.11.1 (lib)
Starting     uuid-types-1.0.3 (lib)
Haddock      lukko-0.1.1.2 (lib)
Installing   lukko-0.1.1.2 (lib)
Haddock      extra-1.7.1 (lib)
Completed    lukko-0.1.1.2 (lib)
Starting     vector-0.12.1.2 (lib)
Building     uuid-types-1.0.3 (lib)
Installing   extra-1.7.1 (lib)
Building     vector-0.12.1.2 (lib)
Completed    extra-1.7.1 (lib)
Starting     scientific-0.3.6.2 (lib)
Haddock      uuid-types-1.0.3 (lib)
Building     scientific-0.3.6.2 (lib)
Installing   uuid-types-1.0.3 (lib)
Completed    uuid-types-1.0.3 (lib)
Starting     filepattern-0.1.2 (lib)
Haddock      unordered-containers-0.2.10.0 (lib)
Building     filepattern-0.1.2 (lib)
Installing   unordered-containers-0.2.10.0 (lib)
Completed    unordered-containers-0.2.10.0 (lib)
Haddock      filepattern-0.1.2 (lib)
Haddock      scientific-0.3.6.2 (lib)
Installing   filepattern-0.1.2 (lib)
Installing   scientific-0.3.6.2 (lib)
Completed    filepattern-0.1.2 (lib)
Starting     shake-0.18.5 (lib)
Completed    scientific-0.3.6.2 (lib)
Starting     attoparsec-0.13.2.3 (lib)
Building     shake-0.18.5 (lib)
Building     attoparsec-0.13.2.3 (lib)
Haddock      attoparsec-0.13.2.3 (lib)
Installing   attoparsec-0.13.2.3 (lib)
Completed    attoparsec-0.13.2.3 (lib)
Haddock      shake-0.18.5 (lib)
Installing   shake-0.18.5 (lib)
Completed    shake-0.18.5 (lib)
Haddock      vector-0.12.1.2 (lib)
Installing   vector-0.12.1.2 (lib)
Completed    vector-0.12.1.2 (lib)
Starting     vector-binary-instances-0.2.5.1 (lib)
Starting     aeson-1.4.7.1 (lib)
Building     vector-binary-instances-0.2.5.1 (lib)
Building     aeson-1.4.7.1 (lib)
Haddock      vector-binary-instances-0.2.5.1 (lib)
Installing   vector-binary-instances-0.2.5.1 (lib)
Completed    vector-binary-instances-0.2.5.1 (lib)
Haddock      aeson-1.4.7.1 (lib)
Installing   aeson-1.4.7.1 (lib)
Completed    aeson-1.4.7.1 (lib)
Starting     binary-instances-1.0.0.1 (lib)
Building     binary-instances-1.0.0.1 (lib)
Haddock      binary-instances-1.0.0.1 (lib)
Installing   binary-instances-1.0.0.1 (lib)
Completed    binary-instances-1.0.0.1 (lib)
Starting     cabal-install-parsers-0.2 (lib)
Building     cabal-install-parsers-0.2 (lib)

Failed to build cabal-install-parsers-0.2.
Build log (
/Users/ur20980/.cabal/logs/ghc-8.10.1/cbl-nstll-prsrs-0.2-7495a92a.log ):
Configuring library for cabal-install-parsers-0.2..
Preprocessing library for cabal-install-parsers-0.2..
Building library for cabal-install-parsers-0.2..
[1 of 9] Compiling Cabal.Internal.Glob ( src/Cabal/Internal/Glob.hs, dist/build/Cabal/Internal/Glob.o, dist/build/Cabal/Internal/Glob.dyn_o )
[2 of 9] Compiling Cabal.Internal.Newtypes ( src/Cabal/Internal/Newtypes.hs, dist/build/Cabal/Internal/Newtypes.o, dist/build/Cabal/Internal/Newtypes.dyn_o )
[3 of 9] Compiling Cabal.Optimization ( src/Cabal/Optimization.hs, dist/build/Cabal/Optimization.o, dist/build/Cabal/Optimization.dyn_o )
[4 of 9] Compiling Cabal.Parse      ( src/Cabal/Parse.hs, dist/build/Cabal/Parse.o, dist/build/Cabal/Parse.dyn_o )

src/Cabal/Parse.hs:34:51: error:
    • Couldn't match expected type ‘[C.PError]’
                  with actual type ‘GHC.Base.NonEmpty C.PError’
    • In the third argument of ‘ParseError’, namely ‘es’
      In the second argument of ‘($)’, namely ‘ParseError fp bs es ws’
      In the expression: Left $ ParseError fp bs es ws
   |
34 |     (ws, Left (_, es)) -> Left $ ParseError fp bs es ws
   |                                                   ^^
cabal: Failed to build cabal-install-parsers-0.2 (which is required by
exe:script from fake-package-0). See the build log above for details.

Relevant log ~/.cabal/logs/ghc-8.10.1/cbl-nstll-prsrs-0.2-7495a92a.log: cbl-log.txt

jneira commented 4 years ago

Maybe the cabal.project that works with 8.8.3 could be handy: https://github.com/haskell/haskell-ide-engine/blob/c6241565568e070847b1d6f1e1a5792ddb6d9e81/cabal.project-8.8.3

mouse07410 commented 4 years ago

Maybe the cabal.project that works with 8.8.3 could be handy...

I'm afraid it isn't - I copied it to cabal.project-8.10.1 and got the result posted above.

Thankfully, you guys did a great job with 8.8.3 - it built with 8.8.3 smoothly. But now there's 8.10.1 (and probably 8.10.2 fairly soon to follow) that we need to take care of.

mouse07410 commented 4 years ago

It's probably obvious, but with ghc-8.10.1 installed, even ./cabal-hie-install help doesn't work:

Screen Shot 2020-03-29 at 05 28 52

jneira commented 4 years ago

Jummm, it seems a cabal-install version compiled against the Cabal library version shipped with ghc-8.10.1 is needed. So i think a cabal-install version build from source would be needed

mouse07410 commented 4 years ago

it seems a cabal-install version compiled against the Cabal library version shipped with ghc-8.10.1 is needed. So i think a cabal-install version build from source would be needed

Yes, I concur. The problem is that it doesn't seem to build from source, no matter what I tried. See https://github.com/haskell/cabal/issues/6615

mouse07410 commented 4 years ago

@jneira I build cabal-install 3.2.0.0 following your suggestions in https://github.com/haskell/cabal/issues/6615#issuecomment-605894368 , but attempt to build HIE still fails the same way:

$ cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library 
$ ./cabal-hie-install hie-8.10.1
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: fake-package-0 (user goal)
[__1] trying: base-4.14.0.0/installed-4.14.0.0 (dependency of fake-package)
[__2] trying: hie-install-0.8.1.0 (user goal)
[__3] trying: hie-install:-run-from-stack
[__4] next goal: cabal-install-parsers (dependency of hie-install
-run-from-stack)
[__4] rejecting: cabal-install-parsers-0.2 (conflict:
base==4.14.0.0/installed-4.14.0.0, cabal-install-parsers => base>=4.10 &&
<4.14)
[__4] skipping: cabal-install-parsers-0.1 (has the same characteristics that
caused the previous version to fail: excludes 'base' version 4.14.0.0)
[__4] fail (backjumping, conflict set: base, cabal-install-parsers,
hie-install, hie-install:run-from-stack)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, cabal-install-parsers,
hie-install, hie-install:run-from-stack, fake-package
Try running with --minimize-conflict-set to improve the error message.

$ $ ghc-pkg list base
/Users/ur20980/.ghcup/ghc/8.10.1/lib/ghc-8.10.1/package.conf.d
    base-4.14.0.0
$ 
jneira commented 4 years ago

From https://github.com/haskell/cabal/issues/6615#issuecomment-605998072 by @mouse07410

When I return to building HIE with ghc-8.10.1 support, what do I do for cabal.project-8.10.1? Do I keep the commit numbers specified in cabal.project-8.8.3, or do I comment them out to just use the master branches...?

Commits are for package versions needed to build hie with ghc-8.8.3, but not released publicly in hackage. It is probable that ghc-8.10.1 will need them or even a more recent commit with specific support for it.

mouse07410 commented 4 years ago

Understood, thanks. It looks like I have to wait for your cabal.project-8.10.1 before proceeding with HIE build.

Update

@jneira would you be able to look into this, please? As you see above, HIE build collapses because its build tree cannot be composed - GHC-8.10.1 has/needs base 4.14.0.0, while cabal-install-parsers require base < 4.14.

Also, I don't understand why I see hie-install:-run-from-stack in the error log:

$ ./cabal-hie-install hie-8.10.1
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: fake-package-0 (user goal)
[__1] trying: base-4.14.0.0/installed-4.14.0.0 (dependency of fake-package)
[__2] trying: hie-install-0.8.1.0 (user goal)
[__3] trying: hie-install:-run-from-stack
[__4] next goal: cabal-install-parsers (dependency of hie-install
-run-from-stack)
[__4] rejecting: cabal-install-parsers-0.2 (conflict:
base==4.14.0.0/installed-4.14.0.0, cabal-install-parsers => base>=4.10 &&
<4.14)
[__4] skipping: cabal-install-parsers-0.1 (has the same characteristics that
caused the previous version to fail: excludes 'base' version 4.14.0.0)
[__4] fail (backjumping, conflict set: base, cabal-install-parsers,
hie-install, hie-install:run-from-stack)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, cabal-install-parsers,
hie-install, hie-install:run-from-stack, fake-package
Try running with --minimize-conflict-set to improve the error message.
mouse07410 commented 4 years ago

@jneira from https://github.com/haskell/haskell-ide-engine/issues/1670#issuecomment-597302896

But stack did build hie-8.8.3, though it used ghc-8.8.2 for that. Does it mean that VS Code can use hie-8.8.3 for projects that require GHC-8.8.3?

I am afraid it does not. The hie version comes from yaml files using a convention: it assumes the version in the stack-${version}.yaml file name matches the ghc version of its resolver. So you could create a stack-666.yaml and the install script would create a hie-666 executable but the ghc will continue being the defined in the resolver.

Since it seems impossible now to build HIE for GHC-8.10.1 using Cabal - I want to get back to this.

I understand that stack would use whatever GHC is configured for the specified resolver. But what if I build HIE-8.10.1 using stack and GHC-8.8.3 (which currently works), and then use that HIE with Cabal projects configured for GHC-8.10.1? Would this work? Or is HIE only useful with projects that employ exactly the same GHC as the one HIE was built with?

jneira commented 4 years ago

Since it seems impossible now to build HIE for GHC-8.10.1 using Cabal - I want to get back to this.

Not sure if impossible but it needs that all hie transitive dependencies (and they are a lot) have a version compatible with ghc-8.10.1. You have to pin that version using git dependencies if it is not in hackage or pest maintainers/make pr's to add support for the obsolete ones

Lot of work, more now that ghc-8.10.1 is still hot.

I want to get back to this. (stack)

That is difficult too. There is no nightly snapshot using ghc-8.10.1 so you have to make a manual setup similar to cabal one.

Or is HIE only useful with projects that employ exactly the same GHC as the one HIE was built with?

I am afraid that it is the case. hie, unlike cabal, dependes heavily on ghc at compile time, so the executable binary built is different for each ghc version, so i would not recommend use hie from a different minor version (8.6 <> 8.8 <> 8.10)

mouse07410 commented 4 years ago

I would not recommend use hie from a different minor version (8.6 <> 8.8 <> 8.10)

I hear you, and understand all the difficulties you mentioned. :-(

Still, as there are only two options: (a) constrain to use ghc-8.8.3 only, or (b) try to use hie-8.10.1 which in fact is hie-8.8.3 because it was built with GHC-8.8.3 with projects and hope nothing big would break.

If, while all the above issues are being rectified (which probably would take some time!), I want to pursue the (b) - what consequences or pitfalls should I be looking for? Would HIE just refuse to work or break in every trivial case? Or would it be unable to recognize and deal properly with GHC 8.10.1 unique extensions, but otherwise be quite sane/usable?

fendor commented 4 years ago

Depending on changes in HsExpr(which I am not aware of), the parsing of modules could break. If there was any ABI changes, the breaks will be unpredictable. Changes in boot libs, such as array, base, containers, Cabal, etc... could cause trouble in some weird way. HIE itself will not refuse to work, though. I dont think we really experimented if HIE behaves sanely for a different major version.

mouse07410 commented 4 years ago

After installing the current cabal-3.2.0.0 I tried to build the current HIE master (with system default GHC 8.8.3).

First, it fails to build some documentation. But regardless, it seems to fail in Shake?

$ ./cabal-hie-install hie-8.10.1
Warning: Parsing the index cache failed (Data.Binary.Get.runGet at position
16: Non-matching structured hashes: 0210baca000000007727865e00000000;
expected: a257ca064dfb5e0cb74f74e64a975b9e). Trying to regenerate the index
cache...
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - dlist-0.8.0.8 (lib) (requires download & build)
 - aeson-1.4.7.1 (lib) (requires build)
 - binary-instances-1.0.0.1 (lib) (requires build)
 - cabal-install-parsers-0.2 (lib) (requires build)
 - hie-install-0.8.1.0 (lib) (cannot read state cache)
 - fake-package-0 (exe:script) (cannot read state cache)
Downloading  dlist-0.8.0.8
Downloaded   dlist-0.8.0.8
Starting     dlist-0.8.0.8 (lib)
Building     dlist-0.8.0.8 (lib)
Haddock      dlist-0.8.0.8 (lib)
Installing   dlist-0.8.0.8 (lib)
Completed    dlist-0.8.0.8 (lib)
. . . . .
Completed    cabal-install-parsers-0.2 (lib)
Configuring library for hie-install-0.8.1.0..
Preprocessing library for hie-install-0.8.1.0..
Building library for hie-install-0.8.1.0..
[7 of 8] Compiling Cabal            ( src/Cabal.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Cabal.o ) [Cabal.Config changed]
[8 of 8] Compiling HieInstall       ( src/HieInstall.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/HieInstall.o ) [Cabal changed]
Preprocessing library for hie-install-0.8.1.0..
Running Haddock on library for hie-install-0.8.1.0..
Haddock coverage:
Warning: 'stack' is out of scope.
    If you qualify the identifier, haddock can try to link it anyway.
Warning: 'ghc' is out of scope.
    If you qualify the identifier, haddock can try to link it anyway.
Warning: 'cabal' is out of scope.
    If you qualify the identifier, haddock can try to link it anyway.
  25% (  1 /  4) in 'HieInstall'
  Missing documentation for:
    Module header
    defaultMain (src/HieInstall.hs:14)
    buildIcuMacosFix (src/HieInstall.hs:98)
Warning: HieInstall: could not find link destinations for:
    VersionNumber
Documentation created:
/Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/doc/html/hie-install/index.html
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main             ( Main.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )
Linking /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script ...
Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-2524b75f:Development.Shake.Internal.Args
* Depends on: hie-8.10.1
  at error, called at src/Development/Shake/Internal/Rules/File.hs:179:58 in shk-0.18.5-2524b75f:Development.Shake.Internal.Rules.File
* Raised the exception:
Error, file does not exist and no rule available:
  hie-8.10.1

How do I address this? Or until there's a 8.10.1 resolver it's just impossible?

jneira commented 4 years ago

Hi! It seems documentation generation is enabled in some config file and it is failing when compiling the script that is gonna install hie (so hie intall does not even start): check your %STACK_ROOT%\config.yaml and ./install/shake.yaml. I guess in the last one :wink:

Otoh, you dont have to use ghc-8.8.3 in shake.yaml if you dont want. The install script haskell code does not depend on ghc version and the executable that it is created when compiled is the responsible in turn of compiling hie using stack and one of the main resolvers file.

mouse07410 commented 4 years ago

documentation generation is enabled in some config file and it is failing when compiling the script that is gonna install hie (so hie install does not even start): check your . . . ./install/shake.yaml

The problem does seem to be with Shake - but (a) I don't know what to add-to/remove-from shake.yaml to address the doc problem, and (b) the build failure seems to happen because of version disagreement between template-haskell and cabal-helper:

$ time ./cabal-hie-install hie-8.10.1 --disable-documentation
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - hie-install-0.8.1.0 (lib) (configuration changed)
 - fake-package-0 (exe:script) (configuration changed)
Configuring library for hie-install-0.8.1.0..
Preprocessing library for hie-install-0.8.1.0..
Building library for hie-install-0.8.1.0..
[2 of 8] Compiling Print            ( src/Print.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Print.o ) [Development.Shake changed]
[4 of 8] Compiling Stack            ( src/Stack.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Stack.o ) [Development.Shake.FilePath changed]
. . . . .
Options:
    Verbosity level: Info
# cabal (for hie-8.10.1)
# cabal (for hie-8.10.1)
cabal: Could not resolve dependencies:
[__0] trying: cabal-helper-1.0.0.0 (user goal)
[__1] next goal: template-haskell (dependency of cabal-helper)
[__1] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0 (conflict:
cabal-helper => template-haskell<2.16 && >=2.11.1.0)
[__1] rejecting: template-haskell-2.15.0.0, template-haskell-2.14.0.0,
template-haskell-2.13.0.0, template-haskell-2.12.0.0,
template-haskell-2.11.1.0, template-haskell-2.11.0.0,
template-haskell-2.10.0.0, template-haskell-2.9.0.0, template-haskell-2.8.0.0,
template-haskell-2.7.0.0, template-haskell-2.6.0.0, template-haskell-2.5.0.0,
template-haskell-2.4.0.1, template-haskell-2.4.0.0, template-haskell-2.3.0.1,
template-haskell-2.3.0.0, template-haskell-2.2.0.0 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: cabal-helper, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cabal-helper, template-haskell

Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-61e1ad34:Development.Shake.Internal.Args
* Depends on: hie-8.10.1
  at command, called at src/Cabal.hs:28:13 in hie-install-0.8.1.0-inplace:Cabal
* Raised the exception:
Development.Shake.command, system command failed
Command line: cabal v2-install -w /Users/ur20980/.ghcup/bin/ghc-8.10.1 --write-ghc-environment-files=never --installdir /Users/ur20980/.cabal/bin --max-backjumps=5000 exe:hie exe:hie-wrapper --overwrite-policy=always --project-file=cabal.project-8.10.1 -v1
Exit code: 1
Stderr:
cabal: Could not resolve dependencies:
[__0] trying: cabal-helper-1.0.0.0 (user goal)
[__1] next goal: template-haskell (dependency of cabal-helper)
[__1] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0 (conflict:
cabal-helper => template-haskell<2.16 && >=2.11.1.0)
[__1] rejecting: template-haskell-2.15.0.0, template-haskell-2.14.0.0,
template-haskell-2.13.0.0, template-haskell-2.12.0.0,
template-haskell-2.11.1.0, template-haskell-2.11.0.0,
template-haskell-2.10.0.0, template-haskell-2.9.0.0, template-haskell-2.8.0.0,
template-haskell-2.7.0.0, template-haskell-2.6.0.0, template-haskell-2.5.0.0,
template-haskell-2.4.0.1, template-haskell-2.4.0.0, template-haskell-2.3.0.1,
template-haskell-2.3.0.0, template-haskell-2.2.0.0 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: cabal-helper, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cabal-helper, template-haskell

real    0m13.921s
user    0m10.029s
sys 0m2.550s

Update

This happens with

$ time ./cabal-hie-install hie-8.10.1 --allow-newer --allow-older
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - hie-install-0.8.1.0 (lib) (configuration changed)
 - fake-package-0 (exe:script) (configuration changed)
Configuring library for hie-install-0.8.1.0..
Preprocessing library for hie-install-0.8.1.0..
Building library for hie-install-0.8.1.0..
[2 of 8] Compiling Print            ( src/Print.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Print.o ) [Development.Shake changed]
[4 of 8] Compiling Stack            ( src/Stack.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Stack.o ) [Development.Shake.FilePath changed]
. . . . .
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main             ( Main.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )
Linking /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script ...
# cabal (for check)
# git (for submodules)
# git (for submodules)
Options:
    Verbosity level: Info
# cabal (for hie-8.10.1)
# cabal (for hie-8.10.1)
cabal: Could not resolve dependencies:
[__0] trying: cabal-helper-1.0.0.0 (user goal)
[__1] next goal: template-haskell (dependency of cabal-helper)
[__1] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0 (conflict:
cabal-helper => template-haskell<2.16 && >=2.11.1.0)
[__1] rejecting: template-haskell-2.15.0.0, template-haskell-2.14.0.0,
template-haskell-2.13.0.0, template-haskell-2.12.0.0,
template-haskell-2.11.1.0, template-haskell-2.11.0.0,
template-haskell-2.10.0.0, template-haskell-2.9.0.0, template-haskell-2.8.0.0,
template-haskell-2.7.0.0, template-haskell-2.6.0.0, template-haskell-2.5.0.0,
template-haskell-2.4.0.1, template-haskell-2.4.0.0, template-haskell-2.3.0.1,
template-haskell-2.3.0.0, template-haskell-2.2.0.0 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: cabal-helper, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cabal-helper, template-haskell

Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-2524b75f:Development.Shake.Internal.Args
* Depends on: hie-8.10.1
  at command, called at src/Cabal.hs:28:13 in hie-install-0.8.1.0-inplace:Cabal
* Raised the exception:
Development.Shake.command, system command failed
Command line: cabal v2-install -w /Users/ur20980/.ghcup/bin/ghc-8.10.1 --write-ghc-environment-files=never --installdir /Users/ur20980/.cabal/bin --max-backjumps=5000 exe:hie exe:hie-wrapper --overwrite-policy=always --project-file=cabal.project-8.10.1 -v1
Exit code: 1
Stderr:
cabal: Could not resolve dependencies:
[__0] trying: cabal-helper-1.0.0.0 (user goal)
[__1] next goal: template-haskell (dependency of cabal-helper)
[__1] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0 (conflict:
cabal-helper => template-haskell<2.16 && >=2.11.1.0)
[__1] rejecting: template-haskell-2.15.0.0, template-haskell-2.14.0.0,
template-haskell-2.13.0.0, template-haskell-2.12.0.0,
template-haskell-2.11.1.0, template-haskell-2.11.0.0,
template-haskell-2.10.0.0, template-haskell-2.9.0.0, template-haskell-2.8.0.0,
template-haskell-2.7.0.0, template-haskell-2.6.0.0, template-haskell-2.5.0.0,
template-haskell-2.4.0.1, template-haskell-2.4.0.0, template-haskell-2.3.0.1,
template-haskell-2.3.0.0, template-haskell-2.2.0.0 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: cabal-helper, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cabal-helper, template-haskell

real    0m15.073s
user    0m10.994s
sys 0m2.721s
jneira commented 4 years ago

Sorry, i forgot you are building with cabal and no with stack, shake.yaml is not involved in the building of the install script executable at all but ./install/shake.project and ~\cabal\config. And the messages about docs are in fact warnings, the real error was:

Error, file does not exist and no rule available:
  hie-8.10.1

However from the last logs we can see that the building of the script itself is succesful:

Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main             ( Main.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )
Linking /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script ...

And it is the building of hie triggered by that executable which is failing now (so somewhat you manage to avoid the first error, creating a stack-8.10.1.yaml i guess)

Well, i am afraid that you are hitting one of the problems of using a recent ghc: it ships with a set of libraries with fixed versions, one of them is template-haskell. Last cabal-helper released version (and master i guess) does not support that template-haskell version so it does not support in fact ghc-8.10.1 and should be patched.

mouse07410 commented 4 years ago

i am afraid that you are hitting one of the problems of using a recent ghc: it ships with a set of libraries with fixed versions, one of them is template-haskell.

Yes, that seems to be it.

Last cabal-helper released version (and master i guess) does not support that template-haskell version so it does not support in fact ghc-8.10.1 and should be patched.

Yes... I think you're maintaining a fork of cabal-helper? If so, can you patch it...?

P.S. Currently-released cabal-install seems to be 3.2.0.0.

jneira commented 4 years ago

Yes... I think you're maintaining a fork of cabal-helper? If so, can you patch it...?

Well, i am afraid we are busy with other issues and projects (hls f.e.) and i think we should add proper support for ghc-8.8.3 here first.

mouse07410 commented 4 years ago

... I think we should add proper support for ghc-8.8.3 here first ...

Yeah... I didn't realize 8.8.3 support wasn't fully done yet... BTW, any timeframe/plan you could share?

jneira commented 4 years ago

We are working on this, no timeframes, sorry. 😺 For ghc-8.10.1, after get deps to work with that version we surely will have to patch hie itself and i am afraid that changes will not be trivial. For reference the changes needed in hlint and ghcide had been:

mouse07410 commented 4 years ago

Are we closer to resolving this now that Stack has GHC-8.10.1 resolvers (nightly)?

mouse07410 commented 4 years ago

@jneira ? ;-)

jneira commented 3 years ago

Well, the major dev effort is being put in haskell-language-server and ghcide nowadays. I am working in add hlint support for hls myself, for example. A pull request to add ghc-8.10.1 support will be very welcomed but no one is working in that, afaik. @mouse07410 have you considered switch to any of both tools?

mouse07410 commented 3 years ago

the major dev effort is being put in haskell-language-server and ghcide nowadays. I am working in add hlint support for hls myself, for example. @mouse07410 have you considered switch to any of both tools?

I know nothing about haskell-language-server. Is it a complete replacement for HIE, and if not equally mature, then at least supports all the features of HIE now? If so, how do I build/install/use it with VS Code? It doesn't look like haskell-language-server is in a good shape:

$ git clone https://github.com/haskell/haskell-language-server --recurse-submodules
Cloning into 'haskell-language-server'...
remote: Enumerating objects: 2026, done.
remote: Total 2026 (delta 0), reused 0 (delta 0), pack-reused 2026
Receiving objects: 100% (2026/2026), 453.12 KiB | 1.27 MiB/s, done.
Resolving deltas: 100% (1141/1141), done.
Submodule 'ghcide' (https://github.com/wz1000/ghcide.git) registered for path 'ghcide'
Cloning into '/Users/ur20980/src/haskell-language-server/ghcide'...
remote: Enumerating objects: 58, done.        
remote: Counting objects: 100% (58/58), done.        
remote: Compressing objects: 100% (38/38), done.        
remote: Total 7644 (delta 21), reused 31 (delta 9), pack-reused 7586        
Receiving objects: 100% (7644/7644), 2.30 MiB | 25.62 MiB/s, done.
Resolving deltas: 100% (4362/4362), done.
Submodule path 'ghcide': checked out '747ec1401c62257ec849319eb2dda966a8008b09'
$ cd haskell-language-server/
$ git submodule update --init --recursive
$ time ./cabal-hls-install hls
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - base16-bytestring-0.1.1.7 (lib) (requires download & build)
 - cabal-doctest-1.0.8 (lib) (requires build)
 - cryptohash-sha256-0.11.101.0 (lib) (requires build)
 - dlist-0.8.0.8 (lib) (requires build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - unordered-containers-0.2.11.0 (lib) (requires build)
 - scientific-0.3.6.2 (lib) (requires build)
 - splitmix-0.1 (lib) (requires download & build)
 - tar-0.5.1.1 (lib) (requires build)
 - vector-binary-instances-0.2.5.1 (lib) (requires build)
 - extra-1.7.3 (lib) (requires build)
 - distributive-0.6.2 (lib:distributive) (requires build)
internal error in InstallPlan.completed: not in configured state: Installed lkk-0.1.1.2-5c05fa72
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:260:25 in main:Distribution.Client.InstallPlan
  internalError, called at ./Distribution/Client/InstallPlan.hs:656:26 in main:Distribution.Client.InstallPlan

real    0m2.887s
user    0m1.655s
sys 0m0.453s

Update

Documented the failure in https://github.com/haskell/haskell-language-server/issues/194 - as you see, at this time there's nothing to switch to, as I'm not crazy about debugging IDE. My skills at this time are tested/pushed enough debugging simple/trivial code that I write (in small quantities ;).

ghcide is very promising, but not nearly mature enough for me to consider it - and as I understand, not nearly feature-complete enough. It would probably take more than a year for it to become usable for a "normal" developer. Please correct me if I'm wrong.

A pull request to add ghc-8.10.1 support will be very welcomed but no one is working in that, afaik.

As I've already told more than once, I'm not nearly enough proficient in Haskell to even consider making a PR, especially of such complexity. But, given the maturity level of the two new projects, I'd say it would serve the user community (as opposed to the community of experimenters living on the bleeding edge) if the mature and already-working package (HIE) carried on, at least until a viable replacement is there.

jneira commented 3 years ago

Mmm, it is the first time i've seen that build error, thanks for opening the issue in the hls issue tracker. haskell-language-server is using ghcide underneath as core and adds it a plugin system to be able to include features in a flexible way. The goal is to reach the feature level of hie as soon as possible (being, like hie, an open source project not directly supported economically for any company) I agree that would be great to keep hie on track with ghc releases (a new one is coming!) but simply there is no enough manpower to acomplish it.

mouse07410 commented 3 years ago

(being, like hie, an open source project not directly supported economically for any company)

I agree that would be great to keep hie on track with ghc releases (a new one is coming!) but simply there is no enough manpower to accomplish it.

That's the problem with the Haskell ecosystem in general, compared to other open source environments like Rust, Java, or C/C++ (listed in order of increasing support/stability). Stephen Diehl described it quite eloquently (I won't try to butcher his statement).

I realize there isn't a lot of people or money thrown onto Haskell development (behind Rust are companies like Mozilla and even Microsoft), but it's been around for at least 20+ years - seemingly enough time to stabilize enough to produce a decent stable IDE that doesn't become obsolete with the next minor version change of the compiler...?

mouse07410 commented 3 years ago

I'd like to take back some of what I said - it appears that haskell-language-server does work, so it is a viable replacement for HIE; and it seems to support GHC-8.10.1 out-of-box.

I wonder what HIE features are still missing from haskell-language-server.

jneira commented 3 years ago

I wonder what HIE features are still missing from haskell-language-server.

There are several issues in hls about translating hie plugins (hlint, hoogle, etc) and new ones. Main features are supported though.