[LU-16517] 'make debs' ignores extra build options Created: 30/Jan/23  Updated: 19/Oct/23  Resolved: 09/Jun/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.2
Fix Version/s: Lustre 2.16.0, Lustre 2.15.4

Type: Bug Priority: Minor
Reporter: Shuichi Ihara Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

run 'make debs' to build debs for Ubuntu

root@u0:~/lustre-release# sh ./autogen.sh;  ./configure --disable-lru-resize --with-o2ib=/usr/src/ofa_kernel/default ; make debs 

But, configure restarts and pick some options, but ignores user defined build options. e.g. '--disable-lru-resize ' above

touch configure-stamp
Final value of EXTRAFLAGS: --disable-server --without-zfs --disable-ldiskfs --with-o2ib=/usr/src/ofa_kernel/5.4.0-137-generic --disable-gss
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c

In the end, packages were built with missing build options.

root@u0:~/lustre-release# cat config.log 
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Lustre configure 2.14.0_ddn74, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --disable-dependency-tracking --with-linux=/lib/modules/5.4.0-137-generic/build --with-linux-obj=/usr/src/linux-headers-5.4.0-1
37-generic --disable-snmp --enable-quota --disable-server --without-zfs --disable-ldiskfs --with-o2ib=/usr/src/ofa_kernel/5.4.0-137-generic --d
isable-gss --with-o2ib=/usr/src/ofa_kernel/5.4.0-137-generic


 Comments   
Comment by Jian Yu [ 28/Feb/23 ]

In debian/rules, the configure command is defined as follows:

debian/rules
                $(SRCDIR)/configure --disable-dependency-tracking \
                        --with-linux=$${KERNEL_SRC} \
                        --with-linux-obj=$${KERNEL_OBJ} \
                        --disable-snmp \
                        --enable-quota \
                        $${EXTRAFLAGS} \
                        $(EXTRA_OPTIONS) \

The EXTRA_OPTIONS is defined with IB_OPTIONS, which is "--with-o2ib=xx".
Other configure options are specified by EXTRAFLAGS, which is detected in debian/rules by checking DEB_BUILD_PROFILES as follows:

debian/rules
        echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \
                export EXTRAFLAGS="--enable-server"; \
                <~snip~>
        else \
                export EXTRAFLAGS="--disable-server"; \
                <~snip~>
        fi; \
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \
                export EXTRAFLAGS="$${EXTRAFLAGS} --with-zfs=$${ZFS_SRC} --with-spl=$${SPL_SRC}"; \
        else \
                export EXTRAFLAGS="$${EXTRAFLAGS} --without-zfs" ; \
        fi; \
                <~snip~>
                export EXTRAFLAGS="$${EXTRAFLAGS} --enable-ldiskfs --enable-quilt"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --disable-ldiskfs"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gss"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --disable-gss"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \
                <~snip~>
		export EXTRAFLAGS="$${EXTRAFLAGS} --cache-file=$${TMP_CACHE_FILE}"; \

DEB_BUILD_PROFILES is defined and exported in autoMakefile.am under debs target as follows:

autoMakefile.am
        if test "x@ENABLE_SERVER@" = "xyes"; then \
                DEB_BUILD_PROFILES="server"; \
        else \
                DEB_BUILD_PROFILES="client"; \
        fi; \
        if test "x@ENABLE_LDISKFS@" = "xyes"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
        fi; \
        if test "x@ENABLE_ZFS@" = "xyes"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
                <~snip~>
        fi; \
        if test "x@ENABLEO2IB@" != "xno"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
                export O2IB_SRC="@O2IBPATH@"; \
        fi; \
        if test "x@CONFIG_CACHE_FILE@" != "x"; then \
                export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
        fi; \
        if test "x@ENABLE_GSS@" = "xyes"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
                <~snip~>
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
                <~snip~>
		export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
                <~snip~>
		export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
                <~snip~>
		export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \

The ENABLE_xxx variables are defined in config/*.m4 files by checking enable_xxx variables, which are defined while running user specified configure command before running "make debs".

Comment by Jian Yu [ 28/Feb/23 ]

As we can see, not all of the configure options are detected and passed to the configure command in debian/rules while running "make debs".
I'm trying to figure out which ones are needed to be added into lustre/autoconf/*.m4, config/*.m4, autoMakefile.am and debian/rules.

Comment by Gerrit Updater [ 29/Mar/23 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50464
Subject: LU-16517 build: pass extra configure options to "make debs"
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ea176510f349bebdcf754bb645e7be12617465e9

Comment by Gerrit Updater [ 31/May/23 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51178
Subject: LU-16517 build: pass extra configure options to "make debs"
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 20f24f6238c4b2a0b4160ad6674ac8c61332f6e7

Comment by Gerrit Updater [ 09/Jun/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50464/
Subject: LU-16517 build: pass extra configure options to "make debs"
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3989529f22f5c54a98e445674b4b3cc443a3af5f

Comment by Peter Jones [ 09/Jun/23 ]

Landed for 2.16

Comment by Gerrit Updater [ 19/Oct/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51178/
Subject: LU-16517 build: pass extra configure options to "make debs"
Project: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: 5abc979eb64d8a78888aea63c0cf7e285fa0a4dd

Generated at Sat Feb 10 03:27:42 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.