rikvdkleij / intellij-haskell

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

Stack REPL couldn't be started for target `xxx` due to: cannot satisfy -package yyy #583

Closed nhenin closed 4 years ago

nhenin commented 4 years ago

Hi,

I have a multi-project structure and I'm using the beta75 version of your plugin. I'm using ghc 8.8.3 and stack Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33.0

Running stack on the terminal works but somehow there are some issues when I'm trying to do it in Intellij, I have the followings errors for each of my sub-project :

Stack REPL couldn't be started for target `dolla-base:lib` due to: cannot satisfy -package adjunctions-4.4
Stack REPL couldn't be started for target `dolla-osprey:lib` due to: cannot satisfy -package byline-0.3.2.1
Stack REPL couldn't be started for target `dolla-consensus:lib` due to: cannot satisfy -package aeson-1.4.7.1
...

For each project it cannot satisfy the first package by alphabetical order for each of my subproject...

The plugin does not give me any compilation feedback anymore, like it's jammed...

Also this at the beginning : Information:Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail Information:Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail

I'm using lts-16.2 which is using ghc 8.8.3

rikvdkleij commented 4 years ago

Looks like the stack build failed because the REPLs can't find the build dependencies.

Information:Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail Information:Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail

Are you sure that plugin is using stack verison 2.3.1?

nhenin commented 4 years ago

Yes I think so : image

nhenin commented 4 years ago

Stack looks to be not align with the latest version of GHC and Cabal .... https://github.com/commercialhaskell/stack/issues/5244 and I have updated my lts snapshot (lts-16.2) Could it be an issue ? I have this in the event log :

2020-07-10
4:33 p.m.   HLint inspection is started for file ClientOverEventStore.hs

4:33 p.m.   [project-stack-repl-dolla-consensus-broadcast:lib] Stack REPL will be started with command: /usr/local/bin/stack repl dolla-consensus-broadcast:lib --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1

4:33 p.m.   HLint inspection is started for file ClientOverEventStore.hs

4:33 p.m.   /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-16/bin/hlint --json /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/ClientOverEventStore.hs:  /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-16/bin/hlint --json /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/ClientOverEventStore.hs

4:33 p.m.   /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-16/bin/hlint --json /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/ClientOverEventStore.hs:  []

4:33 p.m.   HLint inspection is finished for file ClientOverEventStore.hs

4:33 p.m.   [project-stack-repl-dolla-consensus-broadcast:lib] Stack REPL couldn't be started for target `dolla-consensus-broadcast:lib` due to: cannot satisfy -package adjunctions-4.4

4:33 p.m.   Stack REPL couldn't be started for target `dolla-consensus-broadcast:lib` due to: cannot satisfy -package adjunctions-4.4

It works fine also when I'm running this in the console :

