Skip to content

redhat/kernel.spec.template: Add log_msg macro

Prarit Bhargava requested to merge prarit/kernel-ark:add_log_msg_macro into os-build

After last week's debugging session I was reminded why I hate debugging
the kernel.spec. It's not that it's long, or that the code is difficult
to understand -- it's that it can be difficult to map precisely where the
fault in the spec file is. This isn't due to poor design and is due to
the size of the kernel.spec and how rpmbuild creates bash scripts.

In the %prep, %build, and %install stages, we often end up with an error
that looks like

cc1: error: unrecognized command-line option '-mbranch-protection=standard'
cc1: error: unrecognized command-line option '-mbranch-protection=standard'
error: Bad exit status from /var/tmp/rpm-tmp.W1qm1T (%build)

In this example, the /var/tmp/rpm-tmp.W1qm1T script is created by
rpmbuild, and represents the %build stage of the spec file. It is left to
the user to decipher the script and map that into the kernel.spec file to
find the exact command(s) that failed; sometimes that is easy to do, and
other times it is the most infuriating thing ever. It's made me question
my choices in life and sent me into an existential crisis from which I'm
likely never to recover.

This changeset adds a log_msg macro. The hope is that this will be much
more useful than digging through the resulting prep, build, and install
scripts and trying to map the result to the spec file.

Add log_msg() to the %prep, %build, and %install stages, and prepopulate
the spec file with some log_msg's to indicate progress.

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

Merge request reports