CircleCI: Add configurations for Centos 7 and Debian 9
authorBen Gamari <ben@smart-cactus.org>
Sat, 8 Dec 2018 01:23:58 +0000 (20:23 -0500)
committerBen Gamari <ben@smart-cactus.org>
Tue, 11 Dec 2018 15:03:40 +0000 (10:03 -0500)
.circleci/config.yml
.circleci/images/i386-linux-deb8/Dockerfile [moved from .circleci/images/i386-linux/Dockerfile with 100% similarity]
.circleci/images/update-image
.circleci/images/x86_64-linux-centos7/Dockerfile [new file with mode: 0644]
.circleci/images/x86_64-linux-deb8/Dockerfile [moved from .circleci/images/x86_64-linux/Dockerfile with 100% similarity]
.circleci/images/x86_64-linux-deb9/Dockerfile [new file with mode: 0644]
.circleci/images/x86_64-linux-fedora27/Dockerfile [moved from .circleci/images/x86_64-linux-fedora/Dockerfile with 100% similarity]
.gitlab-ci.yml

index eaac945..8eb1362 100644 (file)
@@ -108,14 +108,42 @@ aliases:
         only: /^ghc-.*/
 
 jobs:
-  "validate-x86_64-linux":
+  "validate-x86_64-freebsd":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.8
+      - image: ghcci/x86_64-freebsd
     environment:
+      TARGET: FreeBSD
       <<: *buildenv
-      GHC_COLLECTOR_FLAVOR: x86_64-linux
-      TEST_ENV: x86_64-linux
+      GHC_COLLECTOR_FLAVOR: x86_64-freebsd
+      TEST_ENV: x86_64-freebsd
+    steps:
+      - checkout
+      - *set_git_identity
+      - *prepare
+      - *submodules
+      - *boot
+      - *configure_bsd
+      - *make
+      - *bindist
+      - *store_bindist
+      - *test
+      - *store_test_results
+      - *store_test_artifacts
+      - *push_perf_note
+
+  "validate-x86_64-darwin":
+    macos:
+      xcode: "9.0"
+    environment:
+      # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
+      BUILD_SPHINX_PDF: "NO"
+      MACOSX_DEPLOYMENT_TARGET: "10.7"
+      # Only Sierra and onwards supports clock_gettime. See #12858
+      ac_cv_func_clock_gettime: "no"
+      GHC_COLLECTOR_FLAVOR: x86_64-darwin
+      <<: *buildenv
+      TEST_ENV: x86_64-darwin
     steps:
       - checkout
       - *set_git_identity
@@ -131,22 +159,21 @@ jobs:
       - *store_test_artifacts
       - *push_perf_note
 
-  "validate-x86_64-freebsd":
+  "validate-x86_64-linux-deb8":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-freebsd
+      - image: ghcci/x86_64-linux-deb8:0.1
     environment:
-      TARGET: FreeBSD
       <<: *buildenv
-      GHC_COLLECTOR_FLAVOR: x86_64-freebsd
-      TEST_ENV: x86_64-freebsd
+      GHC_COLLECTOR_FLAVOR: x86_64-linux
+      TEST_ENV: x86_64-linux-deb8
     steps:
       - checkout
       - *set_git_identity
       - *prepare
       - *submodules
       - *boot
-      - *configure_bsd
+      - *configure_unix
       - *make
       - *bindist
       - *store_bindist
@@ -155,18 +182,14 @@ jobs:
       - *store_test_artifacts
       - *push_perf_note
 
-  "validate-x86_64-darwin":
-    macos:
-      xcode: "9.0"
+  "validate-x86_64-linux-deb9":
+    resource_class: xlarge
+    docker:
+      - image: ghcci/x86_64-linux-deb9:0.1
     environment:
-      # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
-      BUILD_SPHINX_PDF: "NO"
-      MACOSX_DEPLOYMENT_TARGET: "10.7"
-      # Only Sierra and onwards supports clock_gettime. See #12858
-      ac_cv_func_clock_gettime: "no"
-      GHC_COLLECTOR_FLAVOR: x86_64-darwin
       <<: *buildenv
