Skip to content

Commit

Permalink
ci: Sync with ostree
Browse files Browse the repository at this point in the history
We have some drift; keep this more in sync so we maintain the rpm/yum
hackarounds for example in one place.

Closes: #1000
Approved by: jlebon
  • Loading branch information
cgwalters authored and rh-atomic-bot committed Sep 20, 2017
1 parent 25ba196 commit ee832bb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 40 deletions.
14 changes: 9 additions & 5 deletions .papr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ 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
CFLAGS: '-fsanitize=undefined -fsanitize-undefined-trap-on-error -fsanitize=address -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:
Expand All @@ -37,6 +34,7 @@ timeout: 60m

artifacts:
- test-suite.log
- config.log
- vmcheck

---
Expand All @@ -59,6 +57,12 @@ 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: ''
CI_PKGS: rsync

extra-repos:
- name: atomic-centos-continuous
baseurl: https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build
Expand Down
13 changes: 8 additions & 5 deletions ci/build-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ make install
# might get passed to it.
id=$(. /etc/os-release && echo $ID)
if [ "$id" == fedora ]; then
git clean -dfx
# always fail on warnings; https://github.com/ostreedev/ostree/pull/971
# Except for clang-4.0: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Werror,-Wunused-command-line-argument]
export CFLAGS="-Wno-error=unused-command-line-argument -Werror ${CFLAGS:-}"
git clean -dfx && git submodule foreach git clean -dfx
# And now a clang build to find unused variables because it does a better
# job than gcc for vars with cleanups; perhaps in the future these could
# parallelize
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=
build
fi
9 changes: 3 additions & 6 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
65 changes: 41 additions & 24 deletions ci/libbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,68 @@

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) "$@"
}

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
}

0 comments on commit ee832bb

Please sign in to comment.