haskell / haskell-ide-engine

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

Support for ghc-8.8.3 #1670

Closed jneira closed 4 years ago

jneira commented 4 years ago
jneira commented 4 years ago
jneira commented 4 years ago

Link to failing tests in my local windows: https://gist.github.com/jneira/9bf777438bc0adbd5d6ba1e9be9350bf

fendor commented 4 years ago

It looks like all these bugs have a common root. Not finding the context implies some problem with the typechecked module, or parsed source or something. However, since the diagnostics work I suspect the latter.

FirstLoveLife commented 4 years ago

Hi, hie newbiee here.

8.8.3 is already in homebrew. Hope to see hie support of ghc 8.8.3 soon. arch linux has also updated to 8.8.3 one week ago, maybe that's why hie is not work properly on my emacs.

mouse07410 commented 4 years ago

I'm trying to build on MacOS Catalina 10.15.3 - the build fails:

$ ./cabal-hie-install 8.8.3
. . . . .
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]
[5 of 8] Compiling Env              ( src/Env.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Env.o ) [Control.Monad.Extra changed]
[6 of 8] Compiling Help             ( src/Help.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Help.o ) [Development.Shake changed]
[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 ) [Development.Shake changed]
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-7343d784:Development.Shake.Internal.Args
* Depends on: 8.8.3
  at error, called at src/Development/Shake/Internal/Rules/File.hs:179:58 in shk-0.18.5-7343d784:Development.Shake.Internal.Rules.File
* Raised the exception:
Error, file does not exist and no rule available:
  8.8.3

Any help?

Update

stack built hie-8.8.3 using ghc-8.8.2:

$ hie-8.8.3 --version
Version 1.2, Git revision ee5b98c6bd3610ff90cb5373608a09c5813dcb69 (dirty) (3829 commits) x86_64 ghc-8.8.2

And this probably means it's working?

$ hie --dry-run
Running HIE(hie)
  Version 1.2, Git revision ee5b98c6bd3610ff90cb5373608a09c5813dcb69 (dirty) (3829 commits) x86_64 ghc-8.8.2
To run as a LSP server on stdio, provide the '--lsp' argument
Current directory:/Users/ur20980/src/Str2Split

args:["--dry-run"]

Looking for project config cradle...

2020-03-09 15:47:12.710334 [ThreadId 4] - Module "/Users/ur20980/src/Str2Split/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/ur20980/src/Str2Split", cradleOptsProg = CradleAction: Stack}
2020-03-09 15:47:12.710849 [ThreadId 4] - Executing Stack GHC with args: --numeric-version
2020-03-09 15:47:12.965875 [ThreadId 4] - Executing Stack GHC with args: --print-libdir

###################################################

Cradle: Stack project
Project Ghc version: 8.8.2
Libdir: Just "/Users/ur20980/.ghcup/ghc/8.8.2/lib/ghc-8.8.2"
Searching for Haskell source files...
Found 4 Haskell source files.

###################################################

Found the following files:

/Users/ur20980/src/Str2Split/Setup.hs
/Users/ur20980/src/Str2Split/app/Main.hs
/Users/ur20980/src/Str2Split/test/Spec.hs
/Users/ur20980/src/Str2Split/src/Lib.hs

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
$ 
jneira commented 4 years ago

@mouse07410 the command should be cabal-hie-install hie-8.8.3, you can check available targets with cabal-hie-install help. Let us know if the help info is not clear enough.

mouse07410 commented 4 years ago
$ ./cabal-hie-install help
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]
[5 of 8] Compiling Env              ( src/Env.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Env.o ) [Control.Monad.Extra changed]
[6 of 8] Compiling Help             ( src/Help.hs, /Users/ur20980/src/haskell-ide-engine/dist-newstyle/build/x86_64-osx/ghc-8.8.3/hie-install-0.8.1.0/build/Help.o ) [Development.Shake changed]
[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 ) [Development.Shake 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 ...

Usage:
    stack install.hs <target> [options]
    or
    cabal v2-run install.hs --project-file install/shake.project -- <target> [options]

Targets:
    help                Show help message including all targets

    hie                 Install hie with the latest available GHC and the data files
    latest              Install hie with the latest available GHC
    data                Get the required data-files for `hie` (Hoogle DB)
    hie-8.6.5           Install hie for GHC version 8.6.5
    hie-8.8.2           Install hie for GHC version 8.8.2
    hie-8.8.3           Install hie for GHC version 8.8.3

    ghcs                Show all GHC versions that can be installed via `cabal-build`.

    icu-macos-fix       Fixes icu related problems in MacOS

Options:
    -j[N], --jobs[=N]   Allow N jobs/threads at once [default number of CPUs].
    -s, --silent        Don't print anything.
    -q, --quiet         Print less (pass repeatedly for even less).
    -V, --verbose       Print more (pass repeatedly for even more).

Build completed in 0.01s

$ 

will update this with the results when the build (./cabal-hie-install hie-8.8.3) completes.

Build failed:

$ ./cabal-hie-install hie-8.8.3
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - fake-package-0 (exe:script) (configuration changed)
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 ...
# cabal (for check)
# git (for submodules)
# git (for submodules)
Options:
    Verbosity level: Info
# cabal (for hie-8.8.3)
# cabal (for hie-8.8.3)
Wrote tarball sdist to
/Users/ur20980/src/haskell-ide-engine/dist-newstyle/sdist/haskell-ide-engine-1.2.tar.gz
Wrote tarball sdist to
/Users/ur20980/src/haskell-ide-engine/dist-newstyle/sdist/hie-plugin-api-1.2.tar.gz
Wrote tarball sdist to
/Users/ur20980/src/haskell-ide-engine/dist-newstyle/sdist/cabal-helper-1.0.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - io-storage-0.3 (lib:io-storage) (requires build)
 - Diff-0.4.0 (lib) (requires build)
 - SHA-1.6.4.4 (lib) (requires build)
 - StateVar-1.2 (lib) (requires build)
 - blaze-builder-0.4.1.0 (lib) (requires build)
. . . . .
Haddock      ghc-lib-parser-8.8.3.20200224 (lib)
Installing   ghc-lib-parser-8.8.3.20200224 (lib)
Completed    ghc-lib-parser-8.8.3.20200224 (lib)

Failed to build haddock-api-2.23.0.
Build log ( /Users/ur20980/.cabal/logs/ghc-8.8.3/hddck-p-2.23.0-57635026.log
):
Configuring library for haddock-api-2.23.0..
Preprocessing library for haddock-api-2.23.0..
Building library for haddock-api-2.23.0..
[ 1 of 40] Compiling Haddock.Backends.HaddockDB ( src/Haddock/Backends/HaddockDB.hs, dist/build/Haddock/Backends/HaddockDB.o )
[ 2 of 40] Compiling Haddock.Backends.Hyperlinker.Types ( src/Haddock/Backends/Hyperlinker/Types.hs, dist/build/Haddock/Backends/Hyperlinker/Types.o )
[ 3 of 40] Compiling Haddock.Backends.Xhtml.Types ( src/Haddock/Backends/Xhtml/Types.hs, dist/build/Haddock/Backends/Xhtml/Types.o )
[ 4 of 40] Compiling Haddock.Syb      ( src/Haddock/Syb.hs, dist/build/Haddock/Syb.o )
[ 5 of 40] Compiling Haddock.Types    ( src/Haddock/Types.hs, dist/build/Haddock/Types.o )
[ 6 of 40] Compiling Haddock.Parser   ( src/Haddock/Parser.hs, dist/build/Haddock/Parser.o )
[ 7 of 40] Compiling Haddock.ModuleTree ( src/Haddock/ModuleTree.hs, dist/build/Haddock/ModuleTree.o )
[ 8 of 40] Compiling Haddock.Interface.Specialize ( src/Haddock/Interface/Specialize.hs, dist/build/Haddock/Interface/Specialize.o )
[ 9 of 40] Compiling Haddock.Interface.ParseModuleHeader ( src/Haddock/Interface/ParseModuleHeader.hs, dist/build/Haddock/Interface/ParseModuleHeader.o )
[10 of 40] Compiling Haddock.Interface.LexParseRn ( src/Haddock/Interface/LexParseRn.hs, dist/build/Haddock/Interface/LexParseRn.o )
[11 of 40] Compiling Haddock.GhcUtils ( src/Haddock/GhcUtils.hs, dist/build/Haddock/GhcUtils.o )
[12 of 40] Compiling Haddock.Interface.Rename ( src/Haddock/Interface/Rename.hs, dist/build/Haddock/Interface/Rename.o )
[13 of 40] Compiling Haddock.Backends.Hyperlinker.Parser ( src/Haddock/Backends/Hyperlinker/Parser.hs, dist/build/Haddock/Backends/Hyperlinker/Parser.o )
[14 of 40] Compiling Haddock.Convert  ( src/Haddock/Convert.hs, dist/build/Haddock/Convert.o )

src/Haddock/Convert.hs:621:39: error:
    • Variable not in scope: injectiveVarsOfBinder :: TyConBinder -> FV
    • Perhaps you meant ‘injectiveVarsOfType’ (imported from TyCoRep)
    |
621 |                            mapUnionFV injectiveVarsOfBinder dropped_binders
    |                                       ^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build haddock-api-2.23.0 (which is required by exe:hie from
haskell-ide-engine-1.2 and exe:hie-wrapper from haskell-ide-engine-1.2). See
the build log above for details.

Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-78bc9188:Development.Shake.Internal.Args
* Depends on: hie-8.8.3
  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.8.3 --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 -v1
Exit code: 1
Stderr:
cabal: Failed to build haddock-api-2.23.0 (which is required by exe:hie from
haskell-ide-engine-1.2 and exe:hie-wrapper from haskell-ide-engine-1.2). See
the build log above for details.
mouse07410 commented 4 years ago

Also, I'm surprised that even when explicitly specifying building for ghc-8.8.3 and having ghc-8.8.3 the system default, stack still seems to have built hie with ghc-8.8.2:

$ stack ./install.hs hie-8.8.3
# stack (for check)
# git (for submodules)
# git (for submodules)
Options:
    Verbosity level: Info
# stack (for hie-8.8.3)
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Copying from /Users/ur20980/src/haskell-ide-engine/.stack-work/install/x86_64-osx/22ab76dd0602426768f3f9456fbe043d018a7a8f4d8bb38928967d7287145f92/8.8.2/bin/hie to /Users/ur20980/.local/bin/hie
Copying from /Users/ur20980/src/haskell-ide-engine/.stack-work/install/x86_64-osx/22ab76dd0602426768f3f9456fbe043d018a7a8f4d8bb38928967d7287145f92/8.8.2/bin/hie-wrapper to /Users/ur20980/.local/bin/hie-wrapper

Copied executables to /Users/ur20980/.local/bin:
- hie
- hie-wrapper
# stack (for hie-8.8.3)
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Build completed in 1.21s

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
$ ghcup list
Available versions:
✗ ghc   7.10.3  7.10
✗ ghc   8.0.2   8.0
✗ ghc   8.2.2   8.2
✗ ghc   8.4.1
✗ ghc   8.4.2
✗ ghc   8.4.3
✗ ghc   8.4.4   8.4
✗ ghc   8.6.1   bad
✗ ghc   8.6.2
✗ ghc   8.6.3
✗ ghc   8.6.4
✔ ghc   8.6.5   recommended,8.6
✗ ghc   8.8.1
✔ ghc   8.8.2
✔ ghc   8.8.3   latest,8.8 [in blue]
$ 
jneira commented 4 years ago

stack still seems to have built hie with ghc-8.8.2

I think this is a bug in the stack output, you can check the real version with hie --version

As hie is not fully supporting ghc-8.3.3 we still have not added a cabal.project-8.8.3 and that is the reason for the failed build with cabal-hie-install hie-8.8.3. Try cp cabal.project-8.8.2 cabal.project-8.8.3 and the build may be successful.

mouse07410 commented 4 years ago

stack still seems to have built hie with ghc-8.8.2

I think this is a bug in the stack output, you can check the real version with hie --version

I'm afraid stack output is correct:

$ type hie
hie is /Users/ur20980/.local/bin/hie
$ type hie-8.8.3
hie-8.8.3 is /Users/ur20980/.local/bin/hie-8.8.3
$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
$ hie --version
Version 1.2, Git revision ee5b98c6bd3610ff90cb5373608a09c5813dcb69 (dirty) (3829 commits) x86_64 ghc-8.8.2
$ hie-8.8.3 --version
Version 1.2, Git revision ee5b98c6bd3610ff90cb5373608a09c5813dcb69 (dirty) (3829 commits) x86_64 ghc-8.8.2
$ type ghc
ghc is /Users/ur20980/.ghcup/bin/ghc
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
$ 

Also, from the following output in my small sample project directory it seems clear that stack uses 8.8.2, no matter what:

$ ls -R .stack-work | fgrep 8.8.3
$ ls -R .stack-work | fgrep 8.8.2
libHSStr2Split-0.1.0.0-2eOuLbeNvAA1cmgGTGD6DW-ghc8.8.2.dylib
8.8.2
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2:
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/bin:
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/doc:
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/doc/Str2Split-0.1.0.0:
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/lib:
x86_64-osx-ghc-8.8.2
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/lib/x86_64-osx-ghc-8.8.2:
libHSStr2Split-0.1.0.0-2eOuLbeNvAA1cmgGTGD6DW-ghc8.8.2.dylib
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/lib/x86_64-osx-ghc-8.8.2/Str2Split-0.1.0.0-2eOuLbeNvAA1cmgGTGD6DW:
.stack-work/install/x86_64-osx/a9cf3cc2cddd3cc7bddda2de466f06e3510275e1f229024b61ba5e90415b5b40/8.8.2/pkgdb:

It's not a bug in the output - it's the compiler that stack picked. I'm trying to understand why (adding screenshot, as only the color tells which of the installed compilers is set as default):

Screen Shot 2020-03-09 at 21 54 36
mouse07410 commented 4 years ago

Try cp cabal.project-8.8.2 cabal.project-8.8.3 and the build may be successful.

Unfortunately, it isn't: See below

$ ./cabal-hie-install hie-8.8.3
. . . . .
Completed    haskell-lsp-types-0.20.0.0 (lib)
Starting     haskell-lsp-0.20.0.1 (lib)
Building     haskell-lsp-0.20.0.1 (lib)
Haddock      haskell-lsp-0.20.0.1 (lib)
Installing   haskell-lsp-0.20.0.1 (lib)
Completed    haskell-lsp-0.20.0.1 (lib)
Starting     hie-plugin-api-1.2 (lib)
Building     hie-plugin-api-1.2 (lib)
Haddock      hie-plugin-api-1.2 (lib)
Warning: Failed to build documentation for hie-plugin-api-1.2 (which is
Symlinking 'hie-wrapper'
required by exe:hie from haskell-ide-engine-1.2 and exe:hie-wrapper from
haskell-ide-engine-1.2).
Symlinking 'hie'
Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-78bc9188:Development.Shake.Internal.Args
* Depends on: hie-8.8.3
* Raised the exception:
/Users/ur20980/.cabal/bin/hie: copyFile:atomicCopyFileContents:withReplacementFile:copyFileToHandle:openBinaryFile: does not exist (No such file or directory)

Update

After removing documentation: True from the ~/.cabal/config file, the build with Cabal succeeded, but again, using GHC-8.8.2 instead of 8.8.3:

. . . . .
Completed    haskell-ide-engine-1.2 (exe:hie-wrapper)
Installing   haskell-ide-engine-1.2 (exe:hie)
Completed    haskell-ide-engine-1.2 (exe:hie)
Symlinking 'hie-wrapper'
Symlinking 'hie'
Copied executables hie-wrapper, hie, hie-8.8 and hie-8.8.3 to /Users/ur20980/.cabal/bin
Build completed in 9m27s

$ hie-8.8.3 --version
Version 1.2, Git revision ee5b98c6bd3610ff90cb5373608a09c5813dcb69 (dirty) (3829 commits) x86_64 ghc-8.8.2
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
$ 

???

jneira commented 4 years ago

Weird indeed, could you double check that the hie-8.8.3 executed is the one from cabal and no from stack? With /Users/ur20980/.cabal/bin/hie-8.8.3 --version, f.e. Executables from cabal usually does not have the git revision (at least for me, in windows):

PS D:\dev\ws\haskell\ghcide> hie-8.8.3 --version
Version 1.1 x86_64 ghc-8.8.3

And for stack, it does not use the ghc on path by default but it downloads and uses a sandboxed one. You have to use a stack.yaml that explicitly states that want to use that ghc version (with the resolver field). It turns out that there is no resolver in stackage that uses ghc-8.8.3 yet. Is possible you created a stack-8.8.3.yaml (needed to install hie with that version with stack install.hs hie-8.8.3) from the default stack.yamlor stack-8.8.2.yaml but you did not change the resolver? or did you use another way to install hie via stack?

The output of stack install.hs hie-8.8.3 with no stack-8.8.3.yaml for me is:

D:\ws\haskell\haskell-ide-engine>stack install.hs hie-8.8.3
Error when running Shake build system:
  at want, called at src\Development\Shake\Internal\Args.hs:83:69 in shake-0.18.
5-9E0S8BrSRaT9A5NJsfNgQQ:Development.Shake.Internal.Args
* Depends on: hie-8.8.3
  at error, called at src\Development\Shake\Internal\Rules\File.hs:179:58 in sha
ke-0.18.5-9E0S8BrSRaT9A5NJsfNgQQ:Development.Shake.Internal.Rules.File
* Raised the exception:
Error, file does not exist and no rule available:
  hie-8.8.3

and the target hie-8.8.3 is no listed when you do a stack install.hs help if you dont have a stack-8.8.3.yaml

mouse07410 commented 4 years ago

Weird indeed, could you double check that the hie-8.8.3 executed is the one from cabal and no from stack?

Darn, you're right!

$ ~/.cabal/bin/hie-8.8.3 --version
Version 1.2 x86_64 ghc-8.8.3

Is it possible that you created a stack-8.8.3.yaml (needed to install hie with that version with stack install.hs hie-8.8.3) from the default stack.yaml or stack-8.8.2.yaml but you did not change the resolver?

Well, sort of... I copied stack-8.8.2.yaml to stack-8.8.3.yaml and changed the resolver to lts-15.3:

$ hie-8.8.3 --version
Version 1.2, Git revision ee5b98c6bd3610ff90cb5373608a09c5813dcb69 (dirty) (3829 commits) x86_64 ghc-8.8.2
$ ll stack-8.8.3.yaml
-rw-r--r--  1 ur20980  MITLL\Domain Users  1061 Mar  9 22:00 stack-8.8.3.yaml
$ head stack-8.8.3.yaml
resolver: lts-15.3
packages:
- .
- hie-plugin-api

extra-deps:
# - ./submodules/HaRe

- apply-refact-0.7.0.0
- brittany-0.12.1.1

What should the resolver be set to for this build in stack-8.8.3.yaml?

And for stack, it does not use the ghc on path by default but it downloads and uses a sandboxed one.

But... my ~/.stack/config defines

$ head -20 ~/.stack/config.yaml 
. . . . .

system-ghc: true
skip-ghc-check: true
. . . . .

Do you have any idea why stack also appears to build my own sample project with GHC-8.8.2 instead of GHC-8.8.3?

jneira commented 4 years ago

Well, lts-15.3 is for ghc-8.8.2 so using that resolver makes stack ignore the system ghc-8.8.3 (cause versions dont match). There is no lts nor nightly resolver for ghc-8.8.3 right now so the unique way i can think of is set

resolver: ghc-8.8.3
system-ghc: true
skip-ghc-check: true

(system-ghc and skip-ghc-check could be in the global config)

jneira commented 4 years ago

@FirstLoveLife well maybe it might be another root cause, have you tried another ghc version that works with hie to check it it works?

mouse07410 commented 4 years ago

Well, lts-15.3 is for ghc-8.8.2 so using that resolver makes stack ignore the system ghc-8.8.3 (cause versions dont match). There is no lts nor nightly resolver for ghc-8.8.3

Interesting. 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.e., should I worry about which GHC compiler stack used to build hie-8.8.3?

jneira commented 4 years ago

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.

should I worry about which GHC compiler stack used to build hie-8.8.3?

Yeah. The existent stack.yaml's fullfill the convention but you have to ensure it manually if you creates a new stack.yaml

gdziadkiewicz commented 4 years ago

Nightly with ghc 8.8.3 appeared - https://www.stackage.org/nightly-2020-03-10

FirstLoveLife commented 4 years ago

@FirstLoveLife well maybe it might be another root cause, have you tried another ghc version that works with hie to check it it works?

Not yet. I only have manjaro now. It is not really easy to downgrade to 8.8.2 given the dependencies

dschrempf commented 4 years ago

FYI, Stackage resolvers lts-15.4 and lts-15.5 support ghc 8.8.3 now!

mouse07410 commented 4 years ago

Yes that is good to know.

However my current problem is building with and for ghc-8.10.1.

@jneira any comments? Cabal build would be just fine too.

jneira commented 4 years ago

Well, the branch i started to add full support to ghc-8.8.3 can be built with cabal and stack. The test suite has a bunch of errors but i think it could be usable. I'll open a new issue to track ghc-8.10 separately. There is already one about: #1712

dschrempf commented 4 years ago

@jneira I just tried buiding hie with your branch ghc-8.8.3, and it works fine! It also works in the editor apparently, but I did not use it extensively yet. Thanks!

mouse07410 commented 4 years ago

...just tried building hie with your branch ghc-8.8.3, and it works fine...

@dschrempf could you clarify? There is no such branch in the HIE repo. Did you mean you "built master branch with GHC-8.8.3 and it worked"?

FWIW, I built master with GHC-8.8.3 and it seems to be working, under VS Code and HLS plugin.

@jneira to declare full GHC-8.8.3 support, you're waiting for #1697 to pass CI tests and merge?

dschrempf commented 4 years ago

I was referring to the fork of @jneira, which has a branch https://github.com/jneira/haskell-ide-engine/tree/ghc-8.8.3.

jneira commented 4 years ago

@mouse07410 yeah, i cant promise it but i'll try to take a look to failing tests

mouse07410 commented 4 years ago

I cant promise it but I'll try to take a look to failing tests

Understood, thanks!

tofutim commented 4 years ago

when i try to ./cabal-hie-install hie-8.8.3 on macos, I get

cabal: Could not resolve dependencies:
[__0] trying: haskell-ide-engine-1.4 (user goal)
[__1] next goal: hie-bios (dependency of haskell-ide-engine)
[__1] rejecting: hie-bios-0.4.0 (conflict: haskell-ide-engine => hie-bios>=0.5
&& <0.6.0)
[__1] skipping: hie-bios-0.3.2, hie-bios-0.3.1, hie-bios-0.3.0,
hie-bios-0.2.1, hie-bios-0.2.0, hie-bios-0.1.1, hie-bios-0.1.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=0.5 && <0.6.0' from 'haskell-ide-engine')
[__1] fail (backjumping, conflict set: haskell-ide-engine, hie-bios)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: haskell-ide-engine, hie-bios

tim@Tims-MBP haskell-ide-engine % hie-bios --verison
"--verison" not supported

hie-bios version 0.5.0 compiled by GHC 8.8.3
Usage:
     hie-bios check [-g GHC_opt1 -g GHC_opt2 ...] <HaskellFiles...>
     hie-bios expand <HaskellFiles...>
     hie-bios flags <HaskellFiles...>
     hie-bios debug [<ComponentDir>]
     hie-bios config <HaskellFiles...>
     hie-bios cradle <HaskellFiles...>
     hie-bios root
     hie-bios version
fendor commented 4 years ago

I think you have to do a cabal update? Maybe your package index isnt up-to-date.