-      TEST_ENV: x86_64-darwin
+      GHC_COLLECTOR_FLAVOR: x86_64-linux-deb9
+      TEST_ENV: x86_64-linux
     steps:
       - checkout
       - *set_git_identity
@@ -182,10 +205,10 @@ jobs:
       - *store_test_artifacts
       - *push_perf_note
 
-  "validate-hadrian-x86_64-linux":
+  "validate-hadrian-x86_64-linux-deb8":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.8
+      - image: ghcci/x86_64-linux-deb8:0.1
     environment:
       <<: *buildenv
     steps:
@@ -197,13 +220,13 @@ jobs:
       - *configure_unix
       - *build_hadrian
 
-  "validate-x86_64-linux-unreg":
+  "validate-x86_64-linux-deb8-unreg":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.8
+      - image: ghcci/x86_64-linux-deb8:0.1
     environment:
       <<: *buildenv
-      TEST_ENV: x86_64-linux-unreg
+      TEST_ENV: x86_64-linux-deb8-unreg
     steps:
       - checkout
       - *set_git_identity
@@ -217,14 +240,14 @@ jobs:
       - *push_perf_note
       - *store_test_artifacts
 
-  "validate-x86_64-linux-llvm":
+  "validate-x86_64-linux-deb8-llvm":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.8
+      - image: ghcci/x86_64-linux-deb8:0.1
     environment:
       <<: *buildenv
       BUILD_FLAVOUR: perf-llvm
-      TEST_ENV: x86_64-linux-llvm
+      TEST_ENV: x86_64-linux-deb8-llvm
     steps:
       - run:
           name: Install LLVM
@@ -247,14 +270,14 @@ jobs:
       - *push_perf_note
 
   # Nightly build with -DDEBUG using devel2 flavour
-  "validate-x86_64-linux-debug":
+  "validate-x86_64-linux-deb8-debug":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.8
+      - image: ghcci/x86_64-linux-deb8:0.1
     environment:
       BUILD_FLAVOUR: devel2
       <<: *buildenv
-      TEST_ENV: x86_64-linux-debug
+      TEST_ENV: x86_64-linux-deb8-debug
       SKIP_PERF_TESTS: YES
     steps:
       - checkout
@@ -269,14 +292,37 @@ jobs:
       - *store_test_artifacts
       - *push_perf_note
 
-  "validate-i386-linux":
+  "validate-i386-linux-deb9":
+    resource_class: xlarge
+    docker:
+      - image: ghcci/i386-linux-deb9:0.1
+    environment:
+      <<: *buildenv
+      GHC_COLLECTOR_FLAVOR: i386-linux-deb9
+      TEST_ENV: i386-linux-deb9
+    steps:
+      - checkout
+      - *set_git_identity
+      - *prepare
+      - *submodules
+      - *boot
+      - *configure_unix_32
+      - *make
+      - *bindist
+      - *store_bindist
+      - *test
+      - *store_test_results
+      - *store_test_artifacts
+      - *push_perf_note
+
+  "validate-i386-linux-deb8":
     resource_class: xlarge
     docker:
-      - image: ghcci/i386-linux:0.0.7
+      - image: ghcci/i386-linux-deb8:0.1
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: i386-linux
-      TEST_ENV: i386-linux
+      TEST_ENV: i386-linux-deb8
     steps:
       - checkout
       - *set_git_identity
@@ -292,14 +338,40 @@ jobs:
       - *store_test_artifacts
       - *push_perf_note
 