/usr/local/bin/stack repl dolla-consensus-broadcast:lib --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1
➜  consortium git:(master) ✗ /usr/local/bin/stack repl dolla-consensus-broadcast:lib --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1
GHCi, version 8.8.3: https://www.haskell.org/ghc/  :? for help
[ 1 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/Dependencies.hs, interpreted )
[ 2 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.ESMerger ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/ESMerger.hs, interpreted )
[ 3 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.Input ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/Input.hs, interpreted )
[ 4 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.Output ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/Output.hs, interpreted )
[ 5 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.StreamProcessor ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/StreamProcessor.hs, interpreted )
[ 6 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Client.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Client/Dependencies.hs, interpreted )
[ 7 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Client.StreamProcessors ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Client/StreamProcessors.hs, interpreted )
[ 8 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Definition ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Definition.hs, interpreted )
[ 9 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Message ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Message.hs, interpreted )
[10 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Client.Client ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Client/Client.hs, interpreted )
[11 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Client.ClientOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Client/ClientOverEventStore.hs, interpreted )
[12 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.Broadcast ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/Broadcast.hs, interpreted )
[13 of 45] Compiling Dolla.Consensus.Broadcast.Binary.Algorithm.BroadcastOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/Algorithm/BroadcastOverEventStore.hs, interpreted )
[14 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Server.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Server/Dependencies.hs, interpreted )
[15 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Server.ESMerger ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Server/ESMerger.hs, interpreted )
[16 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Server.Server ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Server/Server.hs, interpreted )
[17 of 45] Compiling Dolla.Consensus.Broadcast.Binary.RemoteSyncer.Server.ServerOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Binary/RemoteSyncer/Server/ServerOverEventStore.hs, interpreted )
[18 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.ESMerger ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/ESMerger.hs, interpreted )
[19 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.EndReason ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/EndReason.hs, interpreted )
[20 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.Settings ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/Settings.hs, interpreted )
[21 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Client.Context ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/Context.hs, interpreted )
[22 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Client.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/Dependencies.hs, interpreted )
[23 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Client.SyncSessionProjection ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/SyncSessionProjection.hs, interpreted )
[24 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Client.Client ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/Client.hs, interpreted )
[25 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Client.ClientOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/ClientOverEventStore.hs, interpreted )
[26 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Server.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Server/Dependencies.hs, interpreted )
[27 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Server.Server ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Server/Server.hs, interpreted )
[28 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Server.ServerOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Server/ServerOverEventStore.hs, interpreted )
[29 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Client.Context ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Client/Context.hs, interpreted )
[30 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Client.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Client/Dependencies.hs, interpreted )
[31 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Client.SyncSessionProjection ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Client/SyncSessionProjection.hs, interpreted )
[32 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Message ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Message.hs, interpreted )
[33 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Definition ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Definition.hs, interpreted )
[34 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Client.SyncStatus ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Client/SyncStatus.hs, interpreted )
[35 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Client.Client ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Client/Client.hs, interpreted )
[36 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Client.ClientOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Client/ClientOverEventStore.hs, interpreted )
[37 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Download.Client.SyncStatus ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Download/Client/SyncStatus.hs, interpreted )
[38 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.Output ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/Output.hs, interpreted )
[39 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.Input ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/Input.hs, interpreted )
[40 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.StreamProcessor ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/StreamProcessor.hs, interpreted )
[41 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.Algorithm ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/Algorithm.hs, interpreted )
[42 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Algorithm.AlgorithmOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/AlgorithmOverEventStore.hs, interpreted )
[43 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Server.Dependencies ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Server/Dependencies.hs, interpreted )
[44 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Server.Server ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Server/Server.hs, interpreted )
[45 of 45] Compiling Dolla.Consensus.Broadcast.Proposal.Status.Server.ServerOverEventStore ( /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Status/Server/ServerOverEventStore.hs, interpreted )
Ok, 45 modules loaded.
Loaded GHCi configuration from /private/var/folders/lg/vc8g6fsn2vv51ry7ypf3f1940000gn/T/haskell-stack-ghci/cda26e9a/ghci-script
Loaded GHCi configuration from /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci
^IntellijHaskell^

this is how I structure my multi-package project stack.yaml:

resolver: lts-16.2
packages:
  - src/dolla-base

  - src/dolla-consensus
  - src/dolla-consensus-broadcast
  - src/dolla-consensus-broadcast-settings
  - src/dolla-consensus-broadcast-proposal-merger
  - src/dolla-consensus-proposer
  - src/dolla-consensus-proposer-settings
  - src/dolla-consensus-maestro
  - src/dolla-consensus-maestro-settings
  - src/dolla-consensus-transaction
  - src/dolla-consensus-transaction-settings
  - src/dolla-consensus-receptionist
  - src/dolla-consensus-receptionist-settings
  - src/dolla-consensus-orchestrator
  - src/dolla-consensus-orchestrator-settings

  - src/dolla-osprey-settings
  - src/dolla-cli-client
  - src/dolla-zeus
  - src/dolla-osprey
nhenin commented 4 years ago

@rikvdkleij I can't use the plugin anymore :-(

rikvdkleij commented 4 years ago

Sorry to hear.

Your stack.yaml looks a bit suspicious. Normally it only contains paths to folders which contain a Cabal file/project.

Yes I think so :

No that is not version 2.3.1

Otherwise can you share your project so i can try to reproduce your issue?

rikvdkleij commented 4 years ago

Btw, the next version of the plugin will use the Stack binary from the PATH.

nhenin commented 4 years ago

Ho my bad for the version... I have the right one now : image

But I still have the same issues without obviously the warnings I referred previously .... (Stack has not been tested with GHC versions above 8.6, and using 8.8.3, ...)

Sorry I can't give you access, the project is not open source :-(

Regarding the stack.yaml, they are paths to folders which contain a package.yaml like this :

image

Here is the content of the package.yaml for the first sub-project dolla-base :

image

The cabal generated :

cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 980805a8afbdb95c8aff4db27dc0e4281ac89a3ee8461e460ce6027fd9d3776a

name:           dolla-base
version:        0.0.0.1
build-type:     Simple
extra-source-files:
    README.md

library
  exposed-modules:
      Dolla.Adapter.Aeson.AesonVia
      Dolla.Adapter.ByLine.Wrapper
      Dolla.Adapter.Data.IntMap.Adapter
      Dolla.Adapter.Pipes.State
      Dolla.Adapter.Servant.Adapter
      Dolla.Adapter.Servant.Wrapper
      Dolla.Adapter.Streamly.Converter
      Dolla.Adapter.Turtle.Wrapper
      Dolla.Common.Data.IsString
      Dolla.Common.Data.Map.Bool
      Dolla.Common.Dependencies.Core
      Dolla.Common.Dependencies.HealthChecking
      Dolla.Common.Exception.NotImplementedYet
      Dolla.Common.Executable.Executable
      Dolla.Common.Logging.Core
      Dolla.Common.Memory.Byte
      Dolla.Common.Network.Core
      Dolla.Common.Network.Socket
      Dolla.Common.NodeId
      Dolla.Common.Offset
      Dolla.Common.Population
      Dolla.Common.Range
      Dolla.Common.Stream.Processor.SP
      Dolla.Common.Streamly
      Dolla.Common.System.Threading
      Dolla.Common.Time.Core
      Dolla.Common.UUID.Deterministic
      Dolla.Common.UUID.HashProvider
      Dolla.Common.UUID.Provider
      Dolla.Common.Verification
      Dolla.Libraries.LogEngine.Appendable
      Dolla.Libraries.LogEngine.Instances.EventStore.EventStoreLog
      Dolla.Libraries.LogEngine.Instances.EventStore.InternalEventStoreLog
      Dolla.Libraries.LogEngine.Instances.EventStore.Projection.Client
      Dolla.Libraries.LogEngine.Instances.EventStore.Projection.Definition
      Dolla.Libraries.LogEngine.Instances.EventStore.Read.Mapper
      Dolla.Libraries.LogEngine.Instances.EventStore.Read.Querying
      Dolla.Libraries.LogEngine.Instances.EventStore.Read.Streaming
      Dolla.Libraries.LogEngine.Instances.EventStore.Read.Subscribing
      Dolla.Libraries.LogEngine.Instances.EventStore.Settings
      Dolla.Libraries.LogEngine.Instances.EventStore.Write.Mapper
      Dolla.Libraries.LogEngine.Instances.EventStore.Write.Persisting
      Dolla.Libraries.LogEngine.LogEngine
      Dolla.Libraries.LogEngine.LogItem
      Dolla.Libraries.LogEngine.PersistenceResult
      Dolla.Libraries.LogEngine.RemoteLogStreaming
  other-modules:
      Paths_dolla_base
  hs-source-dirs:
      lib
  ghc-options: -Wall -j
  build-depends:
      adjunctions ==4.4
    , aeson ==1.4.7.1
    , async ==2.2.2
    , base ==4.13.0.0
    , binary ==0.8.7.0
    , byline ==0.3.2.1
    , bytestring ==0.10.10.0
    , containers ==0.6.2.1
    , deepseq ==1.4.4.0
    , distributive ==0.6.2
    , either ==5.0.1
    , eventstore ==1.4.1
    , exceptions ==0.10.4
    , fast-logger ==3.0.1
    , fsnotify ==0.3.0.1
    , hashable ==1.3.0.0
    , hslogger ==1.3.1.0
    , http-client ==0.6.4.1
    , lens ==4.18.1
    , mmorph ==1.1.3
    , mtl ==2.2.2
    , network ==3.1.1.1
    , pipes ==4.3.13
    , servant-client ==0.16.0.1
    , servant-server ==0.16.2
    , streaming ==0.2.3.0
    , streamly ==0.7.2
    , text ==1.2.4.0
    , time ==1.9.3
    , turtle ==1.5.19
    , utf8-string ==1.0.1.1
    , uuid ==1.3.13
    , validation ==1.1
  default-language: Haskell2010
nhenin commented 4 years ago

I'm going to make a similar project with the same structure aside...

nhenin commented 4 years ago

https://github.com/Eventuria/multiProjectExample, I have the same issue on that example... Tell me if you need anything else... Thanks for the help !

nhenin commented 4 years ago

Some feedback while I was creating that multiProjectExample... I had to do a stack build in the terminal before being able to correctly setups things in Intellij... Basically Generating the cabal files with stack in the terminal ... Are you not supporting the use of package.yaml files ?

Because you said :

Your stack.yaml looks a bit suspicious. Normally it only contains paths to folders which contain a Cabal file/project.

I'm not using cabal files directly... I may have a configuration that you don't support with the plugin ? Because using stack in the terminal is always working...

This is what I have in the event log with multiProjectExample :

2020-07-13
4:25 p.m.   Restarting Haskell project

4:25 p.m.   [global-stack-repl] Command :q took + 2 ms

4:25 p.m.   [global-stack-repl] stdout: Leaving GHCi.

4:25 p.m.   [global-stack-repl] Stack REPL is stopped

4:25 p.m.   [global-stack-repl] Command :q took + 2 ms

4:25 p.m.   [global-stack-repl] stdout: Leaving GHCi.

4:25 p.m.   [global-stack-repl] Stack REPL is stopped

4:25 p.m.   Start to invalidate cache

4:25 p.m.   Finished with invalidating cache

4:25 p.m.   [global-stack-repl] Stack REPL will be started with command: /Users/nhenin/.local/bin/stack repl --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1 --no-package-hiding --no-load

4:25 p.m.   [project-stack-repl-eventuria-project-a:lib] Stack REPL will be started with command: /Users/nhenin/.local/bin/stack repl eventuria-project-a:lib --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1

4:25 p.m.   File MyModuleA.hs could not be loaded because the REPL is not (yet) available

4:25 p.m.   HLint inspection is started for file MyModuleA.hs

4:25 p.m.   /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-16/bin/hlint --json /Users/nhenin/dev/multiProjectExample/eventuria-project-a/lib/Eventuria/ProjectA/MyModuleA.hs:  /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-16/bin/hlint --json /Users/nhenin/dev/multiProjectExample/eventuria-project-a/lib/Eventuria/ProjectA/MyModuleA.hs

4:25 p.m.   /Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/lts-16/bin/hlint --json /Users/nhenin/dev/multiProjectExample/eventuria-project-a/lib/Eventuria/ProjectA/MyModuleA.hs:  [{"module":["Eventuria.ProjectA.MyModuleA"],"decl":[],"severity":"Warning","hint":"Unused LANGUAGE pragma","file":"/Users/nhenin/dev/multiProjectExample/eventuria-project-a/lib/Eventuria/ProjectA/MyModuleA.hs","startLine":1,"startColumn":1,"endLine":2,"endColumn":47,"from":"{-# LANGUAGE DerivingVia, DerivingStrategies, DeriveGeneric, FlexibleContexts, UndecidableInstances, StandaloneDeriving #-}","to":"{-# LANGUAGE DerivingVia, FlexibleContexts, UndecidableInstances #-}","note":["Extension DerivingStrategies is implied by DerivingVia","Extension DeriveGeneric is not used","Extension StandaloneDeriving is not used"],"refactorings":"[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 2, endCol = 47}, newComment = \"{-# LANGUAGE DerivingVia, FlexibleContexts, UndecidableInstances #-}\"}... (show balloon)

4:25 p.m.   HLint inspection is finished for file MyModuleA.hs

4:25 p.m.   [project-stack-repl-eventuria-project-a:lib] Stack REPL couldn't be started for target `eventuria-project-a:lib` due to: cannot satisfy -package aeson-1.4.7.1

4:25 p.m.   Stack REPL couldn't be started for target `eventuria-project-a:lib` due to: cannot satisfy -package aeson-1.4.7.1

4:25 p.m.   REPL eventuria-project-a isn't started

4:25 p.m.   [global-stack-repl] Stack REPL is started

4:25 p.m.   [global-stack-repl] Stack REPL will be started with command: /Users/nhenin/.local/bin/stack repl --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1 --no-package-hiding --no-load

4:25 p.m.   [global-stack-repl] Stack REPL is started

4:25 p.m.   Executing: /Users/nhenin/.local/bin/stack path 

4:25 p.m.   [project-stack-repl-eventuria-project-b:lib] Stack REPL will be started with command: /Users/nhenin/.local/bin/stack repl eventuria-project-b:lib --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1

4:25 p.m.   Executing: /Users/nhenin/.ghcup/ghc/8.8.3/bin/ghc --supported-languages 

4:25 p.m.   Executing: /Users/nhenin/.ghcup/ghc/8.8.3/bin/ghc --numeric-version 

4:25 p.m.   Executing: /Users/nhenin/.ghcup/ghc/8.8.3/bin/ghc-pkg dump --package-db=/Users/nhenin/.ghcup/ghc/8.8.3/lib/ghc-8.8.3/package.conf.d --package-db=/Users/nhenin/.stack/snapshots/x86_64-osx/4f62373f318180f3c6593056660d6477330cfdb52640904d720b0e87d97d0f79/8.8.3/pkgdb --package-db=/Users/nhenin/dev/multiProjectExample/.stack-work/install/x86_64-osx/4f62373f318180f3c6593056660d6477330cfdb52640904d720b0e87d97d0f79/8.8.3/pkgdb 

4:25 p.m.   Start to preload stack component info cache

4:25 p.m.   Start to preload library identifiers cache

4:25 p.m.   Start to preload all library identifiers cache

4:25 p.m.   /Users/nhenin/.local/bin/stack update:  /Users/nhenin/.local/bin/stack update

4:25 p.m.   [global-stack-repl] Command :set -XNoImplicitPrelude took + 2 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   Finished with preloading stack component info cache

4:25 p.m.   [global-stack-repl] Command :unadd Prelude took + 3 ms

4:25 p.m.   [global-stack-repl] stdout: Ok, no modules loaded.
                ^IntellijHaskell^

4:25 p.m.   /Users/nhenin/.local/bin/stack update:  Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/

4:25 p.m.   /Users/nhenin/.local/bin/stack update:  Downloading timestamp

4:25 p.m.   [project-stack-repl-eventuria-project-b:lib] Stack REPL couldn't be started for target `eventuria-project-b:lib` due to: cannot satisfy -package aeson-1.4.7.1

4:25 p.m.   Stack REPL couldn't be started for target `eventuria-project-b:lib` due to: cannot satisfy -package aeson-1.4.7.1

4:25 p.m.   REPL eventuria-project-b isn't started

4:25 p.m.   [global-stack-repl] Command :browse! Prelude took + 157 ms

4:25 p.m.   [global-stack-repl] stdout: -- not currently imported
                (GHC.List.!!) :: [a] -> GHC.Types.Int -> a
                (GHC.Base.$) :: (a -> b) -> a -> b
                (GHC.Base.$!) :: (a -> b) -> a -> b
                (GHC.Classes.&&) ::
                GHC.Types.Bool -> GHC.Types.Bool -> GHC.Types.Bool
                (GHC.Num.*) :: GHC.Num.Num a => a -> a -> a
                (GHC.Float.**) :: GHC.Float.Floating a => a -> a -> a
                (GHC.Base.*>) :: GHC.Base.Applicative f => f a -> f b -> f b
                (GHC.Num.+) :: GHC.Num.Num a => a -> a -> a
                (GHC.Base.++) :: [a] -> [a] -> [a]
                (GHC.Num.-) :: GHC.Num.Num a => a -> a -> a
                (GHC.Base..) :: (b -> c) -> (a -> b) -> a -> c
                (GHC.Real./) :: GHC.Real.Fractional a => a -> a -> a
                (GHC.Classes./=) :: GHC.Classes.Eq a => a -> a -> GHC.Types.Bool
                (GHC.Classes.<) :: GHC.Classes.Ord a => a -> a -> GHC.Types.Bool
                (GHC.Base.<$) :: GHC.Base.Functor f => a -> f b -> f a
                (Data.Functor.<$>) :: GHC.Base.Functor f => (a -> b) -> f a -> f b
                (GHC.Base.<*) :: GHC.Base.Applicative f => f a -> f b -> f a
                (GHC.Base.<*>) ::
                GHC.Base.Applicative f => f (a -> b) -> f a ... (show balloon)

4:25 p.m.   [global-stack-repl] Command :set -XImplicitPrelude took + 2 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] Command :add Prelude took + 3 ms

4:25 p.m.   [global-stack-repl] stdout: Module Prelude not found
                Ok, no modules loaded.
                ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] Command :browse! Data.Aeson took + 8 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] stderr: 
                <no location info>: error:
                Could not find module ‘Data.Aeson’
                Perhaps you meant Data.Version (from base-4.13.0.0)

