[commit: ghc] master: gitlab-ci: Add LLVM way (f4ac0b0)

git at git.haskell.org git at git.haskell.org
Fri Dec 14 03:00:02 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f4ac0b0c73298de7a3223825274793215cbd2e86/ghc

>---------------------------------------------------------------

commit f4ac0b0c73298de7a3223825274793215cbd2e86
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Dec 13 00:26:59 2018 -0500

    gitlab-ci: Add LLVM way


>---------------------------------------------------------------

f4ac0b0c73298de7a3223825274793215cbd2e86
 .circleci/config.yml                          | 12 ++----------
 .circleci/images/update-image                 |  1 +
 .circleci/images/x86_64-linux-deb9/Dockerfile |  9 +++++++++
 .circleci/prepare-system.sh                   |  8 ++++++++
 .gitlab-ci.yml                                | 16 +++++++++++++---
 5 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index d455940..ed10d21 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -25,13 +25,6 @@ aliases:
       name: Boot
       command: |
         ./boot
-
-        cat <<EOF >> mk/build.mk
-        BuildFlavour=$BUILD_FLAVOUR
-        ifneq "\$(BuildFlavour)" ""
-        include mk/flavours/\$(BuildFlavour).mk
-        endif
-        EOF
   - &set_git_identity
       run:
         name: Set Git Identity
@@ -187,7 +180,7 @@ jobs:
   "validate-x86_64-linux-deb9-integer-simple":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux-deb9:0.1
+      - image: ghcci/x86_64-linux-deb9:0.2
     environment:
       <<: *buildenv
       INTEGER_LIBRARY: integer-simple
@@ -277,7 +270,6 @@ jobs:
       - run:
           name: Install LLVM
           command: |
-            curl http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC ..
             echo "export PATH=`pwd`/../clang+llvm-6.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV
       - run:
           name: Verify that llc works
@@ -320,7 +312,7 @@ jobs:
   "validate-i386-linux-deb9":
     resource_class: xlarge
     docker:
-      - image: ghcci/i386-linux-deb9:0.1
+      - image: ghcci/i386-linux-deb9:0.2
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: i386-linux-deb9
diff --git a/.circleci/images/update-image b/.circleci/images/update-image
index 9900b35..dd69122 100755
--- a/.circleci/images/update-image
+++ b/.circleci/images/update-image
@@ -30,4 +30,5 @@ docker push $repo/$name:$version
 
 repo_name="$repo/$name"
 sed -i -E -e "s%$repo_name"':[0-9]+(\.[0-9]+)*%'"$repo_name:$version%" ../config.yml
+sed -i -E -e "s%$repo_name"':[0-9]+(\.[0-9]+)*%'"$repo_name:$version%" ../../.gitlab-ci.yml
 echo "Built, pushed, and bumped $name:$version"
diff --git a/.circleci/images/x86_64-linux-deb9/Dockerfile b/.circleci/images/x86_64-linux-deb9/Dockerfile
index 6d14daa..5341abe 100644
--- a/.circleci/images/x86_64-linux-deb9/Dockerfile
+++ b/.circleci/images/x86_64-linux-deb9/Dockerfile
@@ -22,6 +22,15 @@ 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
 
+# LLVM
+ENV LLVM_TARBALL http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
+ENV PATH /opt/llvm/bin:$PATH
+RUN curl $LLVM_TARBALL | tar -xJC ..; \
+    mkdir /opt/llvm; \
+    cp -R clang+llvm*/* /opt/llvm; \
+    rm -R clang+llvm*; \
+    llc --version
+
 # Create a normal user.
 RUN adduser ghc --gecos "GHC builds" --disabled-password
 RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
diff --git a/.circleci/prepare-system.sh b/.circleci/prepare-system.sh
index d424243..804e0fd 100755
--- a/.circleci/prepare-system.sh
+++ b/.circleci/prepare-system.sh
@@ -12,6 +12,7 @@ hackage_index_state="@1522046735"
 if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi
 if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi
 if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
+if [[ -z ${BUILD_FLAVOUR:-} ]]; then BUILD_FLAVOUR=perf; fi
 
 cat > mk/build.mk <<EOF
 V=1
@@ -24,6 +25,13 @@ BeConservative=YES
 INTEGER_LIBRARY=$INTEGER_LIBRARY
 EOF
 
+cat <<EOF >> mk/build.mk
+BuildFlavour=$BUILD_FLAVOUR
+ifneq "\$(BuildFlavour)" ""
+include mk/flavours/\$(BuildFlavour).mk
+endif
+EOF
+
 case "$(uname)" in
   Linux)
     if [[ -n ${TARGET:-} ]]; then
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b4273c3..5af0b0c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -112,7 +112,17 @@ validate-x86_64-darwin:
 
 validate-x86_64-linux-deb9:
   extends: .validate-linux
-  image: ghcci/x86_64-linux-deb9:0.1
+  image: ghcci/x86_64-linux-deb9:0.2
+  artifacts:
+    when: always
+  cache:
+    key: linux-x86_64-deb9
+
+validate-x86_64-linux-deb9-llvm:
+  extends: .validate-linux
+  image: ghcci/x86_64-linux-deb9:0.2
+  variables:
+    BUILD_FLAVOUR: perf-llvm
   cache:
     key: linux-x86_64-deb9
 
@@ -136,7 +146,7 @@ validate-x86_64-linux-deb9-integer-simple:
   extends: .validate-linux
   variables:
     INTEGER_LIBRARY: integer-simple
-  image: ghcci/x86_64-linux-deb9:0.1
+  image: ghcci/x86_64-linux-deb9:0.2
   cache:
     key: linux-x86_64-deb9
 
@@ -144,7 +154,7 @@ validate-x86_64-linux-deb9-unreg:
   extends: .validate-linux
   variables:
     CONFIGURE_ARGS: --enable-unregisterised
-  image: ghcci/x86_64-linux-deb9:0.1
+  image: ghcci/x86_64-linux-deb9:0.2
   cache:
     key: linux-x86_64-deb9
 



More information about the ghc-commits mailing list