haskell / docker-haskell

MIT License
63 stars 36 forks source link

No compiler found, expected minor version match with ghc-8.10.4 (x86_64-tinfo6) #35

Closed stereobooster closed 3 years ago

stereobooster commented 3 years ago

Hi. Thanks for maintaining this repo. I have following Dockerfile:

## Dockerfile for a haskell environment
FROM haskell:8

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
    && apt-get -y install --no-install-recommends apt-utils 2>&1

# Install haskell ide engine dependencies
RUN apt-get -y install libicu-dev libtinfo-dev libgmp-dev zlib1g-dev
RUN stack config set system-ghc --global true
RUN stack install --system-ghc hls

# Clean up
RUN apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

# Set the default shell to bash rather than sh
ENV SHELL /bin/bash

When I build image I get this error:

 => CACHED [4/7] RUN stack config set system-ghc --global true                                                                                                                                         0.0s
 => ERROR [5/7] RUN stack install --system-ghc hls                                                                                                                                                     2.0s
------
 > [5/7] RUN stack install --system-ghc hls:
#8 0.443 Writing implicit global project config file to: /root/.stack/global-project/stack.yaml
#8 0.444 Note: You can change the snapshot via the resolver field there.
#8 1.138 Using latest snapshot resolver: lts-17.7
#8 1.905 No compiler found, expected minor version match with ghc-8.10.4 (x86_64-tinfo6) (based on resolver setting in /root/.stack/global-project/stack.yaml).
#8 1.905 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 can workaround this issue by installing 8.4.10 ghc via stack, but it would be nice if this would work out of the box.

AlistairB commented 3 years ago

Hi,

I just did a quick test and this is failing with a different error. Regardless, I believe you error was because you only requested haskell:8 and probably had 8.8 cached. If you instead specify haskell:8.10 all the GHC versions should match and you will get past this point.

Cheers

stereobooster commented 3 years ago

Hey,

thanks for an advice. I was able to workaround it (when I opened ticket), it just wasn't a bit unclear why it doesn't work out of the box.