haskell / haskell-ide-engine

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

stack error when building hie-8.4.3 (problem with haskell-lsp-0.4.0.0 ?) #686

Closed pascalpoizat closed 6 years ago

pascalpoizat commented 6 years ago

Hello,

I pulled the last version of the code and when doing make build-all the build fails for hie-8.4.3 (it is ok for all others that have been updated on my machine from 0.2.0.0 to 0.2.1.0).

stack --stack-yaml=stack-8.4.3.yaml install                                      \
        && cp '/Users/pascalpoizat/.local/bin/hie' '/Users/pascalpoizat/.local/bin/hie-8.4.3'    \
        && cp '/Users/pascalpoizat/.local/bin/hie-8.4.3' '/Users/pascalpoizat/.local/bin/hie-8.4'
haskell-lsp-0.4.0.0: build (lib + exe)
dyre-0.8.12: configure
dyre-0.8.12: build
dyre-0.8.12: copy/register
Progress 2/5

--  While building custom Setup.hs for package haskell-lsp-0.4.0.0 using:
      /Users/pascalpoizat/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.2.0.1 build lib:haskell-lsp exe:lsp-hello --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/haskell-lsp-0.4.0.0.log

    Preprocessing library for haskell-lsp-0.4.0.0..
    Building library for haskell-lsp-0.4.0.0..
    [ 3 of 10] Compiling Language.Haskell.LSP.Messages ( src/Language/Haskell/LSP/Messages.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Language/Haskell/LSP/Messages.o )

    /Users/pascalpoizat/Documents/Code/haskell-ide-engine/submodules/haskell-lsp/src/Language/Haskell/LSP/Messages.hs:11:1: error:
        Could not find module ‘Language.Haskell.LSP.TH.MessageFuncs’
        Perhaps you meant
          Language.Haskell.LSP.TH.Messages (from haskell-lsp-types-0.3.0.0)
          Language.Haskell.LSP.TH.Constants (from haskell-lsp-types-0.3.0.0)
        Use -v to see a list of the files searched for.
       |
    11 | import           Language.Haskell.LSP.TH.MessageFuncs
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

make: *** [hie-8.4.3] Error 1
lukel97 commented 6 years ago

Have you tried a stack clean? haskell-lsp-0.4.0.0 should be building with haskell-lsp-types-0.4.0.0 but it looks like 0.3.0.0 is being used here

pascalpoizat commented 6 years ago

Hello @Bubba

Thanks. I did not thought about cleaning the project. Just tried but it does not changes the issue (see below). It seems it had an effect on building HIE for GHC 8.4.2 (which still works) not for GHC 8.4.3.

Then your idea made me think about something a bit more "radical": rm -rf .stack-work before make build-all. There, of course, everything rebuilds from scratch. Libraries used are now haskell-lsp-types-0.3.0.0 and haskell-lsp-0.4.0.0 (see figure below). And ... :tada: all builds!

Thanks a lot for helping me.

Pascal

output after stack clean + make build-all

~/Documents/Code/haskell-ide-engine master
❯ stack clean

~/Documents/Code/haskell-ide-engine master
❯ make build-all
git submodule update --init
stack --stack-yaml=stack-8.2.1.yaml install happy
Copying from /Users/pascalpoizat/.stack/snapshots/x86_64-osx/nightly-2017-11-24/8.2.1/bin/happy to /Users/pascalpoizat/.local/bin/happy

Copied executables to /Users/pascalpoizat/.local/bin:
- happy
stack --stack-yaml=stack-8.2.1.yaml install                                \
        && cp '/Users/pascalpoizat/.local/bin/hie' '/Users/pascalpoizat/.local/bin/hie-8.2.1'    \
        && cp '/Users/pascalpoizat/.local/bin/hie-8.2.1' '/Users/pascalpoizat/.local/bin/hie-8.2'
Copying from /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2017-11-24/8.2.1/bin/hie to /Users/pascalpoizat/.local/bin/hie
Copying from /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2017-11-24/8.2.1/bin/hie-wrapper to /Users/pascalpoizat/.local/bin/hie-wrapper

Copied executables to /Users/pascalpoizat/.local/bin:
- hie
- hie-wrapper
stack --stack-yaml=stack-8.2.2.yaml install happy
Copying from /Users/pascalpoizat/.stack/snapshots/x86_64-osx/lts-11.17/8.2.2/bin/happy to /Users/pascalpoizat/.local/bin/happy

Copied executables to /Users/pascalpoizat/.local/bin:
- happy
stack --stack-yaml=stack-8.2.2.yaml install                                \
        && cp '/Users/pascalpoizat/.local/bin/hie' '/Users/pascalpoizat/.local/bin/hie-8.2.2'    \
        && cp '/Users/pascalpoizat/.local/bin/hie-8.2.2' '/Users/pascalpoizat/.local/bin/hie-8.2'
Copying from /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-11.17/8.2.2/bin/hie to /Users/pascalpoizat/.local/bin/hie
Copying from /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-11.17/8.2.2/bin/hie-wrapper to /Users/pascalpoizat/.local/bin/hie-wrapper

Copied executables to /Users/pascalpoizat/.local/bin:
- hie
- hie-wrapper
stack --stack-yaml=stack-8.4.2.yaml install                                \
        && cp '/Users/pascalpoizat/.local/bin/hie' '/Users/pascalpoizat/.local/bin/hie-8.4.2'    \
        && cp '/Users/pascalpoizat/.local/bin/hie-8.4.2' '/Users/pascalpoizat/.local/bin/hie-8.4'
haskell-ide-engine-0.2.1.0: unregistering (missing dependencies: hie-plugin-api)
hie-plugin-api-0.2.0.0: unregistering (local file changes: Haskell/Ide/Engine/ArtifactMap.hs Haskell/Ide/Engine/GhcModuleCache.hs Haskell/Ide/Engine/IdeFunc...)
hie-plugin-api-0.2.0.0: configure (lib)
hie-plugin-api-0.2.0.0: build (lib)
hie-plugin-api-0.2.0.0: copy/register
Building all executables for `haskell-ide-engine' once. After a successful build of all of them, only specified executables will be rebuilt.
haskell-ide-engine-0.2.1.0: configure (lib + exe)
haskell-ide-engine-0.2.1.0: build (lib + exe)
haskell-ide-engine-0.2.1.0: copy/register
Completed 2 action(s).

--  Dumping log file due to warnings: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/haskell-ide-engine-0.2.1.0.log

Configuring haskell-ide-engine-0.2.1.0...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Preprocessing library for haskell-ide-engine-0.2.1.0..
Building library for haskell-ide-engine-0.2.1.0..
[ 1 of 23] Compiling Haskell.Ide.Engine.Compat ( src/Haskell/Ide/Engine/Compat.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Compat.o )
[ 2 of 23] Compiling Haskell.Ide.Engine.LSP.Config ( src/Haskell/Ide/Engine/LSP/Config.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/LSP/Config.o )
[ 3 of 23] Compiling Haskell.Ide.Engine.Options ( src/Haskell/Ide/Engine/Options.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Options.o )
[ 4 of 23] Compiling Haskell.Ide.Engine.Plugin.ApplyRefact ( src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/ApplyRefact.o )
[ 5 of 23] Compiling Haskell.Ide.Engine.Plugin.Brittany ( src/Haskell/Ide/Engine/Plugin/Brittany.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Brittany.o )
[ 6 of 23] Compiling Haskell.Ide.Engine.Plugin.Build ( src/Haskell/Ide/Engine/Plugin/Build.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Build.o )
[ 7 of 23] Compiling Haskell.Ide.Engine.Plugin.Example2 ( src/Haskell/Ide/Engine/Plugin/Example2.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Example2.o )
[ 8 of 23] Compiling Haskell.Ide.Engine.Plugin.Fuzzy ( src/Haskell/Ide/Engine/Plugin/Fuzzy.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Fuzzy.o )
[ 9 of 23] Compiling Haskell.Ide.Engine.Plugin.HaRe ( src/Haskell/Ide/Engine/Plugin/HaRe.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/HaRe.o )
[10 of 23] Compiling Haskell.Ide.Engine.Plugin.GhcMod ( src/Haskell/Ide/Engine/Plugin/GhcMod.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/GhcMod.o )
[11 of 23] Compiling Haskell.Ide.Engine.Plugin.HieExtras ( src/Haskell/Ide/Engine/Plugin/HieExtras.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/HieExtras.o )
[12 of 23] Compiling Haskell.Ide.Engine.Plugin.Haddock ( src/Haskell/Ide/Engine/Plugin/Haddock.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Haddock.o )
[13 of 23] Compiling Haskell.Ide.Engine.Plugin.Hoogle ( src/Haskell/Ide/Engine/Plugin/Hoogle.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Hoogle.o )
[14 of 23] Compiling Haskell.Ide.Engine.Plugin.HsImport ( src/Haskell/Ide/Engine/Plugin/HsImport.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/HsImport.o )
[15 of 23] Compiling Haskell.Ide.Engine.Plugin.Package ( src/Haskell/Ide/Engine/Plugin/Package.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Package.o )
[16 of 23] Compiling Haskell.Ide.Engine.Types ( src/Haskell/Ide/Engine/Types.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Types.o )
[17 of 23] Compiling Haskell.Ide.Engine.Dispatcher ( src/Haskell/Ide/Engine/Dispatcher.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Dispatcher.o )
[18 of 23] Compiling Haskell.Ide.Engine.Transport.JsonStdio ( src/Haskell/Ide/Engine/Transport/JsonStdio.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Transport/JsonStdio.o )
[19 of 23] Compiling Haskell.Ide.Engine.LSP.Reactor ( src/Haskell/Ide/Engine/LSP/Reactor.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/LSP/Reactor.o )
[20 of 23] Compiling Haskell.Ide.Engine.LSP.CodeActions ( src/Haskell/Ide/Engine/LSP/CodeActions.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/LSP/CodeActions.o )
[21 of 23] Compiling Paths_haskell_ide_engine ( .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/autogen/Paths_haskell_ide_engine.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Paths_haskell_ide_engine.o )
[22 of 23] Compiling Haskell.Ide.Engine.Plugin.Base ( src/Haskell/Ide/Engine/Plugin/Base.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Plugin/Base.o )
[23 of 23] Compiling Haskell.Ide.Engine.Transport.LspStdio ( src/Haskell/Ide/Engine/Transport/LspStdio.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Transport/LspStdio.o )
Preprocessing executable 'hie-wrapper' for haskell-ide-engine-0.2.1.0..
Building executable 'hie-wrapper' for haskell-ide-engine-0.2.1.0..
[1 of 2] Compiling Paths_haskell_ide_engine ( .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie-wrapper/autogen/Paths_haskell_ide_engine.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie-wrapper/hie-wrapper-tmp/Paths_haskell_ide_engine.o )
[2 of 2] Compiling Main             ( app/HieWrapper.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie-wrapper/hie-wrapper-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie-wrapper/hie-wrapper ...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Preprocessing executable 'hie' for haskell-ide-engine-0.2.1.0..
Building executable 'hie' for haskell-ide-engine-0.2.1.0..
[1 of 2] Compiling Paths_haskell_ide_engine ( .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie/autogen/Paths_haskell_ide_engine.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie/hie-tmp/Paths_haskell_ide_engine.o )
[2 of 2] Compiling Main             ( app/MainHie.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie/hie-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/hie/hie ...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Installing library in /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2018-05-30/8.4.2/lib/x86_64-osx-ghc-8.4.2/haskell-ide-engine-0.2.1.0-7TQ8Rc5x6b5Gl3NoKGUAHk
Installing executable hie-wrapper in /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2018-05-30/8.4.2/bin
Installing executable hie in /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2018-05-30/8.4.2/bin
Registering library for haskell-ide-engine-0.2.1.0..

--  End of log file: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/haskell-ide-engine-0.2.1.0.log

--  Dumping log file due to warnings: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/hie-plugin-api-0.2.0.0.log

Configuring hie-plugin-api-0.2.0.0...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Preprocessing library for hie-plugin-api-0.2.0.0..
Building library for hie-plugin-api-0.2.0.0..
[ 1 of 11] Compiling Haskell.Ide.Engine.ArtifactMap ( Haskell/Ide/Engine/ArtifactMap.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/ArtifactMap.o )
[ 2 of 11] Compiling Haskell.Ide.Engine.GhcModuleCache ( Haskell/Ide/Engine/GhcModuleCache.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/GhcModuleCache.o )
[ 3 of 11] Compiling Haskell.Ide.Engine.MultiThreadState ( Haskell/Ide/Engine/MultiThreadState.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/MultiThreadState.o )
[ 4 of 11] Compiling Haskell.Ide.Engine.PluginsIdeMonads ( Haskell/Ide/Engine/PluginsIdeMonads.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/PluginsIdeMonads.o )
[ 5 of 11] Compiling Haskell.Ide.Engine.MonadFunctions ( Haskell/Ide/Engine/MonadFunctions.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/MonadFunctions.o )
[ 6 of 11] Compiling Haskell.Ide.Engine.ModuleCache ( Haskell/Ide/Engine/ModuleCache.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/ModuleCache.o )
[ 7 of 11] Compiling Haskell.Ide.Engine.MonadTypes ( Haskell/Ide/Engine/MonadTypes.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/MonadTypes.o )
[ 8 of 11] Compiling Haskell.Ide.Engine.PluginUtils ( Haskell/Ide/Engine/PluginUtils.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/PluginUtils.o )
[ 9 of 11] Compiling Haskell.Ide.Engine.Monad ( Haskell/Ide/Engine/Monad.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/Monad.o )
[10 of 11] Compiling Haskell.Ide.Engine.IdeFunctions ( Haskell/Ide/Engine/IdeFunctions.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/IdeFunctions.o )
[11 of 11] Compiling Haskell.Ide.Engine.PluginDescriptor ( Haskell/Ide/Engine/PluginDescriptor.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Haskell/Ide/Engine/PluginDescriptor.o )
Installing library in /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2018-05-30/8.4.2/lib/x86_64-osx-ghc-8.4.2/hie-plugin-api-0.2.0.0-I9oaq3NgcdZAWsEQd4FLlU
Registering library for hie-plugin-api-0.2.0.0..

--  End of log file: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/hie-plugin-api-0.2.0.0.log

Log files have been written to: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/
Copying from /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2018-05-30/8.4.2/bin/hie to /Users/pascalpoizat/.local/bin/hie
Copying from /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/install/x86_64-osx/nightly-2018-05-30/8.4.2/bin/hie-wrapper to /Users/pascalpoizat/.local/bin/hie-wrapper

Copied executables to /Users/pascalpoizat/.local/bin:
- hie
- hie-wrapper
stack --stack-yaml=stack-8.4.3.yaml install                                      \
        && cp '/Users/pascalpoizat/.local/bin/hie' '/Users/pascalpoizat/.local/bin/hie-8.4.3'    \
        && cp '/Users/pascalpoizat/.local/bin/hie-8.4.3' '/Users/pascalpoizat/.local/bin/hie-8.4'
haskell-lsp-0.4.0.0: build (lib + exe)
Progress 1/3

--  While building custom Setup.hs for package haskell-lsp-0.4.0.0 using:
      /Users/pascalpoizat/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.2.0.1 build lib:haskell-lsp exe:lsp-hello --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/pascalpoizat/Documents/Code/haskell-ide-engine/.stack-work/logs/haskell-lsp-0.4.0.0.log

    Preprocessing library for haskell-lsp-0.4.0.0..
    Building library for haskell-lsp-0.4.0.0..
    [ 3 of 10] Compiling Language.Haskell.LSP.Messages ( src/Language/Haskell/LSP/Messages.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Language/Haskell/LSP/Messages.o )

    /Users/pascalpoizat/Documents/Code/haskell-ide-engine/submodules/haskell-lsp/src/Language/Haskell/LSP/Messages.hs:11:1: error:
        Could not find module ‘Language.Haskell.LSP.TH.MessageFuncs’
        Perhaps you meant
          Language.Haskell.LSP.TH.Messages (from haskell-lsp-types-0.3.0.0)
          Language.Haskell.LSP.TH.Constants (from haskell-lsp-types-0.3.0.0)
        Use -v to see a list of the files searched for.
       |
    11 | import           Language.Haskell.LSP.TH.MessageFuncs
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

make: *** [hie-8.4.3] Error 1

~/Documents/Code/haskell-ide-engine master 1m 29s

output after rm -rf .stack-work + make build-all

~/Documents/Code/haskell-ide-engine master 22m 34s

libraries used for GHC 8.4.3

capture d ecran 2018-07-17 a 16 21 08