diff mbox series

CI: Add a CentOS 6 container and build jobs

Message ID 1553253220-23838-1-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State Superseded
Headers show
Series CI: Add a CentOS 6 container and build jobs | expand

Commit Message

Andrew Cooper March 22, 2019, 11:13 a.m. UTC
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.

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

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/53121963

This patch is also blocked on one build fix which I've submitted to SeaBIOS:
  https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/WV64JDCUGSFZAUMZUSTQWHBFEFVFTXQQ/
---
 automation/build/centos/6.dockerfile | 51 ++++++++++++++++++++++++++++++++++++
 automation/gitlab-ci/build.yaml      | 10 +++++++
 automation/scripts/build             |  5 ++++
 automation/scripts/containerize      |  1 +
 4 files changed, 67 insertions(+)
 create mode 100644 automation/build/centos/6.dockerfile

Comments

Wei Liu March 25, 2019, 11:21 a.m. UTC | #1
On Fri, Mar 22, 2019 at 11:13:40AM +0000, Andrew Cooper wrote:
> 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.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
Wei Liu March 25, 2019, 11:33 a.m. UTC | #2
On Mon, Mar 25, 2019 at 11:21:44AM +0000, Wei Liu wrote:
> On Fri, Mar 22, 2019 at 11:13:40AM +0000, Andrew Cooper wrote:
> > 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.
> > 
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Just saw your thread on seabios list -- do you want to exclude seabios
build in CentOS 6?

Wei.
Andrew Cooper March 25, 2019, 2:51 p.m. UTC | #3
On 25/03/2019 11:33, Wei Liu wrote:
> On Mon, Mar 25, 2019 at 11:21:44AM +0000, Wei Liu wrote:
>> On Fri, Mar 22, 2019 at 11:13:40AM +0000, Andrew Cooper wrote:
>>> 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.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Acked-by: Wei Liu <wei.liu2@citrix.com>
> Just saw your thread on seabios list -- do you want to exclude seabios
> build in CentOS 6?

Yeah, but I'm not sure how best to do that.  Testing the version of GCC
isn't as easy as testing the version of python.

~Andrew
Wei Liu March 26, 2019, 11:10 a.m. UTC | #4
On Mon, Mar 25, 2019 at 02:51:46PM +0000, Andrew Cooper wrote:
> On 25/03/2019 11:33, Wei Liu wrote:
> > On Mon, Mar 25, 2019 at 11:21:44AM +0000, Wei Liu wrote:
> >> On Fri, Mar 22, 2019 at 11:13:40AM +0000, Andrew Cooper wrote:
> >>> 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.
> >>>
> >>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >> Acked-by: Wei Liu <wei.liu2@citrix.com>
> > Just saw your thread on seabios list -- do you want to exclude seabios
> > build in CentOS 6?
> 
> Yeah, but I'm not sure how best to do that.  Testing the version of GCC
> isn't as easy as testing the version of python.

I think using gcc -dumpversion and awk can get you want you need -- look
at cc-ver in Config.mk.

If seabios is not disabled, the build will break.

Wei.

> 
> ~Andrew
diff mbox series

Patch

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@lists.xenproject.org"
+
+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..cd87f44 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -22,6 +22,11 @@  if [[ "${CC}" == "clang" ]]; then
     cfgargs+=("--disable-stubdom")
 fi
 
+if python -c "import sys; exit(not(sys.version_info < (2, 7)))"; then
+    # Qemu requires Python >=2.7.  Skip it in older distro containers
+    cfgargs+=("--with-system-qemu=/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" ;;