All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Doug Goldstein <cardoe@cardoe.com>, Wei Liu <wl@xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v4] automation: add clang and lld 8 tests to gitlab
Date: Mon, 10 Jun 2019 18:32:46 +0200	[thread overview]
Message-ID: <20190610163246.90567-1-roger.pau@citrix.com> (raw)

Using clang and lld 8 requires installing the packages from the
official llvm apt repositories, so modify the Debian Docker files for
stretch and unstable to add the llvm repo and install clang and lld
from it.

Also add some jobs to test building Xen with clang 8 and lld.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
I've tested this manually by doing:

# make -C automation/build debian/stretch
# CONTAINER_NO_PULL=1 ./automation/scripts/containerize << END
./configure --with-system-seabios=/usr/share/seabios/bios.bin \
            --with-system-ipxe=/usr/lib/ipxe/ipxe.pxe --disable-stubdom
make -j8 dist CC=clang-8 CXX=clang++-8 LD=ld.lld-8 clang=y
END
---
Cc: Doug Goldstein <cardoe@cardoe.com>
Cc: Wei Liu <wl@xen.org>
---
Changes since v3:
 - Add a -8 prefix to the llvm apt repo file.
 - Add spaces around apt-key add pipe.

Changes since v2:
 - Change the order of actions in the dockerfile.
 - Cleanup after installing llvm tools.

Changes since v1:
 - Use ld.lld-8 instead of lld-8, as that's the recommended way
   reported by lld-8.
---
 automation/build/debian/stretch-llvm-8.list  |  3 ++
 automation/build/debian/stretch.dockerfile   | 13 +++++++
 automation/build/debian/unstable-llvm-8.list |  3 ++
 automation/build/debian/unstable.dockerfile  | 13 +++++++
 automation/gitlab-ci/build.yaml              | 37 ++++++++++++++++++++
 automation/scripts/build                     |  2 +-
 6 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 automation/build/debian/stretch-llvm-8.list
 create mode 100644 automation/build/debian/unstable-llvm-8.list

diff --git a/automation/build/debian/stretch-llvm-8.list b/automation/build/debian/stretch-llvm-8.list
new file mode 100644
index 0000000000..09fe843fb2
--- /dev/null
+++ b/automation/build/debian/stretch-llvm-8.list
@@ -0,0 +1,3 @@
+# Strech LLVM 8 repos
+deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main
+deb-src http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main
diff --git a/automation/build/debian/stretch.dockerfile b/automation/build/debian/stretch.dockerfile
index daf8c9d384..44e6eee07f 100644
--- a/automation/build/debian/stretch.dockerfile
+++ b/automation/build/debian/stretch.dockerfile
@@ -42,6 +42,19 @@ RUN apt-get update && \
         wget \
         git \
         nasm \
+        gnupg \
+        && \
+        apt-get autoremove -y && \
+        apt-get clean && \
+        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
+
+RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
+COPY stretch-llvm-8.list /etc/apt/sources.list.d/
+
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        clang-8 \
+        lld-8 \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/build/debian/unstable-llvm-8.list b/automation/build/debian/unstable-llvm-8.list
new file mode 100644
index 0000000000..dc119fa0b4
--- /dev/null
+++ b/automation/build/debian/unstable-llvm-8.list
@@ -0,0 +1,3 @@
+# Unstable LLVM 8 repos
+deb http://apt.llvm.org/unstable/ llvm-toolchain-8 main
+deb-src http://apt.llvm.org/unstable/ llvm-toolchain-8 main
diff --git a/automation/build/debian/unstable.dockerfile b/automation/build/debian/unstable.dockerfile
index 7762cf97ab..a1428a3df0 100644
--- a/automation/build/debian/unstable.dockerfile
+++ b/automation/build/debian/unstable.dockerfile
@@ -42,6 +42,19 @@ RUN apt-get update && \
         wget \
         git \
         nasm \
+        gnupg \
+        && \
+        apt-get autoremove -y && \
+        apt-get clean && \
+        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
+
+RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -
+COPY unstable-llvm-8.list /etc/apt/sources.list.d/
+
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        clang-8 \
+        lld-8 \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index dd5722a5bb..17de3b1848 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -26,6 +26,13 @@
     CXX: clang++
     clang: y
 
+.clang-8-tmpl:
+  variables: &clang-8
+    CC: clang-8
+    CXX: clang++-8
+    LD: ld.lld-8
+    clang: y
+
 .x86-64-build-tmpl:
   <<: *build
   variables:
@@ -90,6 +97,16 @@
   variables:
     <<: *clang
 
+.clang-8-x86-64-build:
+  extends: .x86-64-build
+  variables:
+    <<: *clang-8
+
+.clang-8-x86-64-build-debug:
+  extends: .x86-64-build-debug
+  variables:
+    <<: *clang-8
+
 .clang-x86-32-build:
   extends: .x86-32-build
   variables:
@@ -219,6 +236,16 @@ debian-stretch-clang-debug:
   variables:
     CONTAINER: debian:stretch
 
+debian-stretch-clang-8:
+  extends: .clang-8-x86-64-build
+  variables:
+    CONTAINER: debian:stretch
+
+debian-stretch-clang-8-debug:
+  extends: .clang-8-x86-64-build-debug
+  variables:
+    CONTAINER: debian:stretch
+
 debian-stretch-gcc:
   extends: .gcc-x86-64-build
   variables:
@@ -259,6 +286,16 @@ debian-unstable-clang-debug:
   variables:
     CONTAINER: debian:unstable
 
+debian-unstable-clang-8:
+  extends: .clang-8-x86-64-build
+  variables:
+    CONTAINER: debian:unstable
+
+debian-unstable-clang-8-debug:
+  extends: .clang-8-x86-64-build-debug
+  variables:
+    CONTAINER: debian:unstable
+
 debian-unstable-gcc:
   extends: .gcc-x86-64-build
   variables:
diff --git a/automation/scripts/build b/automation/scripts/build
index 8a57e097a9..83c44e6ce7 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -19,7 +19,7 @@ fi
 cfgargs=()
 cfgargs+=("--enable-docs")
 
-if [[ "${CC}" == "clang" ]]; then
+if [[ "${CC}" == "clang"* ]]; then
     # SeaBIOS cannot be built with clang
     cfgargs+=("--with-system-seabios=/usr/share/seabios/bios.bin")
     # iPXE cannot be built with clang
-- 
2.20.1 (Apple Git-117)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-06-10 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 16:32 Roger Pau Monne [this message]
2019-06-10 17:06 ` [Xen-devel] [PATCH v4] automation: add clang and lld 8 tests to gitlab Doug Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190610163246.90567-1-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.