I have created a docker image with based on fpco/stack-build with GHCJS 
installed and known to stack.

I have a project which I am able to build with ghcjs by copying the project 
into the docker container and running stack build.

However, if I try to build the project locally (with the appropriate docker 
section added to the stack.yaml) it complains that it can't find the ghcjs 
It is as if it is looking for the compiler locally instead of in the 
Is the intended behaviour or what am I doing wrong? 

*Further details:*

The Dockerfile I used to build my image was as follows:

FROM fpco/stack-build:lts-7.0
MAINTAINER Casper Clemence  <maninal...@gmail.com>

# install ghcj
COPY "ghcjs/ghc-8.0-2016-09-14-lts-7.0-9007000.tar.gz" "/root/"
ADD ghcjs-build /root/ghcjs-build
RUN cd /root/ghcjs-build && stack setup
RUN rm -rf /root/ghcjs-build

# install Google Closure compiler
RUN sudo apt-get update
RUN sudo apt-get install closure-compiler -y

The tar file is downloaded from 
http://tolysz.org/ghcjs/ghc-8.0-2016-09-14-lts-7.0-9007000.tar.gz (my starting 
point has been https://github.com/tolysz/spock-ghcjs-sample).

The directory ghcjs-build contains nothing but a stack.yaml file, the 
contents of which are:

resolver: lts-7.0
compiler: ghcjs-
compiler-check: match-exact

         url: "/root/ghc-8.0-2016-09-14-lts-7.0-9007000.tar.gz"

The stack.yaml for the project itself looks like:

resolver: lts-7.0
compiler: ghcjs-
compiler-check: match-exact

allow-newer: true

    enable: true
    repo: "maninalift/stack-ghcjs-build"
    auto-pull: true
- '../project-api/'
- '.'
- location:
     git: https://github.com/agrafix/Spock
     commit: 77333a2de5dea0dc8eba9432ab16864e93e5d70e
  extra-dep: true
    - Spock-api
    - Spock-api-ghcjs
    - reroute

- ghcjs-dom-
- ghcjs-dom-jsffi-
- rawstring-qm-

By copying the project into a docker container created from the image 
maninalift/stack-ghcjs-build and deleting the docker section of the 
stack.yaml file, I can build the project.

If however I try to build the project locally I get the following error:

No compiler found, expected exact version ghcjs- (
x86_64) (based on resolver setting in /home/caz/repos/pets/xweb/site/project
Try running "stack setup" to install the correct GHC into /home/caz/.stack/

Am I just misunderstanding the design of stack when I expect it to detect 
ghcjs inside the docker container? I'd really like users of the repository 
to be able to download the docker image and start building the project 
without building ghcjs.

Thank you all for your attention.

You received this message because you are subscribed to the Google Groups 
"haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haskell-stack+unsubscr...@googlegroups.com.
To post to this group, send email to haskell-stack@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to