'howto prebuild on gitpod with haskell and stack
I have checked out https://github.com/gitpod-io/template-haskell and merged samples for a book (haskell in depth) into my branch.
Prebuilding has no effect, every opening of a workspace begins the entire build process from the beginning. So gitpod is effectively unusable for this project, as Zou have to wait for the entire build to complete, before ou can start using the workspace.
I presume the reason might be, that stack build stores the build artefacts in ~/.stack and that location is not part of the workspace, so it's lost when the workspace is closed.
Is that right? And then, how to keep the build result alive?
Solution 1:[1]
I just started using Gitpod so I'm not sure if there's a better way to do this, but I was able to get pretty close to what I wanted out of a prebuild by specifying a base dockerfile by putting this in my gitpod.yml
:
image:
file: .gitpod.Dockerfile
and then creating a .gitpod.Dockerfile
that starts with
FROM gitpod/workspace-full
and then install ghcup
and use it to install my other dependencies:
RUN curl --proto 'https' -tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ./ghcup
RUN chmod 755 ./ghcup
RUN sudo mv ./ghcup /usr/local/bin
RUN ghcup install ghc
RUN ghcup install cabal
RUN ghcup install hls
RUN ghcup install stack
RUN sudo ln -s /home/gitpod/.ghcup/bin/stack /usr/local/bin/stack
RUN stack install ghcid
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | John |