-  "validate-x86_64-fedora":
+  "validate-x86_64-linux-centos7":
+    resource_class: xlarge
+    docker:
+      - image: ghcci/x86_64-linux-centos7:0.1
+    environment:
+      <<: *buildenv
+      GHC_COLLECTOR_FLAVOR: x86_64-centos7
+      LANG: en_US.UTF-8
+      TEST_ENV: x86_64-centos7
+      # Sphinx is too old
+      BUILD_SPHINX_PDF: NO
+    steps:
+      - checkout
+      - *set_git_identity
+      - *prepare
+      - *submodules
+      - *boot
+      - *configure_unix
+      - *make
+      - *bindist
+      - *store_bindist
+      - *test
+      - *store_test_results
+      - *store_test_artifacts
+      - *push_perf_note
+
+  "validate-x86_64-linux-fedora27":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux-fedora:0.0.17
+      - image: ghcci/x86_64-linux-fedora27:0.1
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: x86_64-fedora
-      TEST_ENV: x86_64-fedora
+      TEST_ENV: x86_64-linux-fedora27
     steps:
       - checkout
       - *set_git_identity
@@ -315,13 +387,13 @@ jobs:
       - *store_test_artifacts
       - *push_perf_note
 
-  "slow-validate-x86_64-linux":
+  "slow-validate-x86_64-linux-deb8":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.8
+      - image: ghcci/x86_64-linux-deb8:0.1
     environment:
       <<: *buildenv
-      GHC_COLLECTOR_FLAVOR: x86_64-linux
+      GHC_COLLECTOR_FLAVOR: x86_64-linux-deb8
     steps:
       - checkout
       - *prepare
@@ -338,17 +410,23 @@ workflows:
   version: 2
   validate:
     jobs:
-    - validate-x86_64-linux:
+    - validate-x86_64-linux-deb8:
         *trigger_on_tags
     # FreeBSD disabled: https://github.com/haskell/unix/issues/102
     # - validate-x86_64-freebsd
     - validate-x86_64-darwin:
         *trigger_on_tags
-    - validate-x86_64-linux-llvm
-    - validate-i386-linux:
+    - validate-x86_64-linux-deb8-llvm
+    - validate-i386-linux-deb8:
+        *trigger_on_tags
+    - validate-x86_64-linux-deb9:
+        *trigger_on_tags
+    - validate-i386-linux-deb9:
+        *trigger_on_tags
+    - validate-x86_64-linux-centos7:
         *trigger_on_tags
-    - validate-hadrian-x86_64-linux
-    - validate-x86_64-fedora:
+    - validate-hadrian-x86_64-linux-deb8
+    - validate-x86_64-linux-fedora27:
         *trigger_on_tags
 
   nightly:
@@ -360,10 +438,10 @@ workflows:
               only:
                 - master
     jobs:
-    - validate-x86_64-linux-unreg
-    - validate-x86_64-linux-llvm
-    - validate-x86_64-linux-debug
-    - slow-validate-x86_64-linux
+    - validate-x86_64-linux-deb8-unreg
+    - validate-x86_64-linux-deb8-llvm
+    - validate-x86_64-linux-deb8-debug
+    - slow-validate-x86_64-linux-deb8
 
 notify:
   webhooks:
index 5a3cae5..9900b35 100755 (executable)
@@ -17,13 +17,13 @@ fi
 name=$1
 version=$2
 
-versions="$(curl -s https://registry.hub.docker.com/v1/repositories/$repo/$name/tags | jq -r .[].name)"
-if echo "$versions" | grep $version > /dev/null; then
-    echo "Version $version of $name already exists"
-    echo "Previous versions are:"
-    echo "$versions"
-    exit 1
-fi
+#versions="$(curl -s https://registry.hub.docker.com/v1/repositories/$repo/$name/tags | jq -r .[].name)"
+#if echo "$versions" | grep $version > /dev/null; then
+#    echo "Version $version of $name already exists"
+#    echo "Previous versions are:"
+#    echo "$versions"
+#    exit 1
+#fi
 
 docker build $name -t $repo/$name:$version
 docker push $repo/$name:$version
