Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
binary
Commits
cb84b16a
Commit
cb84b16a
authored
6 years ago
by
Lennart Kolmodin
Browse files
Options
Downloads
Patches
Plain Diff
Add docker-compose.yml to run tests on multiple ghc versions.
parent
6ef8384e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker-compose.yml
+68
-0
68 additions, 0 deletions
docker-compose.yml
docker/Dockerfile.anyghc
+101
-0
101 additions, 0 deletions
docker/Dockerfile.anyghc
docker/Dockerfile.ghc843
+1
-1
1 addition, 1 deletion
docker/Dockerfile.ghc843
with
170 additions
and
1 deletion
docker-compose.yml
0 → 100644
+
68
−
0
View file @
cb84b16a
version
:
'
3'
services
:
binary_ghc843
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.ghc843
args
:
-
ghcver=8.4.3
volumes
:
-
cabal-store-cache:/root/.cabal/store
binary_ghc822
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.anyghc
args
:
-
ghcver=8.2.2
volumes
:
-
cabal-store-cache:/root/.cabal/store
binary_ghc802
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.anyghc
args
:
-
ghcver=8.0.2
volumes
:
-
cabal-store-cache:/root/.cabal/store
binary_ghc7103
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.anyghc
args
:
-
ghcver=7.10.3
volumes
:
-
cabal-store-cache:/root/.cabal/store
binary_ghc784
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.anyghc
args
:
-
ghcver=7.8.4
volumes
:
-
cabal-store-cache:/root/.cabal/store
binary_ghc763
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.anyghc
args
:
-
ghcver=7.6.3
volumes
:
-
cabal-store-cache:/root/.cabal/store
binary_ghc742
:
build
:
context
:
.
dockerfile
:
docker/Dockerfile.anyghc
args
:
-
ghcver=7.4.2
volumes
:
-
cabal-store-cache:/root/.cabal/store
volumes
:
cabal-store-cache
:
driver
:
local
This diff is collapsed.
Click to expand it.
docker/Dockerfile.anyghc
0 → 100644
+
101
−
0
View file @
cb84b16a
# Dockerfile to load a haskell environment for running binary's test suite.
#
# Building the Dockerfile creates an image which has the haskell environment
# with ghc and cabal setup and ready to use.
#
# Use a docker volume to cache built dependencies. It will greatly speed up
# running the tests repeatedly.
#
# Create a volume:
#
# docker volume create cabal-store-cache
#
# How to build:
#
# docker build \
# -f docker/Dockerfile.ghc843 \
# -t haskell/binary \
# --build-arg ghcver=8.4.2 \
# .
#
# How to run (caching the cabal store directory), default is 'cabal new-test':
#
# docker run -it haskell/binary -v cabal-store-cache:/root/.cabal/store
#
# Run 'cabal new-bench' or any other command (bash, to get into the machine):
#
# docker run -it haskell/binary -v cabal-store-cache:/root/.cabal/store \
# cabal new-bench
#
# Hacks to build binary:
#
# 1) Copy all files from the host machine.
#
# 2) Rename binary to binary-next. This is an unfortunate consequence of
# binary being used by its test and benchmark dependencies.
# Not renaming binary will make cabal confused and it'll fail to build.
#
# Cabal can be made to build properly by carefully installing the test
# and benchmark dependencies manually, like it's done in .travis.yml.
# Unfortunately that setup is very fragile since changing the
# dependencies in binary.cabal also requires updating .travis.yml.
# Thus .travis.yml gets out of sync when we forget.
# This method also doesn't work with the nix-style commands which
# themselves take care of installing dependencies.
# The simples workaround I've found, and the only thing that works
# with nix-style commands, is to simply rename the package
#
# 3) Do 'cabal sdist' to get only the files for source distribution.
#
# 4) Unpack the .tar.gz file from (3) and copy generics-bench.cache.gz
# to the same dir.
#
# 5) The setup is complete. You may run cabal new-test,
# or any other command.
#
FROM debian:stable
# setup locale.
# not setting a locale will make some apps fail when outputting utf8.
RUN apt-get update && \
apt-get install -y locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8 && \
apt-get remove -y locales
ENV LANG C.UTF-8
# key used by haskell repo
RUN apt-get update && apt-get install -y gnupg dirmngr
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574
# add haskell repo for debian
RUN echo "deb http://downloads.haskell.org/debian stretch main" > /etc/apt/sources.list.d/haskell.list
ARG ghcver=8.4.3
RUN apt update && apt install -y cabal-install-2.2
RUN apt update && apt install -y ghc-$ghcver
RUN apt update && apt-get install -y zlib1g-dev
ENV PATH=/opt/ghc/bin:$PATH
RUN cabal update
COPY . /workdir/copy
WORKDIR /workdir/copy
RUN sed -i.bak -e 's/name:\s*binary/name: binary-next/' binary.cabal
RUN mv binary.cabal binary-next.cabal
RUN cabal sdist
WORKDIR /workdir/builddir
RUN tar xf /workdir/copy/dist/*.tar.gz -C /workdir/builddir
RUN mv /workdir/builddir/binary-* /workdir/builddir/binary-next
# generics-bench.cache.gz is not part of the binary distribution,
# it's too large. It only lives in the git repo. Copy it manually.
RUN mv /workdir/copy/generics-bench.cache.gz /workdir/builddir/binary-next
WORKDIR /workdir/builddir/binary-next
CMD cabal new-test
This diff is collapsed.
Click to expand it.
docker/Dockerfile.ghc843
+
1
−
1
View file @
cb84b16a
...
...
@@ -52,7 +52,7 @@
FROM debian:stable
# setup locale
, US English with UTF-8
.
# setup locale.
# not setting a locale will make some apps fail when outputting utf8.
RUN apt-get update && \
apt-get install -y locales && \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment