ci: Sync with ostree
We have some drift; keep this more in sync so we maintain the rpm/yum hackarounds for example in one place. I backed out the ASAN bits though pending at least a newer gpgme: <https://github.com/projectatomic/rpm-ostree/pull/1000#issuecomment-331278758> Closes: #1000 Approved by: jlebon
This commit is contained in:
parent
e066dc93c8
commit
2ebf43f4a9
14
.papr.yml
14
.papr.yml
@ -18,13 +18,11 @@ cluster:
|
||||
container:
|
||||
image: registry.fedoraproject.org/fedora:26
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1483553
|
||||
#packages:
|
||||
# - git
|
||||
# - rsync
|
||||
|
||||
env:
|
||||
HOSTS: vmcheck1 vmcheck2 vmcheck3
|
||||
# TODO use -fsanitize=address
|
||||
CFLAGS: '-fsanitize=undefined -fsanitize-undefined-trap-on-error -O2 -Wp,-D_FORTIFY_SOURCE=2'
|
||||
ASAN_OPTIONS: 'detect_leaks=0' # Right now we're not fully clean, but this gets us use-after-free etc
|
||||
CI_PKGS: rsync
|
||||
|
||||
tests:
|
||||
@ -37,6 +35,7 @@ timeout: 60m
|
||||
|
||||
artifacts:
|
||||
- test-suite.log
|
||||
- config.log
|
||||
- vmcheck
|
||||
|
||||
---
|
||||
@ -59,6 +58,11 @@ cluster:
|
||||
# FIXME remove this version binding when rpm-md repos are updated
|
||||
image: registry.centos.org/centos/centos:7.3.1611
|
||||
|
||||
# We only want the sanitizers on Fedora
|
||||
env:
|
||||
HOSTS: vmcheck1 vmcheck2 vmcheck3
|
||||
CFLAGS: ''
|
||||
|
||||
extra-repos:
|
||||
- name: atomic-centos-continuous
|
||||
baseurl: https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build
|
||||
|
@ -10,16 +10,3 @@ ${dn}/build.sh
|
||||
# support parallel runs right now
|
||||
/usr/bin/make check
|
||||
make install
|
||||
|
||||
# And now a clang build to find unused variables, but only run on Fedora because
|
||||
# the CentOS version is ancient anyway and doesn't support all the flags that
|
||||
# might get passed to it.
|
||||
id=$(. /etc/os-release && echo $ID)
|
||||
if [ "$id" == fedora ]; then
|
||||
git clean -dfx
|
||||
export CC=clang
|
||||
export CFLAGS='-Werror=unused-variable -Werror=maybe-uninitialized'
|
||||
build_default
|
||||
# don't actually run the tests, just compile them
|
||||
/usr/bin/make check TESTS=
|
||||
fi
|
||||
|
@ -18,12 +18,9 @@ elif [ "$id" == centos ]; then
|
||||
fi
|
||||
|
||||
pkg_upgrade
|
||||
|
||||
install_builddeps rpm-ostree
|
||||
|
||||
yum install -y /usr/bin/g-ir-scanner # Accidentally omitted
|
||||
pkg_install_builddeps rpm-ostree
|
||||
# Mostly dependencies for tests
|
||||
yum install -y ostree{,-devel,-grub2} createrepo_c /usr/bin/jq PyYAML clang \
|
||||
pkg_install ostree{,-devel,-grub2} createrepo_c /usr/bin/jq PyYAML clang \
|
||||
libubsan libasan libtsan elfutils fuse sudo python-gobject-base
|
||||
|
||||
if [ -n "${CI_PKGS:-}" ]; then
|
||||
@ -33,5 +30,5 @@ fi
|
||||
# create an unprivileged user for testing
|
||||
adduser testuser
|
||||
|
||||
rpm -q ostree{,-devel,-grub2}
|
||||
export LSAN_OPTIONS=verbosity=1:log_threads=1
|
||||
build --enable-installed-tests --enable-gtk-doc
|
||||
|
@ -2,22 +2,19 @@
|
||||
|
||||
pkg_upgrade() {
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1483553
|
||||
if ! yum -y upgrade 2>err.txt; then
|
||||
ecode=$?
|
||||
if grep -q -F -e "BDB1539 Build signature doesn't match environment" err.txt; then
|
||||
rpm --rebuilddb
|
||||
yum -y upgrade
|
||||
else
|
||||
ecode=0
|
||||
yum -y distro-sync 2>err.txt || ecode=$?
|
||||
if test ${ecode} '!=' 0 && grep -q -F -e "BDB1539 Build signature doesn't match environment" err.txt; then
|
||||
rpm --rebuilddb
|
||||
yum -y distro-sync
|
||||
else
|
||||
if test ${ecode} '!=' 0; then
|
||||
cat err.txt
|
||||
exit ${ecode}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_install() {
|
||||
yum -y install "$@"
|
||||
}
|
||||
|
||||
make() {
|
||||
/usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@"
|
||||
}
|
||||
@ -25,28 +22,48 @@ make() {
|
||||
build() {
|
||||
env NOCONFIGURE=1 ./autogen.sh
|
||||
./configure --prefix=/usr --libdir=/usr/lib64 "$@"
|
||||
make
|
||||
make V=1
|
||||
}
|
||||
|
||||
build_default() {
|
||||
export CFLAGS="${CFLAGS:-} -fsanitize=undefined"
|
||||
build
|
||||
pkg_install() {
|
||||
yum -y install "$@"
|
||||
}
|
||||
|
||||
install_builddeps() {
|
||||
pkg=$1
|
||||
pkg_install_if_os() {
|
||||
os=$1
|
||||
shift
|
||||
(. /etc/os-release;
|
||||
if test "${os}" = "${ID}"; then
|
||||
pkg_install "$@"
|
||||
else
|
||||
echo "Skipping installation on OS ${ID}: $@"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
if [ -x /usr/bin/dnf ]; then
|
||||
dnf -y install dnf-plugins-core
|
||||
dnf install -y @buildsys-build
|
||||
dnf install -y 'dnf-command(builddep)'
|
||||
dnf builddep -y $pkg
|
||||
pkg_builddep() {
|
||||
# This is sadly the only case where it's a different command
|
||||
if test -x /usr/bin/dnf; then
|
||||
dnf builddep -y "$@"
|
||||
else
|
||||
yum install -y make rpm-build
|
||||
yum-builddep -y rpm-ostree
|
||||
yum-builddep -y "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_install_builddeps() {
|
||||
pkg=$1
|
||||
if test -x /usr/bin/dnf; then
|
||||
yum -y install dnf-plugins-core
|
||||
yum install -y 'dnf-command(builddep)'
|
||||
# Base buildroot
|
||||
pkg_install @buildsys-build
|
||||
else
|
||||
yum -y install yum-utils
|
||||
# Base buildroot, copied from the mock config sadly
|
||||
yum -y install bash bzip2 coreutils cpio diffutils system-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz
|
||||
fi
|
||||
# builddeps+runtime deps
|
||||
yum install -y $pkg
|
||||
pkg_builddep $pkg
|
||||
pkg_install $pkg
|
||||
rpm -e $pkg
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user