4:25 p.m.   [global-stack-repl] Command :browse! GHC.Generics took + 93 ms

4:25 p.m.   [global-stack-repl] stdout: -- not currently imported
                (GHC.Generics.:*:) ::
                forall k (f :: k -> *) (g :: k -> *) (p :: k).
                f p -> g p -> (GHC.Generics.:*:) f g p
                type role (GHC.Generics.:*:) representational representational nominal
                data (GHC.Generics.:*:) (f :: k -> *) (g :: k -> *) (p :: k) = ...
                type role (GHC.Generics.:+:) representational representational nominal
                data (GHC.Generics.:+:) (f :: k -> *) (g :: k -> *) (p :: k) = ...
                type role (GHC.Generics.:.:) representational nominal nominal
                newtype (GHC.Generics.:.:) (f :: k2 -> *) (g :: k1 -> k2) (p :: k1)
                = ...
                data GHC.Generics.Associativity = ...
                data GHC.Generics.C
                type GHC.Generics.C1 =
                GHC.Generics.M1 GHC.Generics.C
                :: GHC.Generics.Meta -> (k -> *) -> k -> *
                GHC.Generics.Comp1 ::
                forall k2 k1 (f :: k2 -> *) (g :: k1 -> k2) (p :: k1).
                f (g p) -> (GHC.Generics.:.:) f g p
                class GHC.Generics.Constructor (c :: k)
                ...
                data GHC.Generics.D
                type GHC.Generics.D1 =
                GHC.Generics.M1 GHC.Generics.D
                :: GHC.Generics.Meta... (show balloon)

4:25 p.m.   [global-stack-repl] Command :browse! Control.Lens took + 8 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] stderr: 
                <no location info>: error:
                Could not find module ‘Control.Lens’
                It is not a module in the current program, or in any known package.

4:25 p.m.   [global-stack-repl] Command :browse! Data.Aeson.Encode took + 8 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] stderr: 
                <no location info>: error:
                Could not find module ‘Data.Aeson.Encode’
                It is not a module in the current program, or in any known package.