diff --git a/.circleci/images/x86_64-linux-centos7/Dockerfile b/.circleci/images/x86_64-linux-centos7/Dockerfile
new file mode 100644 (file)
index 0000000..32acea5
--- /dev/null
@@ -0,0 +1,54 @@
+FROM centos:7
+
+ENV LANG C.UTF-8
+
+# Core build utilities
+RUN yum -y install coreutils binutils which git make \
+    automake autoconf gcc perl python3 texinfo xz lbzip2 \
+    patch openssh-clients sudo zlib-devel sqlite \
+    ncurses-compat-libs gmp-devel ncurses-devel gcc-c++ findutils \
+    curl wget jq
+
+# Python 3
+RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm; \
+    yum install -y python34u python34u-libs
+
+# Documentation tools
+RUN yum -y install python-sphinx \
+    texlive texlive-latex texlive-xetex \
+    texlive-collection-latex texlive-collection-latexrecommended \
+    texlive-xetex-def texlive-collection-xetex \
+    python-sphinx-latex dejavu-sans-fonts dejavu-serif-fonts \
+    dejavu-sans-mono-fonts
+
+# This is in the PATH when I ssh into the CircleCI machine but somehow
+# sphinx-build isn't found during configure unless we explicitly 
+# add it here as well; perhaps PATH is being overridden by CircleCI's
+# infrastructure?
+ENV PATH /usr/libexec/python3-sphinx:$PATH
+
+# systemd isn't running so remove it from nsswitch.conf
+# Failing to do this will result in testsuite failures due to
+# non-functional user lookup (#15230).
+RUN sed -i -e 's/systemd//g' /etc/nsswitch.conf
+
+# Install GHC and cabal
+RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-x86_64-deb8-linux.tar.xz | tar -Jx
+RUN cd /tmp/ghc-8.4.2 && ./configure --prefix=/opt/ghc/8.4.2
+RUN cd /tmp/ghc-8.4.2 && make install
+RUN mkdir -p /opt/cabal/bin
+RUN cd /opt/cabal/bin && curl https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-x86_64-unknown-linux.tar.gz | tar -zx
+ENV PATH /opt/ghc/8.4.2/bin:/opt/cabal/bin:$PATH
+
+# Create a normal user.
+RUN adduser ghc --comment "GHC builds"
+RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
+USER ghc
+WORKDIR /home/ghc/
+
+# Install Alex, Happy, and HsColor with Cabal
+RUN cabal update && \
+    cabal install hscolour happy alex
+ENV PATH /home/ghc/.cabal/bin:$PATH
+
+CMD ["bash"]
diff --git a/.circleci/images/x86_64-linux-deb9/Dockerfile b/.circleci/images/x86_64-linux-deb9/Dockerfile
new file mode 100644 (file)
index 0000000..6d14daa
--- /dev/null
@@ -0,0 +1,37 @@
+FROM debian:stretch
+
+ENV LANG C.UTF-8
+
+RUN apt-get update -qq; apt-get install -qy gnupg
+
+RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > /etc/apt/sources.list.d/ghc.list
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
+RUN apt-get update -qq
+
+# Core build utilities
+RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
+    ca-certificates g++ git make automake autoconf gcc \
+    perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
+    jq wget curl
+
+# Documentation tools
+RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
+
+# Basic Haskell toolchain
+RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2
+
+ENV PATH /home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
+
+# Create a normal user.
+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
+ENV PATH /home/ghc/.cabal/bin:$PATH
+
+WORKDIR /home/ghc/
+
+CMD ["bash"]
index f669788..b0cf24d 100644 (file)
@@ -22,7 +22,7 @@ before_script:
     key: hadrian
     paths:
       - cabal-cache
-  image: ghcci/x86_64-linux:0.0.8
+  image: ghcci/x86_64-linux-deb8:0.1
 
 .validate-x86_64-linux-hadrian:
   extends: .validate-hadrian
@@ -50,7 +50,7 @@ before_script:
     - |
       THREADS=`mk/detect-cpu-count.sh`
       make test THREADS=$THREADS JUNIT_FILE=../../junit.xml
-  image: ghcci/x86_64-linux:0.0.8
+  image: ghcci/x86_64-linux-deb8:0.1
   artifacts:
     when: always
     reports:
@@ -142,7 +142,7 @@ validate-x86_64-linux:
 ############################################################
 
 .circleci:
-  image: ghcci/x86_64-linux:0.0.8
+  image: ghcci/x86_64-linux-deb8:0.1
   artifacts:
     when: always
     reports: