rpm-ostree/ci/build-check.sh

52 lines
1.9 KiB
Bash
Raw Normal View History

#!/usr/bin/bash
# Install build dependencies, run unit tests and installed tests.
set -xeuo pipefail
dn=$(dirname $0)
. ${dn}/libbuild.sh
# Add checks here which depend on the build container
# but don't require a full build (code static analysis).
if test -x /usr/bin/rustfmt; then
echo "Verifying rustfmt"
if !git diff --quiet --exit-code; then
echo "outstanding diff before rustfmt" 1>&2
exit 1
fi
make -f Makefile-extra.inc rustfmt
if git diff --quiet --exit-code; then
git diff
echo "Please run rustfmt"
exit 1
fi
else
echo "No /usr/bin/rustfmt, skipping"
fi
${dn}/build.sh
# NB: avoid make function because our RPM building doesn't
# support parallel runs right now
/usr/bin/make check
make install
# And now a clang build with -Werror turned on. We can't do this with gcc (in
# build.sh) because it doesn't support -Wno-error=macro-redefined, (and neither
# does clang on CentOS). Anyway, all we want is at least one clang run.
if test -x /usr/bin/clang; then
if grep -q -e 'static inline.*_GLIB_AUTOPTR_LIST_FUNC_NAME' /usr/include/glib-2.0/glib/gmacros.h; then
echo 'Skipping clang check, see https://bugzilla.gnome.org/show_bug.cgi?id=796346'
else
# Except unused-command-line-argument:
# error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened -cc1' [-Werror,-Wunused-command-line-argument]
# Except for macro-redefined:
# /usr/include/python2.7/pyconfig-64.h:1199:9: error: '_POSIX_C_SOURCE' macro redefined
# Except for deprecated-declarations: libdnf python bindings uses deprecated
# functions
export CFLAGS="-Wall -Werror -Wno-error=deprecated-declarations -Wno-error=macro-redefined -Wno-error=unused-command-line-argument ${CFLAGS:-}"
export CC=clang
git clean -dfx && git submodule foreach git clean -dfx
jigdo: V4: Use archful provides for jigdoRPM Requires When I tried to use my WIP client patches to do: `rpm-ostree rebase rojig://fahc:fedora-atomic-host`, I got a missing file object which turned out to be the client importing the i686 RPMs. This was passing in the test suite because we don't mirror i686 of course, but on the client side right now we end up using all enabled repos, and since Fedora is multiarch, the behavior is going to be...not predictable. Thinking a bit about on this problem I actually happened to recall the RPM `%{_isa}` macro which is used in Fedora in various places; for example to "arch bind" `-devel` packages to their base. See for example [this case](https://src.fedoraproject.org/rpms/ostree/blob/33c7dc02bc4f14a6acd7679cc4d84e9629294ae4/f/ostree.spec#_79) in libostree. As I noted at first, the core problem here is that the "final" RPM architecture field is not symmetric in any way with the definition of that `%{_isa}` macro. See: https://github.com/rpm-software-management/rpm/blob/d9d47e01146a5d4411691a71916b1030ac7da193/installplatform#L25 The *third* solution I ended up on here is to iterate over the `Provides` on the server side and we take the first thing that matches `Provides: %{name}(whatever)`. I briefly thought about trying to somehow drive into libsolv the logic to prefer the jigdoRPM's native architecture...IIRC yum did something like that in the past but it was never done in libsolv? Anyways the dependencies here are now more correct, so other tools will also handle it. Closes: #1213 Approved by: jlebon
2018-01-18 00:25:39 +03:00
build ${CONFIGOPTS:-}
fi
fi