Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No compiler found in docker #13

Closed
jbrodriguez opened this issue Aug 29, 2020 · 2 comments
Closed

No compiler found in docker #13

jbrodriguez opened this issue Aug 29, 2020 · 2 comments

Comments

@jbrodriguez
Copy link

jbrodriguez commented Aug 29, 2020

Hi, every time I run the docker container I get this error

No compiler found, expected minor version match with ghc-8.6.5 (x86_64-tinfo6) (based on resolver setting in /root/.stack/global-project/stack.yaml).
To install the correct GHC into /root/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag. To use your system GHC installation, run "stack config set system-ghc --global true", or use the "--system-ghc" flag.

I run stack setup and all is well.

Any idea how to make it permanent ?

@adept
Copy link
Owner

adept commented Sep 3, 2020

Hi! So docker container does have the GHC installed:

I have no name!@df5a0ff4391a:/full-fledged-hledger$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3

To the best of my knowledge, all the stack-based scripts in full-fledged-hledger repo are written in the way to expect this version of ghc and work with it. Can you please tell me more about the command you are running immediately before getting this error, and if you are running a haskell script, then what is the first couple of lines from it?

For example, for export.hs these lines are:

#!/usr/bin/env stack
-- stack --resolver lts-15.4 script --package shake --package directory

The crucial bit here is --resolver lts-15.4, which will determine which compiler is going to be used to build the script

@jbrodriguez
Copy link
Author

jbrodriguez commented Sep 3, 2020

Hi, thanks for the reply !

❯ docker container run --rm -it \
      --user (id --user):(id --group) \
      --name hledger \
      -p 5000:5000 \
      -v /mnt/storage/hledger/finances:/full-fledged-hledger \
      dastapov/full-fledged-hledger:latest

I have no name!@50c7890728c1:/full-fledged-hledger$ ./export.sh
No compiler found, expected minor version match with ghc-8.6.5 (x86_64-tinfo6) (based on resolver setting in /root/.stack/global-project/stack.yaml).
To install the correct GHC into /root/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag. To use your system GHC installation, run "stack config set system-ghc --global true", or use the "--system-ghc" flag.
I have no name!@50c7890728c1:/full-fledged-hledger$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
I have no name!@50c7890728c1:/full-fledged-hledger$ cat ./export.sh
#!/bin/bash
$(dirname $0)/export/export.hs -C $(dirname $0)/export -j --color "$@"
I have no name!@50c7890728c1:/full-fledged-hledger$ head ./export/export.hs
#!/usr/bin/env stack
-- stack --resolver lts-14.3 runghc --package shake --package directory
import Development.Shake
import Development.Shake.FilePath
import Data.List
import Text.Printf
import Control.Monad
import System.IO
import System.Directory as D

I have no name!@50c7890728c1:/full-fledged-hledger$ 

These are the commands I'm running, so I guess I need to change export.hs to use --resolver lts-15.4 right ?

EDIT:
I made that change and it works perfectly now, thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants