CircleCI: Clean up docker image
authorBen Gamari <ben@smart-cactus.org>
Sat, 24 Nov 2018 17:34:57 +0000 (12:34 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 24 Nov 2018 17:35:36 +0000 (12:35 -0500)
.circleci/config.yml
.circleci/images/x86_64-linux-fedora/Dockerfile
.circleci/images/x86_64-linux/Dockerfile
.circleci/prepare-system.sh

index 5e49cde..ebf5737 100644 (file)
@@ -110,7 +110,7 @@ jobs:
   "validate-x86_64-linux":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.4
+      - image: ghcci/x86_64-linux:0.0.5
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: x86_64-linux
@@ -181,7 +181,7 @@ jobs:
   "validate-hadrian-x86_64-linux":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.4
+      - image: ghcci/x86_64-linux:0.0.5
     environment:
       <<: *buildenv
     steps:
@@ -196,7 +196,7 @@ jobs:
   "validate-x86_64-linux-unreg":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.4
+      - image: ghcci/x86_64-linux:0.0.5
     environment:
       <<: *buildenv
       TEST_ENV: x86_64-linux-unreg
@@ -215,7 +215,7 @@ jobs:
   "validate-x86_64-linux-llvm":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.4
+      - image: ghcci/x86_64-linux:0.0.5
     environment:
       <<: *buildenv
       BUILD_FLAVOUR: perf-llvm
@@ -243,7 +243,7 @@ jobs:
   "validate-x86_64-linux-debug":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.4
+      - image: ghcci/x86_64-linux:0.0.5
     environment:
       BUILD_FLAVOUR: devel2
       <<: *buildenv
@@ -308,7 +308,7 @@ jobs:
   "slow-validate-x86_64-linux":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.4
+      - image: ghcci/x86_64-linux:0.0.5
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: x86_64-linux
index f60398d..959231b 100644 (file)
@@ -42,8 +42,7 @@ USER ghc
 WORKDIR /home/ghc/
 
 # Install Alex, Happy, and HsColor with Cabal
-RUN cabal update
-RUN cabal install alex happy hscolour
+RUN cabal update && cabal install alex happy hscolour
 ENV PATH /home/ghc/.cabal/bin:$PATH
 
 CMD ["bash"]
index f68c7e6..9fe713e 100644 (file)
@@ -7,23 +7,15 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
 RUN apt-get update -qq
 
 # Core build utilities
-RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2 happy alex zlib1g-dev \
-    libtinfo-dev libsqlite3-0 libsqlite3-dev ca-certificates g++ git curl \
-    git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 \
-    patch openssh-client sudo
+RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev
+    ca-certificates g++ git curl make automake autoconf gcc
+    perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo
 
 # Documentation tools
 RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
 
-# Stack intallation
-RUN curl -fSL https://github.com/commercialhaskell/stack/releases/download/v1.6.5/stack-1.6.5-linux-x86_64-static.tar.gz -o stack.tar.gz
-RUN curl -fSL https://github.com/commercialhaskell/stack/releases/download/v1.6.5/stack-1.6.5-linux-x86_64-static.tar.gz.asc -o stack.tar.gz.asc
-RUN export GNUPGHOME="$(mktemp -d)"
-RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys C5705533DA4F78D8664B5DC0575159689BEFB442
-RUN gpg --batch --verify stack.tar.gz.asc stack.tar.gz
-RUN tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1
-RUN /usr/local/bin/stack config set system-ghc --global true
-RUN rm -rf "$GNUPGHOME" /var/lib/apt/lists/* /stack.tar.gz.asc /stack.tar.gz
+# Basic Haskell toolchain
+RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2
 
 ENV PATH /home/ghc/.cabal/bin:/home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
 
@@ -32,6 +24,10 @@ RUN adduser ghc --gecos "GHC builds" --disabled-password
 RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
 USER ghc
 
+# Build Haskell tools
+RUN cabal update && \
+    cabal install hscolour happy alex
+
 WORKDIR /home/ghc/
 
 CMD ["bash"]
index 4be1b64..9a16c01 100755 (executable)
@@ -27,15 +27,6 @@ case "$(uname)" in
     if [[ -n ${TARGET:-} ]]; then
       if [[ $TARGET = FreeBSD ]]; then
         # cross-compiling to FreeBSD
-        add-apt-repository -y ppa:hvr/ghc
-        apt-get update -qq
-        apt-get install -qy ghc-8.0.2 cabal-install-1.24 alex happy \
-                            ncurses-dev git make automake autoconf gcc perl \
-                            python3 texinfo xz-utils lbzip2 patch
-        cabal update
-        cabal install --reinstall hscolour --index-state=$hackage_index_state
-        ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour
-
         echo 'HADDOCK_DOCS = NO' >> mk/build.mk
         echo 'WERROR=' >> mk/build.mk
         # https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
@@ -43,10 +34,6 @@ case "$(uname)" in
       else
         fail "TARGET=$target not supported"
       fi
-    else
-      cabal update
-      cabal install --reinstall hscolour
-      sudo ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour || true
     fi
     ;;