Open hasufell opened 6 years ago
This is a bug with upstream intero, you may want to post an issue there.
That you have multiple versions of containers
is troubling.
That you have multiple versions of containers is troubling.
Well, that's stacks problem not mine. I'm not manually installing random libraries. That's all stacks doing.
Can you post the resolver you're using? I'm curious if I can reproduce the issue locally.
resolver: lts-11.13
extra-deps:
- happy-1.19.9@rev:2
- containers-0.5.11.0
- IfElse-0.85
compiler: ghc-8.2.2
compiler-check: match-exact
The problem is that you're specifying a newer containers
than is compatible with the GHC version you're using. This is OK as long as nothing else in the dependency tree depends on GHC as a library, which intero
does. containers-0.5.11.0
is intended for use with GHC 8.4.
That sounds like a bug.
It's an unfortunate downside of how dependencies are managed with GHC. This comment has more explanation and information, and the issue thread contains more of the trade-offs.
In short, you can't depend on containers-0.5.11.0
and also depend on a package bundled with GHC 8.2.2 because GHC 8.2.2 requires containers-0.5.10
explicitly, and GHC comes with it's own version of containers
.
As a workaround, you can either use ghc-8.4.3
and containers-0.5.11.0
(now available as part of the lts-12
resolver), or you can use ghc-8.2.2
and the older containers
.
Or, as a third workaround (this may or may not work), you can comment out the containers
extra-dep, do stack build intero
to copy the executable to your project, and then uncomment the containers
extra-dep. This will build intero
executable with the appropriate containers
for the GHC version you're using, and then let you use the newer containers
in your library.
intero-neovim can copy what the emacs package does for this: https://github.com/chrisdone/intero/blob/60e2e3f76f647b20d9de8418f9576ea157e21864/elisp/intero.el#L2224..L2231
(let ((default-directory (make-temp-file "intero" t)))
(intero-call-stack
nil (current-buffer) t nil "build"
"--copy-compiler-tool"
(concat "intero-" intero-package-version)
"--flag" "haskeline:-terminfo"
"--resolver" (concat "ghc-" ghc-version)
"ghc-paths-0.1.0.9" "mtl-2.2.2" "network-2.7.0.0" "random-1.1" "syb-0.7"))
--copy-compiler-tool
so that it's only built once for that GHC version and will be available in any project with that GHC version.fantastic, thank you! :smile:
@hasufell I am going to edit the title to make it more clear what the problem is.
thanks @chrisdone
On startup, just fails.