[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] CI: Add a CentOS 6 container and build jobs



CentOS 6 is probably the most frequently broken build, so adding it to CI
would be a very good move.

One problem is that CentOS 6 comes with Python 2.6, and Qemu requires 2.7.
There appear to be no sensible ways to get Python 2.7 into a CentOS 6
environments, so modify the build script to skip the Qemu upstream build
instead.  Additionally, SeaBIOS requires GCC 4.6 or later, so skip it as well.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Doug Goldstein <cardoe@xxxxxxxxxx>

v2:
 * Skip SeaBIOS as well

I've already pushed this container to the registry, for testing purposes.

A sample pipeline is:
  https://gitlab.com/xen-project/people/andyhhp/xen/pipelines/53683097
---
 automation/build/centos/6.dockerfile | 51 ++++++++++++++++++++++++++++++++++++
 automation/gitlab-ci/build.yaml      | 10 +++++++
 automation/scripts/build             | 16 +++++++++++
 automation/scripts/containerize      |  1 +
 4 files changed, 78 insertions(+)
 create mode 100644 automation/build/centos/6.dockerfile

diff --git a/automation/build/centos/6.dockerfile 
b/automation/build/centos/6.dockerfile
new file mode 100644
index 0000000..54d022b
--- /dev/null
+++ b/automation/build/centos/6.dockerfile
@@ -0,0 +1,51 @@
+FROM centos:6
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@xxxxxxxxxxxxxxxxxxxx"
+
+RUN mkdir /build
+WORKDIR /build
+
+# work around https://github.com/moby/moby/issues/10180
+# and add EPEL for dev86
+RUN rpm --rebuilddb && \
+    yum -y install \
+        yum-plugin-ovl \
+        epel-release \
+    && yum clean all && \
+    rm -rf /var/cache/yum
+
+# install Xen depends
+RUN yum -y install \
+        gcc \
+        gcc-c++ \
+        ncurses-devel \
+        zlib-devel \
+        openssl-devel \
+        python-devel \
+        libuuid-devel \
+        pciutils-devel \
+        pkgconfig \
+        gettext \
+        flex \
+        bison \
+        libaio-devel \
+        glib2-devel \
+        yajl-devel \
+        pixman-devel \
+        glibc-devel \
+        glibc-devel.i686 \
+        make \
+        binutils \
+        git \
+        wget \
+        acpica-tools \
+        python-markdown \
+        patch \
+        checkpolicy \
+        dev86 \
+        iasl \
+        xz-devel \
+        bzip2 \
+        nasm \
+    && yum clean all && \
+    rm -rf /var/cache/yum
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 48bb039..b70797e 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -149,6 +149,16 @@ centos-7-gcc-debug:
   variables:
     CONTAINER: centos:7
 
+centos-6-gcc:
+  extends: .gcc-x86-64-build
+  variables:
+    CONTAINER: centos:6
+
+centos-6-gcc-debug:
+  extends: .gcc-x86-64-build-debug
+  variables:
+    CONTAINER: centos:6
+
 debian-jessie-clang:
   extends: .clang-x86-64-build
   variables:
diff --git a/automation/scripts/build b/automation/scripts/build
index db4bac3..8a57e09 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -2,6 +2,12 @@
 
 $CC --version
 
+# Express the compiler version as an integer.  e.g. GCC 4.9.2 => 0x040902
+cc-ver()
+{
+    $CC -dumpversion | awk -F. '{ printf "0x%02x%02x%02x", $1, $2, $3 }'
+}
+
 # random config or default config
 if [[ "${RANDCONFIG}" == "y" ]]; then
     make -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
@@ -22,6 +28,16 @@ if [[ "${CC}" == "clang" ]]; then
     cfgargs+=("--disable-stubdom")
 fi
 
+# Qemu requires Python 2.7 or later
+if python -c "import sys; res = sys.version_info < (2, 7); exit(not(res))"; 
then
+    cfgargs+=("--with-system-qemu=/bin/false")
+fi
+
+# SeaBIOS requires GCC 4.6 or later
+if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
+    cfgargs+=("--with-system-seabios=/bin/false")
+fi
+
 ./configure "${cfgargs[@]}"
 
 make -j$(nproc) dist
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index b50ff99..09d130b 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -15,6 +15,7 @@ die() {
 #
 BASE="registry.gitlab.com/xen-project/xen"
 case "_${CONTAINER}" in
+    _centos6) CONTAINER="${BASE}/centos:6" ;;
     _centos7) CONTAINER="${BASE}/centos:7" ;;
     _centos72) CONTAINER="${BASE}/centos:7.2" ;;
     _trusty) CONTAINER="${BASE}/ubuntu:trusty" ;;
-- 
2.1.4


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.