Skip to content

Draft: redhat: configs: enable WERROR from build environment

Eric Chanudet requested to merge echanude/centos-stream-9:rhel-29316-2 into main

Upstream-Status: RHEL-Only
JIRA: https://issues.redhat.com/browse/RHEL-29316

Enable WERROR from the specfile where gcc version can be accurately
checked against what will be the build environment.

Preserve the ENABLE_WERROR Makefile variable by:

  • adding a '{-+}werror' for BUILDTOPTS,
  • setting a '--with{,out} werror' RPMBUILDOPTS

WERROR is currently enabled conditionally, only if the gcc version
available when generating the configurations is gcc11 (dist-configs).
Yet it is a valid use-case to generate an SRPM (dist-srpm->dist-configs)
from a development platform and use a remote builder with a a different
environment (e.g, CBS). In most cases, this will not properly detect the
appropriate version of GCC and fail to enable WERROR.

Signed-off-by: Eric Chanudet echanude@redhat.com

Merge request reports