Skip to content

Makefile: Check PKGRELEASE size on dist-brew targets

Prarit Bhargava requested to merge prarit/kernel-ark:dist-brew-WAR into os-build

The Red Hat brew system is a build system used internally within Red Hat
which is similar to the externally available koji build system. One of
the architectures of a brew build is 's390x+zfcpdump'. This arch using
the default of localversion 'test' always causes the rpm build error:

"5.17.0-0.rc0.20220114gitfb3b0673.65.test.el9_b.s390x+zfcpdump" exceeds 64 characters
make: *** [Makefile:1257: include/generated/utsrelease.h] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.tMkhuG (%build)

The 64 character limit is built into rpm and cannot be dynamically
changed so the only other option is to reduce the package release
(PKGRELEASE) string in length. Removing the date field and the string
'git' results in a string that is shorter by 11 characters, with a minimal
loss in information.

Add an option, PREBUILD_GIT_ONLY, to shorten the PREBUILD variable which
is used in the PKGRELEASE string. Add a check for the size of PKGRELEASE
and return a pre-build error if PKGRELEASE is greater than 35 characters.

Signed-off-by: Prarit Bhargava prarit@redhat.com

Edited by Prarit Bhargava

Merge request reports