rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Weird problem - just see the messages #409

Closed mouse07410 closed 5 years ago

mouse07410 commented 5 years ago

Intellij IDEA-2019.1, GHC-8.6.4 (machine has 8.6.3 installed as well). My newly-created toy project (via New -> Project -> Haskell Module -> Haskell Stack 1.9.3 SDK) is called Str2Split.

First, why is the plugin insisting on ghc-8.6.3, when my config clearly says to use ghc-8.6.4? But it gets more interesting:

2019-04-02
17:49   Can not download cabal config file for stack resolver lts-13.15, please check your network environment.

17:49   Executing `/Users/ur20980/.local/bin/stack --system-ghc -j1 --stack-root /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13 --resolver lts-13 --compiler ghc-8.6.3 --local-bin-path /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13/bin install stylish-haskell` failed: /Users/ur20980/.local/bin/stack --system-ghc -j1 --stack-root /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13 --resolver lts-13 --compiler ghc-8.6.3 --local-bin-path /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13/bin install stylish-haskell:   
            Selected resolver: lts-13.15
            Error: While constructing the build plan, the following exceptions were encountered:
            In the dependencies for optparse-applicative-0.13.2.0:
            base-4.12.0.0 from stack configuration does not match >=4 && <4.11  (latest matching version
            is 4.10.1.0)
            transformers-compat-0.6.2 from stack configuration does not match >=0.3 && <0.... (show balloon)

17:49   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

17:49   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

17:49   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

Here's ~/Library/Caches/com.github.rikvdkleij.intellij-haskell//lts-13/global-project/stack.yaml: stack.yaml.txt

But despite the above, it correctly identified the executable and successfully saved project config:

Screen Shot 2019-04-02 at 5 58 45 PM

Still, it denies the benefits of REPL:

17:49   Can not download cabal config file for stack resolver lts-13.15, please check your network environment.

17:49   Executing `/Users/ur20980/.local/bin/stack --system-ghc -j1 --stack-root /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13 --resolver lts-13 --compiler ghc-8.6.3 --local-bin-path /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13/bin install stylish-haskell` failed: /Users/ur20980/.local/bin/stack --system-ghc -j1 --stack-root /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13 --resolver lts-13 --compiler ghc-8.6.3 --local-bin-path /Users/ur20980/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-13/bin install stylish-haskell:   
            Selected resolver: lts-13.15
            Error: While constructing the build plan, the following exceptions were encountered:
            In the dependencies for optparse-applicative-0.13.2.0:
            base-4.12.0.0 from stack configuration does not match >=4 && <4.11  (latest matching version
            is 4.10.1.0)
            transformers-compat-0.6.2 from stack configuration does not match >=0.3 && <0.... (show balloon)

17:49   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

17:49   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

17:49   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

17:58   Build completed successfully in 2 s 285 ms

17:58   Stack REPL could not be started for target `Str2Split:exe:Str2Split-exe` because cannot satisfy -package Str2Split-0.1.0.0

18:01   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:01   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

18:01   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:01   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

18:01   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:01   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

18:03   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:03   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

18:03   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:03   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

18:03   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:03   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

18:03   [global-stack-repl] Stack REPL could not be started within 30 seconds

18:03   [global-stack-repl] : can't load .so/.DLL for: libHSghc-prim-0.5.3.dylib (dlopen(libHSghc-prim-0.5.3.dylib, 5): image not found) (show balloon)

even though it builds and runs:

/Users/ur20980/.local/bin/stack build --exec Str2Split-exe
Str2Split-0.1.0.0: configure (lib + exe)
Configuring Str2Split-0.1.0.0...
Warning: the following files would be used as linker inputs, but linking is not being done: /usr/lib/libiconv.dylib
Str2Split-0.1.0.0: build (lib + exe)
Preprocessing library for Str2Split-0.1.0.0..
Building library for Str2Split-0.1.0.0..
[1 of 2] Compiling Lib              ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Lib.o ) [Optimisation flags changed]
[2 of 2] Compiling Paths_Str2Split  ( .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/Paths_Str2Split.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Paths_Str2Split.o ) [Optimisation flags changed]
Preprocessing executable 'Str2Split-exe' for Str2Split-0.1.0.0..
Building executable 'Str2Split-exe' for Str2Split-0.1.0.0..
Warning: the following files would be used as linker inputs, but linking is not being done: /usr/lib/libiconv.dylib
[1 of 2] Compiling Main             ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Str2Split-exe/Str2Split-exe-tmp/Main.o )
[2 of 2] Compiling Paths_Str2Split  ( .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Str2Split-exe/autogen/Paths_Str2Split.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Str2Split-exe/Str2Split-exe-tmp/Paths_Str2Split.o )
Linking .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Str2Split-exe/Str2Split-exe ...
Str2Split-0.1.0.0: copy/register
Installing library in /Users/ur20980/src/Str2Split/.stack-work/install/x86_64-osx/lts-13.15/8.6.4/lib/x86_64-osx-ghc-8.6.4/Str2Split-0.1.0.0-7QLxoIcNTm129eEkCQEeFn
Installing executable Str2Split-exe in /Users/ur20980/src/Str2Split/.stack-work/install/x86_64-osx/lts-13.15/8.6.4/bin
Registering library for Str2Split-0.1.0.0..
Testing complicated 'foldr'
"2d4 fda 81c 8ce 783 aso meF unc"
Testing my 'chunker' (uses 'unfoldr')
["2d","4f","da","81","c8","ce","78","3a","so","me","Fu","nc"]
Testing "splitMore" using 'unfoldr' and 'intercalate'
"2d 4f da 81 c8 ce 78 3a so me Fu nc"

Process finished with exit code 0
rikvdkleij commented 5 years ago

First, why is the plugin insisting on ghc-8.6.3, when my config clearly says to use ghc-8.6.4

That GHC version is only used for building the tools. In next beta it will be 8.6.4.

mouse07410 commented 5 years ago

I wonder if the next beta could use whatever GHC it finds on the path. All of my machines except for one use ghc-8.6.4, but that one uses 8.6.3. My GHC installations are customized (that libiconv problem, about which I'm sure you've already heard more than you care to :), so I can't afford having the toolchain just download a version of GHC because it will fail to link at least some packages. So, ideally it should respect what's in ~/.stack/config.yaml (system-ghc: true) and use what's installed - regardless of it's version.

Could you support that please?

rikvdkleij commented 5 years ago

Should be solved in beta46 (just released)

mouse07410 commented 5 years ago

Looks good so far, thanks! I'll need more local testing before actually closing this.

Thanks again!

mouse07410 commented 5 years ago

I think it's fixed now, thanks!