4:25 p.m.   [global-stack-repl] Command :browse! Control.Lens.Zoom took + 8 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] stderr: 
                <no location info>: error:
                Could not find module ‘Control.Lens.Zoom’
                It is not a module in the current program, or in any known package.

4:25 p.m.   [global-stack-repl] Command :browse! Control.Monad.Morph took + 9 ms

4:25 p.m.   [global-stack-repl] stdout: ^IntellijHaskell^

4:25 p.m.   [global-stack-repl] stderr: 
                <no location info>: error:
                Could not find module ‘Control.Monad.Morph’
                Perhaps you meant
                Control.Monad.Cont (from mtl-2.2.2)
                Control.Monad.Error (from mtl-2.2.2)
                Control.Monad.Zip (from base-4.13.0.0)

...
nhenin commented 4 years ago

I have created a simpler structure and I still have the problem : https://github.com/Eventuria/SimpleProject

rikvdkleij commented 4 years ago

Some feedback while I was creating that multiProjectExample... I had to do a stack build in the terminal before being able to correctly setups things in Intellij... Basically Generating the cabal files with stack in the terminal ... Are you not supporting the use of package.yaml files ?

Yes, they are supported because stack creates the cabal files as you mentioned. But normally the stack.yaml file only contains a couple of references to cabal files/projects....

I'm not using cabal files directly... I may have a configuration that you don't support with the plugin ? Because using stack in the terminal is always working...

Thanks for your example project! It works on my machine with the current master version...

rikvdkleij commented 4 years ago

@nhenin Can you try beta76?

nhenin commented 4 years ago

Yes it works now for SimpleProject and MultipleProject, not for my real project... I have this message :

1:03 a.m.   [project-stack-repl-LibType] REPL couldn't be started within 30 seconds

I'm trying to understand why the following is failing :

stack repl dolla-base:lib dolla-cli-client:lib dolla-consensus:lib dolla-consensus-broadcast:lib dolla-consensus-broadcast-proposal-merger:lib dolla-consensus-broadcast-settings:lib dolla-consensus-maestro:lib dolla-consensus-maestro-settings:lib dolla-consensus-orchestrator:lib dolla-consensus-orchestrator-settings:lib dolla-consensus-proposer:lib dolla-consensus-proposer-settings:lib dolla-consensus-receptionist:lib dolla-consensus-receptionist-settings:lib dolla-consensus-transaction:lib dolla-consensus-transaction-settings:lib dolla-osprey:lib dolla-osprey-settings:lib dolla-zeus:lib --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1

why are you using the option --silent ? Can I remove it ?

It was hidding an error that I have never seen so far ....

* * * * * * * *

Error: Multiple files use the same module name:
       * Dolla.Consensus.Broadcast.Proposal.Algorithm.Settings found at the following paths
         * /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast-settings/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/Settings.hs (dolla-consensus-broadcast-settings:lib)
         * /Users/nhenin/dev/consortium/src/dolla-consensus-broadcast/lib/Dolla/Consensus/Broadcast/Proposal/Algorithm/Settings.hs (dolla-consensus-broadcast:lib)
* * * * * * * *

Everything works now !!! :-)

P.S : Intellij asked to add the stack binary path to PATH, do you have an explanation in the README for it ? It could be useful for users if it can't be avoided...

rikvdkleij commented 4 years ago

Great to hear that everything works now!

why are you using the option --silent ? Can I remove it ?

To reduce the GHC output and i think the reason was to make parsing the output easier. I will reconsider this option. You can not remove it.

P.S : Intellij asked to add the stack binary path to PATH, do you have an explanation in the README for it ? It could be useful for users if it can't be avoided...

This change is since beta76 and i still have to update the README.

It was hidding an error that I have never seen so far ....

Weird that you did not notice this issue when not using IntelliJ 😄

nhenin commented 4 years ago

Weird that you did not notice this issue when not using IntelliJ 😄

Yeah It's weird :-), Thanks for the help, it's been really appreciated...