ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
b9a53a
From ac7db0c5b48f1090f77dbcfa0a1e0dc08d5c471e Mon Sep 17 00:00:00 2001
b9a53a
From: Frantisek Sumsal <fsumsal@redhat.com>
b9a53a
Date: Mon, 14 Oct 2019 15:26:48 +0200
b9a53a
Subject: [PATCH] travis: move to CentOS 8 docker images
b9a53a
b9a53a
As the CentOS 8 Docker images is finally out, we can use it and drop the
b9a53a
plethora of workarounds we had to implement to compile RHEL8 systemd on
b9a53a
CentOS 7.
b9a53a
b9a53a
Resolves: #1761519
b9a53a
---
b9a53a
 .travis.yml               | 22 ++++++++++------------
b9a53a
 ci/travis-centos-rhel8.sh | 32 +++++++++-----------------------
b9a53a
 2 files changed, 19 insertions(+), 35 deletions(-)
b9a53a
b9a53a
diff --git a/.travis.yml b/.travis.yml
b9a53a
index 0010da5784..70c60cf24e 100644
b9a53a
--- a/.travis.yml
b9a53a
+++ b/.travis.yml
b9a53a
@@ -9,42 +9,40 @@ env:
b9a53a
 
b9a53a
 jobs:
b9a53a
     include:
b9a53a
-        - name: CentOS 7
b9a53a
+        - name: CentOS 8
b9a53a
           language: bash
b9a53a
           env:
b9a53a
-              - CENTOS_RELEASE="centos7"
b9a53a
+              - CENTOS_RELEASE="centos8"
b9a53a
               - CONT_NAME="systemd-centos-$CENTOS_RELEASE"
b9a53a
               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
b9a53a
           before_install:
b9a53a
               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
b9a53a
               - docker --version
b9a53a
           install:
b9a53a
-              - if [ -f meson.build ]; then RHEL_VERSION=rhel8; else RHEL_VERSION=rhel7; fi
b9a53a
-              - $CI_ROOT/travis-centos-${RHEL_VERSION}.sh SETUP
b9a53a
+              - $CI_ROOT/travis-centos-rhel8.sh SETUP
b9a53a
           script:
b9a53a
               - set -e
b9a53a
               # Build systemd
b9a53a
-              - $CI_ROOT/travis-centos-${RHEL_VERSION}.sh RUN
b9a53a
+              - $CI_ROOT/travis-centos-rhel8.sh RUN
b9a53a
               - set +e
b9a53a
           after_script:
b9a53a
-              - $CI_ROOT/travis-centos-${RHEL_VERSION}.sh CLEANUP
b9a53a
+              - $CI_ROOT/travis-centos-rhel8.sh CLEANUP
b9a53a
 
b9a53a
-        - name: CentOS 7 (ASan+UBSan)
b9a53a
+        - name: CentOS 8 (ASan+UBSan)
b9a53a
           language: bash
b9a53a
           env:
b9a53a
-              - CENTOS_RELEASE="centos7"
b9a53a
+              - CENTOS_RELEASE="centos8"
b9a53a
               - CONT_NAME="systemd-centos-$CENTOS_RELEASE"
b9a53a
               - DOCKER_EXEC="docker exec -ti $CONT_NAME"
b9a53a
           before_install:
b9a53a
               - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
b9a53a
               - docker --version
b9a53a
           install:
b9a53a
-              - if [ -f meson.build ]; then RHEL_VERSION=rhel8; else RHEL_VERSION=rhel7; fi
b9a53a
-              - $CI_ROOT/travis-centos-${RHEL_VERSION}.sh SETUP
b9a53a
+              - $CI_ROOT/travis-centos-rhel8.sh SETUP
b9a53a
           script:
b9a53a
               - set -e
b9a53a
               # Build systemd
b9a53a
-              - $CI_ROOT/travis-centos-${RHEL_VERSION}.sh RUN_ASAN
b9a53a
+              - $CI_ROOT/travis-centos-rhel8.sh RUN_ASAN
b9a53a
               - set +e
b9a53a
           after_script:
b9a53a
-              - $CI_ROOT/travis-centos-${RHEL_VERSION}.sh CLEANUP
b9a53a
+              - $CI_ROOT/travis-centos-rhel8.sh CLEANUP
b9a53a
diff --git a/ci/travis-centos-rhel8.sh b/ci/travis-centos-rhel8.sh
b9a53a
index c3d1018682..ade44a0413 100755
b9a53a
--- a/ci/travis-centos-rhel8.sh
b9a53a
+++ b/ci/travis-centos-rhel8.sh
b9a53a
@@ -15,10 +15,7 @@ CONT_NAME="${CONT_NAME:-centos-$CENTOS_RELEASE-$RANDOM}"
b9a53a
 DOCKER_EXEC="${DOCKER_EXEC:-docker exec -it $CONT_NAME}"
b9a53a
 DOCKER_RUN="${DOCKER_RUN:-docker run}"
b9a53a
 REPO_ROOT="${REPO_ROOT:-$PWD}"
b9a53a
-ADDITIONAL_DEPS=(systemd-ci-environment libidn2-devel python-lxml python36 ninja-build libasan net-tools strace nc busybox e2fsprogs quota dnsmasq)
b9a53a
-# Repo with additional depencencies to compile newer systemd on CentOS 7
b9a53a
-COPR_REPO="https://copr.fedorainfracloud.org/coprs/mrc0mmand/systemd-centos-ci/repo/epel-7/mrc0mmand-systemd-centos-ci-epel-7.repo"
b9a53a
-COPR_REPO_PATH="/etc/yum.repos.d/${COPR_REPO##*/}"
b9a53a
+ADDITIONAL_DEPS=(libasan libubsan net-tools strace nc e2fsprogs quota dnsmasq)
b9a53a
 # RHEL8 options
b9a53a
 CONFIGURE_OPTS=(
b9a53a
     -Dsysvinit-path=/etc/rc.d/init.d
b9a53a
@@ -95,18 +92,14 @@ for phase in "${PHASES[@]}"; do
b9a53a
                         -dit --net=host centos:$CENTOS_RELEASE /sbin/init
b9a53a
             # Beautiful workaround for Fedora's version of Docker
b9a53a
             sleep 1
b9a53a
-            $DOCKER_EXEC yum makecache
b9a53a
-            $DOCKER_EXEC curl "$COPR_REPO" -o "$COPR_REPO_PATH"
b9a53a
-            $DOCKER_EXEC yum -q -y install epel-release yum-utils
b9a53a
-            $DOCKER_EXEC yum-config-manager -q --enable epel
b9a53a
-            $DOCKER_EXEC yum -y upgrade
b9a53a
-            # Install necessary build/test requirements
b9a53a
-            $DOCKER_EXEC yum -y install "${ADDITIONAL_DEPS[@]}"
b9a53a
-            $DOCKER_EXEC python3.6 -m ensurepip
b9a53a
-            $DOCKER_EXEC python3.6 -m pip install meson
b9a53a
-            # Create necessary symlinks
b9a53a
-            $DOCKER_EXEC ln --force -s /usr/bin/python3.6 /usr/bin/python3
b9a53a
-            $DOCKER_EXEC ln --force -s /usr/bin/ninja-build /usr/bin/ninja
b9a53a
+            $DOCKER_EXEC dnf makecache
b9a53a
+            # Install and enable EPEL
b9a53a
+            $DOCKER_EXEC dnf -q -y install epel-release dnf-utils "${ADDITIONAL_DEPS[@]}"
b9a53a
+            $DOCKER_EXEC dnf config-manager -q --enable epel
b9a53a
+            # Upgrade the container to get the most recent environment
b9a53a
+            $DOCKER_EXEC dnf -y upgrade
b9a53a
+            # Install systemd's build dependencies
b9a53a
+            $DOCKER_EXEC dnf -q -y --enablerepo "PowerTools" builddep systemd
b9a53a
             ;;
b9a53a
         RUN)
b9a53a
             info "Run phase"
b9a53a
@@ -117,16 +110,9 @@ for phase in "${PHASES[@]}"; do
b9a53a
             # unexpected fails due to incompatibilities with older systemd
b9a53a
             $DOCKER_EXEC ninja -C build install
b9a53a
             docker restart $CONT_NAME
b9a53a
-            # "Mask" the udev-test.pl, as it requires newer version of systemd-detect-virt
b9a53a
-            # and it's pointless to run it on a VM in a Docker container...
b9a53a
-            echo -ne "#!/usr/bin/perl\nexit(0);\n" > "test/udev-test.pl"
b9a53a
             $DOCKER_EXEC ninja -C build test
b9a53a
             ;;
b9a53a
         RUN_ASAN|RUN_CLANG_ASAN)
b9a53a
-            # Let's install newer gcc for proper ASan/UBSan support
b9a53a
-            $DOCKER_EXEC yum -y install centos-release-scl
b9a53a
-            $DOCKER_EXEC yum -y install devtoolset-8 devtoolset-8-libasan-devel libasan5 devtoolset-8-libubsan-devel libubsan1
b9a53a
-            $DOCKER_EXEC bash -c "echo 'source scl_source enable devtoolset-8' >> /root/.bashrc"
b9a53a
             # Note to my future frustrated self: docker exec runs the given command
b9a53a
             # as sh -c 'command' - which means both .bash_profile and .bashrc will
b9a53a
             # be ignored. That's because .bash_profile is sourced for LOGIN shells (i.e.