Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1081854

Summary: kpatch-build missed a few dependencies (inaccurate ERR)
Product: Red Hat Enterprise Linux 7 Reporter: Linqing Lu <lilu>
Component: kpatchAssignee: Seth Jennings <sjenning>
Status: CLOSED UPSTREAM QA Contact: Linqing Lu <lilu>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: jpoimboe, sjenning
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-24 07:10:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/tmp/kpatch-build-1395981082.log none

Description Linqing Lu 2014-03-28 05:41:56 UTC
Created attachment 879749 [details]
/tmp/kpatch-build-1395981082.log

1- Installed kpatch tools from latest github source code (last commit bf58321229) on RHEL-7.0-20140326.0 with dependencies pre-installed(https://github.com/dynup/kpatch#installation).

2- kpatch-build with a simple one-line patch would failed with an ERROR message:
'''
# kpatch-build foo.patch 
Downloading kernel source for 3.10.0-115.el7.x86_64
Unpacking kernel source
ERROR: rpmbuild -bp failed.  you may need to run 'yum-builddep kernel' first.
'''

3- 'yum-builddep kernel' won't help (actually it has been ran during pre-install steps), so checked the kpatch log:
'''
# tail /tmp/kpatch-build-1395981082.log
	zlib-devel is needed by kernel-3.10.0-115.el7.x86_64
	binutils-devel is needed by kernel-3.10.0-115.el7.x86_64
	newt-devel is needed by kernel-3.10.0-115.el7.x86_64
	python-devel is needed by kernel-3.10.0-115.el7.x86_64
	perl(ExtUtils::Embed) is needed by kernel-3.10.0-115.el7.x86_64
	audit-libs-devel is needed by kernel-3.10.0-115.el7.x86_64
	numactl-devel is needed by kernel-3.10.0-115.el7.x86_64
	pciutils-devel is needed by kernel-3.10.0-115.el7.x86_64
Building target platforms: x86_64
Building for target x86_64
'''

4- Installed extra dependencies listed above:
# yum install zlib-devel binutils-devel newt-devel python-devel perl-ExtUtils-Embed audit-libs-devel numactl-devel pciutils-devel

5- kpatch-build worked well then

Comment 2 Seth Jennings 2014-03-28 21:02:29 UTC
This looks like a problem with yum-builddep not installing all the build dependencies that are required for the kernel rpm.  Looking into it more.

Comment 3 Seth Jennings 2014-04-07 16:26:39 UTC
Below is the BuildRequires section of the kernel spec file.  It would seem that yum-builddep does not process the spec file enough to figure out the values for the if conditionals and just ignores them.

======
#
# List the packages used during the kernel build
#
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
BuildRequires: xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config >= 9.1.0-55
BuildRequires: hostname, net-tools, bc
BuildRequires: xmlto, asciidoc
BuildRequires: openssl
BuildRequires: hmaccalc
%ifarch x86_64
BuildRequires: pesign >= 0.109-4
%endif
%if %{with_sparse}
BuildRequires: sparse >= 0.4.1
%endif
%if %{with_perf}
BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison
BuildRequires: audit-libs-devel
%ifnarch s390 s390x
BuildRequires: numactl-devel
%endif
%endif
%if %{with_tools}
BuildRequires: pciutils-devel gettext
%endif
%if %{with_debuginfo}
# Fancy new debuginfo generation introduced in Fedora 8/RHEL 6.
# The -r flag to find-debuginfo.sh invokes eu-strip --reloc-debug-sections
# which reduces the number of relocations in kernel module .ko.debug files and
# was introduced with rpm 4.9 and elfutils 0.153.
BuildRequires: rpm-build >= 4.9.0-1, elfutils >= 0.153-1
%define debuginfo_args --strict-build-id -r
%endif
%ifarch s390x
# required for zfcpdump
BuildRequires: glibc-static
%endif
=====

This is also an issue in Fedora 20 as pesign is not installed because the BuildRequires is inside a conditional block that detects whether the build will used signed modules or not.

Comment 4 Seth Jennings 2014-04-07 16:41:56 UTC
Oddly enough, when I do a "yum-builddep kernel" is doesn't pick up BuildRequires in conditional blocks.  However, if I download the spec file and do a "yum-builddep kernel.spec" is _does_ evaluate the conditional blocks and installs the complete list of build dependencies.

Comment 5 Linqing Lu 2014-04-10 08:51:58 UTC
FYI - Observed two more dep missed from the same scenario: 

error: Failed build dependencies:
	pesign >= 0.109-4 is needed by kernel-3.10.0-121.el7.x86_64
	bison is needed by kernel-3.10.0-121.el7.x86_64

Comment 7 Ludek Smid 2014-06-26 10:54:20 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 8 Ludek Smid 2014-06-26 11:14:09 UTC
The comment above is incorrect. The correct version is bellow.
I'm sorry for any inconvenience.
---------------------------------------------------------------

This request was NOT resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you need
to escalate this bug.

Comment 9 Seth Jennings 2014-07-15 14:39:38 UTC
Related bug (yum-builddep missing dependencies)
https://bugzilla.redhat.com/show_bug.cgi?id=1040219

I would seem that the only way to address this issue is to get the spec file and do a yum-builddep on it.