[LU-9726] client SRPM does not rebuild Created: 30/Jun/17  Updated: 19/Jul/17

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.10.0
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Brian Murrell (Inactive) Assignee: Minh Diep
Resolution: Unresolved Votes: 0
Labels: None
Environment:

https://build.hpdd.intel.com/job/lustre-b2_10/arch=x86_64,build_type=client,distro=el7,ib_stack=inkernel/2/


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

When I fetch the client SRPM from the URL in the Environment field, it doesn't simply rebuild in a clean-build environment such as Copr (which is basically mock[chain]):

checking for Linux sources... 
checking for ... no
configure: error: Kernel source  could not be found.
error: Bad exit status from /var/tmp/rpm-tmp.0DFyxx (%build)

You can see the full log of the build if you wish.

As you can see in that log though, kernel-devel was installed:

Dependencies Resolved

================================================================================
 Package                Arch       Version                    Repository   Size
================================================================================
Installing:
 kernel-devel           x86_64     3.10.0-514.26.1.el7        updates      13 M
...

Is the Lustre autoconf macro that is looking for the kernel source not defaulting to /usr/src/kernels/* perhaps?



 Comments   
Comment by Brian Murrell (Inactive) [ 30/Jun/17 ]

The problem seems to be in the nature of the checks for kernel source in /usr/src/kernels/:

for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
	AS_IF([readlink -q -e $DEFAULT_LINUX >/dev/null], [break])
done
if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then
	PATHS="/lib/modules/$(uname -r)/build"
fi

The problem is that in a clean-room type build system like Copr, or even just mock, the build is done in a chroot so the kernel that is running on the system that has the chroot may not reflect the contents of the kernel-devel that was installed for the build.

The fix is probably to add [some subset -- perhaps just the highest version of] /usr/src/kernels/* to the end of {$PATHS} in the above search for a kernel source/devel location.

Comment by Peter Jones [ 30/Jun/17 ]

Minh

Can you please assist with this one?

Thanks

Peter

Comment by Minh Diep [ 30/Jun/17 ]

brian, I assume you're building client only. However, I don't see a '--disable-server' being passed to ./configure

Comment by Brian Murrell (Inactive) [ 30/Jun/17 ]

mdiep: To be clear, I am trying to [re]build the produced SRPM so I don't control the configure options.  The specfile inside the SRPM controls that.

Ultimately, the SRPM output product of an RPM build should be rebuildable.  If I use the produced lustre-client SRPM file and then use rpmbuild --rebuild <SRPM file> that should rebuild the lustre-client binary RPM.

Comment by Minh Diep [ 30/Jun/17 ]

brian I agree. I don't think lustre packaging source any differently between server and client and that needs to be fixed. could you verify that you can build lustre client with passing --disable-server into rpmbuild?

Comment by Brian Murrell (Inactive) [ 30/Jun/17 ]

can build lustre client with passing --disable-server into rpmbuild

The argument is --without-servers and that only addresses the instructing of a client build, which is not what this ticket is reporting.  This is indeed another issue with the SRPM, but different than this ticket.

The problem that this ticket is reporting is that kernel source detection/selection does not work in clean-room SRPM [re]build (i.e. rpmbuild -rebuild lustre-client....src.rpm environments. It's limited to autodetection only on systems where the kernel you want to build for is the kernel the build system is booted on.  It should, at minimum use whatever is in /usr/src/kernels/ particularly if there is only one item in that directory if no other location can be found.

And using /usr/src/kernels/ is important because the /lib/modules/*/{build,source} links only exist if you install a kernel which shouldn't be necessary in a build chroot such as mock creates.

Comment by Brian Murrell (Inactive) [ 19/Jul/17 ]

To clarify, the original issue described in this ticket, the need to add /usr/src/kernels/* to the search path for kernel source is actually addressed in LU-9775.

The second issue in this ticket, that the lustre-client SRPM re-build does not set the –disable-servers still needs to be addressed.

Probably the easiest way to deal with that is not not require the option be set but to detect if the kernel source is patched for a server build or not automatically.

Generated at Sat Feb 10 02:28:41 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.