contrib/rpm: revert building "--with test" for RHEL 9

"--with test" does two things:

(1) it enables "-Werror" compiler option. We always enable all
    compiler warnings we care about, but this option makes all
    warnings fatal.
    Compiler warnings depend on compiler version and build options.
    It's hard to build without any compiler warnings, in particular
    for *future* compiler versions which we don't know yet. It
    is desirable that a SRPM from yesterday can also be build
    tomorrow.

(2) it fails build if any unit tests fail. We always run all
    unit tests, but "--with test" makes it fatal. Again, we
    have many unit tests that interact with the system (that is,
    make system calls, like creating IP addresses or write files).
    It is surprisingly hard to get them pass 100% on all the systems
    we care. For example, on copr a test setup randomly fails during

         ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
         nm_utils_ifname_cpy(ifr.ifr_name, TEST_IFNAME);
         r = ioctl(fd, TUNSETIFF, &ifr);

    It's not clear why, nor is it at all clear that there is a bug
    in NetworkManager. Making tests fatal basically means that a build
    on copr infrastructure fails with a probability from a few percent.
    Enough to be seriously annoying.

Note that on copr we actually build "--with test", because we want to catch these
issues. Likewise for our CI builds we explicitly specify "--with test".

In general, we build with various build configurations (compiler warnings)
and run unit tests on a source package many times. Starting on the
developer machine (`make check`), gitlab-ci, copr builds,
NetworkManager-ci. If you build an SRPM with such sources, a failure
of the unit tests is much more likely a glitch than an actual issue.

This is about changing the default if you build a Fedora/RHEL package.
That is with the Fedora/RHEL packages that are build in koji/brew.

Well, at least usually. In practice, we don't build frequently on non
x64_86 archs, so what I said there is less true. But the package build
is not there to replace CI/testing. The package build is there to get
a (mostly) working binary.

Note that RHEL packages anyway go through rpmdiff too, and rpmdiff
parses the build log and complain if `make check` fails.

This reverts commit e68e5c0a4c.
This commit is contained in:
Thomas Haller 2021-02-12 11:39:31 +01:00
parent 4d66d6c7a1
commit e23bafe5d5
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -55,12 +55,8 @@
%if "x__BCOND_DEFAULT_TEST__" == "x1" || "x__BCOND_DEFAULT_TEST__" == "x0"
%global bcond_default_test __BCOND_DEFAULT_TEST__
%else
%if 0%{?rhel} >= 9
%global bcond_default_test 1
%else
%global bcond_default_test 0
%endif
%endif
%bcond_with meson
%bcond_without adsl