You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~$ stack new foo
Downloading template "new-template" to create project "foo" in foo/ ...
[...]
Populated index cache.
* Matches lts-8.6
Selected resolver: lts-8.6
Initialising configuration using resolver: lts-8.6
Total number of user packages considered: 1
Writing configuration to file: foo/stack.yaml
All done.
~$ cd foo
~/foo$ du -sh .
28K .
Try to compile
~/foo$ stack build
Actual
Error message:
~/foo$ stack build
Compiler version mismatched, found ghc-8.0.1 (x86_64), but expected minor version match with ghc-8.0.2 (x86_64-ncurses6) (based on resolver setting in /home/sk/foo/stack.yaml).
To install the correct GHC into /home/sk/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag.
Expected
Compilation without errors, using system-global ghc. I would
have expected the resolver to resolve to something that matches the
system-global ghc.
Stack version
~$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.1
~$ stack --version | head -n1
Version 1.4.0 x86_64
~$ cabal --version
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library
I think this happens because your system-ghc is version 8.0.1 and stack resolver lts-8.6 requires 8.0.2.
As far as I know, there is no option to relax this constraint. There is a 'compiler-check: newer-minor' option that allows newer minor versions, but not older ones like in your case. Maybe such option should be added.
A better solution might be to use the '--resolver ghc-8.0.1' option when calling stack. Then it will use a stackage version that made for your ghc version.
General summary/comments (optional)
Stack does not use the system-global installed ghc but always tries to
install its own. Even when instructed otherwise.
This looks like a duplicate of #2842, but it is not related to #2852
because
~/.stack/config.yaml
containssystem-ghc: true
.Steps to reproduce
Instruct stack to use globally installed ghc
Verify:
Setup new project
Try to compile
Actual
Error message:
Expected
Compilation without errors, using system-global ghc. I would
have expected the resolver to resolve to something that matches the
system-global ghc.
Stack version
Method of installation
From the Arch Linux repositories https://www.archlinux.org/.
The text was updated successfully, but these errors were encountered: