NetworkManager/.gitlab-ci/fedora-install.sh
Thomas Haller 339f99c08e
gitlab-ci: drop builds for CentOS 8 (8.1.1911, 8.2.2004, 8.3.2011)
CentOS Linux 8 is long gone. We were only running tests on this old
build environment, to see how we fare in such environment.

The test was broken for 4+ months. Instead of fixing it, disable it.

It's partly caused by RHEL8, as it is somewhat cumbersome to even build
on CentOS 8. That's because some devel packages (like libteam-devel) are
not installable. As workaround for that, we re-build such packages in a
copr ([1]). The problem is, that we only have one copr build for e.g.
CentOS 8. If we rebuild against latest CentOS 8 Stream, then libteam is
build against newer dependencies, which are not installable on CentOS
Linux 8.1.1911 (etc). We would have to build libteam in a way, that
does not drag newer dependencies that are missing on CentOS Linux 8.

For example, trying to use copr [1] on CentOS Linux 8 and installing
"teamd" gives:

  Error:
   Problem: package teamd-devel-1.31-4.el8.x86_64 requires teamd = 1.31-4.el8, but none of the providers can be installed
    - conflicting requests
    - nothing provides libjansson.so.4(libjansson.so.4)(64bit) needed by teamd-1.31-4.el8.x86_64

This could be hacked around, for example by having libteamd-devel not
depend on any teamd package. Instead, just drop it. It's gone.

Arguable, CentOS 8 Stream should be reasonably close (in terms of
versions of gcc, glibc, glib) so we don't miss too much.

[1] https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1793
2023-11-15 10:52:53 +01:00

67 lines
2.3 KiB
Bash
Executable file

#!/bin/bash
set -ex
IS_FEDORA=0
IS_CENTOS=0
CENTOS_VERSION=0
grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1
grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1
if [ $IS_CENTOS = 1 ]; then
if grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ; then
CENTOS_VERSION=8
elif grep -q '^VERSION_ID=.*\<9\>' /etc/os-release ; then
CENTOS_VERSION=9
else
exit 1
fi
if grep -q "^NAME.*Stream" /etc/os-release ; then
CENTOS_VERSION="stream$CENTOS_VERSION"
fi
fi
if [ "$IS_CENTOS" = 1 ]; then
if [ "$CENTOS_VERSION" = stream8 ]; then
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools || \
dnf config-manager --set-enabled PowerTools
curl https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-8/nmstate-nm-build-deps-epel-8.repo > /etc/yum.repos.d/nmstate-nm-build-deps-epel-8.repo
elif [ "$CENTOS_VERSION" = stream9 ]; then
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
curl https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-9/nmstate-nm-build-deps-epel-9.repo > /etc/yum.repos.d/nmstate-nm-build-deps-epel-9.repo
else
exit 1
fi
fi
NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
yum install -y glibc-langpack-pl ccache clang
# containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html
# to generate proper documentation.
yum reinstall -y --setopt='tsflags=' glib2-doc
if command -v dnf &>/dev/null; then
dnf install -y python3-dnf-plugins-core
dnf debuginfo-install -y glib2
else
debuginfo-install -y glib2
fi
contrib/scripts/nm-ci-patch-gtkdoc.sh || true
if [ -x /usr/bin/ninja ] && ! [ -x /usr/bin/ninja-build ]; then
ln -s /usr/bin/ninja-build /usr/bin/ninja
fi
if [ $IS_FEDORA = 1 ]; then
TEMPLATE_SHA="$(sed -n 's/^.templates_sha: *\&template_sha *\([0-9a-f]\+\)$/\1/p' ./.gitlab-ci/ci.template)"
test -n "$TEMPLATE_SHA"
dnf install -y python3-pip
pip3 install "git+http://gitlab.freedesktop.org/freedesktop/ci-templates@$TEMPLATE_SHA"
fi