Whamcloud - gitweb
LU-18622 build: remove build/, save kconfig results 99/57699/2
authorTimothy Day <timday@amazon.com>
Tue, 7 Jan 2025 19:02:09 +0000 (19:02 +0000)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Feb 2025 06:29:52 +0000 (06:29 +0000)
Remove that last few files from build/ and save the kernel
configuration test results. This should allow developers to
more easily debug kernel configuration failures.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I8c81123835c6a4804e846ef2ea61d8bf025f4fda
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57699
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
.gitignore
autoMakefile.am
build/.gitignore [deleted file]
build/autoMakefile.am [deleted file]
config/Kbuild [moved from build/Makefile with 98% similarity]
config/Rules.in [moved from build/Rules.in with 100% similarity]
config/lustre-build-linux.m4
config/lustre-build.m4

index f9b5b91..7bacb7b 100644 (file)
@@ -97,6 +97,7 @@ TAGS
 /series
 /stamp-h1
 /LUSTRE-VERSION-FILE
+/kconftest.*
 
 # common python venv names
 /.venv
index 11c423a..1b3ca82 100644 (file)
@@ -143,7 +143,7 @@ modules: undef.h ldiskfs-sources
        $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
        KBUILD_EXTRA_SYMBOLS="@INT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@ $(KBUILD_EXTRA_SYMBOLS)" \
        LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
-       -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
+       -f $(PWD)/config/Kbuild LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
        LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -Iarch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC)$$(building_out_of_srctree),-Iinclude2 -I$$(srctree)/include) -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iarch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/include/uapi -Iinclude/generated/uapi -include $(CONFIG_INCLUDE)' \
        $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
        include/config/MARKER $@
@@ -151,7 +151,7 @@ if EXTERNAL_KO2IBLND
        $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) BUILD_EXT_O2IB=yes \
        KBUILD_EXTRA_SYMBOLS="$(PWD)/Module.symvers @EXT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
        LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
-       -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
+       -f $(PWD)/config/Kbuild LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
        LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -Iarch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC)$$(building_out_of_srctree),-Iinclude2 -I$$(srctree)/include) -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iarch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/include/uapi -Iinclude/generated/uapi -include $(CONFIG_INCLUDE)' \
        $(MODULE_TARGET)=$(PWD)/lnet/klnds/o2iblnd -o tmp_include_depends -o scripts -o \
        include/config/MARKER $@
@@ -181,8 +181,8 @@ dist-hook: undef.h
                        -name .#* -exec rm -rf {} \;
 
 EXTRA_DIST = @PACKAGE_TARNAME@.spec    \
-       build/Makefile                  \
-       build/Rules.in                  \
+       config/Kbuild                   \
+       config/Rules.in                 \
        config.h.in                     \
        lustre-dkms_pre-build.sh        \
        lustre-dkms_post-build.sh       \
diff --git a/build/.gitignore b/build/.gitignore
deleted file mode 100644 (file)
index b5e8c93..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/Rules
-/conftest.i
-/modules.order
-/Module.markers
-/lustre.spec
-/Module.symvers
-/Modules.symvers
-!Makefile
diff --git a/build/autoMakefile.am b/build/autoMakefile.am
deleted file mode 100644 (file)
index 9b24284..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-# build/autoMakefile.am
-#
-# Override the default distclean, which removes Makefile
-#
-
-MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
-
-distclean: distclean-recursive
-       @true
similarity index 98%
rename from build/Makefile
rename to config/Kbuild
index 2f767ae..d09bdc3 100644 (file)
@@ -3,8 +3,6 @@
 #
 # This file is part of Lustre, http://www.lustre.org/
 #
-# build/Makefile
-#
 # There are four ways this Makefile can be called:
 #
 # 1.  As a subdirectory from the toplevel, for automake
similarity index 100%
rename from build/Rules.in
rename to config/Rules.in
index 64609d1..8b9e524 100644 (file)
@@ -11,30 +11,30 @@ makerule="$PWD/build"
 AC_CACHE_CHECK([for external module build target], lb_cv_module_target,
 [
        lb_cv_module_target=""
-       rm -f build/conftest.i
+       rm -f kconftest.dir/conftest.i
        MODULE_TARGET="M"
-       makerule="$PWD/build"
+       makerule="$PWD/kconftest.dir"
        LB_LINUX_TRY_MAKE([], [],
                [$makerule LUSTRE_KERNEL_TEST=conftest.i],
-               [test -s build/conftest.i],
+               [test -s kconftest.dir/conftest.i],
                [lb_cv_module_target="M54"], [
        MODULE_TARGET="M"
-       makerule="_module_$PWD/build"
+       makerule="_module_$PWDkconftest.dir"
        LB_LINUX_TRY_MAKE([], [],
                [$makerule LUSTRE_KERNEL_TEST=conftest.i],
-               [test -s build/conftest.i],
+               [test -skconftest.dir/conftest.i],
                [lb_cv_module_target="M"], [
        MODULE_TARGET="M"
        makerule=""
        LB_LINUX_TRY_MAKE([], [],
                [$makerule LUSTRE_KERNEL_TEST=conftest.i],
-               [test -s build/conftest.i],
+               [test -s kconftest.dir/conftest.i],
                [lb_cv_module_target="M58"], [
        makerule=""
        lb_cv_dequote_CC_VERSION_TEXT=yes
        LB_LINUX_TRY_MAKE([], [],
                [$makerule LUSTRE_KERNEL_TEST=conftest.i],
-               [test -s build/conftest.i],
+               [test -s kconftest.dir/conftest.i],
                [lb_cv_module_target="M517"], [
                        AC_MSG_ERROR([kernel module make failed; check config.log for details])
        ])])])])
@@ -53,7 +53,7 @@ AC_CACHE_CHECK([for compiler version text], lb_cv_dequote_CC_VERSION_TEXT, [
 AS_IF([test -z "$lb_cv_module_target"],
        [AC_MSG_ERROR([unknown external module build target])],
 [test "x$lb_cv_module_target" = "xM54"],
-       [makerule="$PWD/build"
+       [makerule="$PWD/kconftest.dir"
        lb_cv_module_target="M"],
 [test "x$lb_cv_module_target" = "xM58"],
        [makerule=""
@@ -62,7 +62,7 @@ AS_IF([test -z "$lb_cv_module_target"],
        [makerule=""
        lb_cv_module_target="M"],
 [test "x$lb_cv_module_target" = "xM"],
-       [makerule="_module_$PWD/build"])
+       [makerule="_module_$PWD/kconftest.dir"])
 MODULE_TARGET=$lb_cv_module_target
 AC_SUBST(MODULE_TARGET)
 ])
@@ -477,8 +477,8 @@ LB_LINUX_TRY_MAKE([
 ], [
        $makerule LUSTRE_KERNEL_TEST=conftest.i
 ], [dnl
-       grep request_module build/conftest.i |dnl
-               grep -v `grep "int myretval=" build/conftest.i |dnl
+       grep request_module kconftest.dir/conftest.i |dnl
+               grep -v `grep "int myretval=" kconftest.dir/conftest.i |dnl
                        cut -d= -f2 | cut -d" "  -f1`dnl
                >/dev/null dnl
 ], [lb_cv_module_loading="yes"], [lb_cv_module_loading="no"])
@@ -664,12 +664,17 @@ MODULE_LICENSE("GPL");])
 #
 AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([AC_LANG_SOURCE([$1])])])dnl
-rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
-AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] DEQUOTE_CC_VERSION_TEXT=$lb_cv_dequote_CC_VERSION_TEXT LDFLAGS= ${LD:+LD="$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_CHECK_INCLUDE -I$LINUX/arch/$SUBARCH/include -Iinclude -Iarch/$SUBARCH/include/generated -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -Iinclude/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include -I$ZFS/include/os/linux/kernel -I$ZFS/include/os/linux/spl -I$ZFS/include/os/linux/zfs -I${SPL:-$ZFS/include/spl}} -include $CONFIG_INCLUDE" KBUILD_EXTRA_SYMBOLS="${ZFS_OBJ:+$ZFS_OBJ/Module.symvers} $KBUILD_EXTRA_SYMBOLS" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
+mkdir -p kconftest.dir/
+rm -f kconftest.dir/conftest.o kconftest.dir/conftest.mod.c kconftest.dir/conftest.ko
+cp config/Kbuild kconftest.dir/
+AS_IF([AC_TRY_COMMAND(cp conftest.c kconftest.dir && make -d [$2] DEQUOTE_CC_VERSION_TEXT=$lb_cv_dequote_CC_VERSION_TEXT LDFLAGS= ${LD:+LD="$LD"} CC="$CC" -f $PWD/kconftest.dir/Kbuild LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_CHECK_INCLUDE -I$LINUX/arch/$SUBARCH/include -Iinclude -Iarch/$SUBARCH/include/generated -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -Iinclude/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include -I$ZFS/include/os/linux/kernel -I$ZFS/include/os/linux/spl -I$ZFS/include/os/linux/zfs -I${SPL:-$ZFS/include/spl}} -include $CONFIG_INCLUDE" KBUILD_EXTRA_SYMBOLS="${ZFS_OBJ:+$ZFS_OBJ/Module.symvers} $KBUILD_EXTRA_SYMBOLS" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/kconftest.dir) >/dev/null && AC_TRY_COMMAND([$3])],
        [$4],
        [_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$5],[$5])dnl])
-rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl
+export RES_DIR=$RANDOM
+mkdir -p kconftest.results/$RES_DIR
+cp -r kconftest.dir/* kconftest.results/$RES_DIR
+rm -f kconftest.dir/conftest.o kconftest.dir/conftest.mod.c kconftest.dir/conftest.mod.o kconftest.dir/conftest.ko m4_ifval([$1], [kconftest.dir/conftest.c conftest.c])[]dnl
 ])
 
 #
@@ -680,7 +685,7 @@ rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.
 AC_DEFUN([LB_LINUX_TRY_COMPILE], [
 LB_LINUX_COMPILE_IFELSE(
        [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
-       [modules], [test -s build/conftest.o],
+       [modules], [test -s kconftest.dir/conftest.o],
        [$3], [$4])
 ])
 
@@ -724,7 +729,7 @@ AC_DEFUN([LB_CHECK_LINUX_HEADER], [
        AS_VAR_PUSHDEF([lb_header], [lb_cv_header_$1])
        AC_CACHE_CHECK([for $1], lb_header, [
                LB_LINUX_COMPILE_IFELSE([LB_LANG_PROGRAM([@%:@include <$1>])],
-                       [modules], [test -s build/conftest.o],
+                       [modules], [test -s conftest/conftest.o],
                        [AS_VAR_SET([lb_header], [yes])],
                        [AS_VAR_SET([lb_header], [no])])
        ])
index fd62f31..93f2164 100644 (file)
@@ -414,7 +414,7 @@ AC_DEFUN([LB_CONFIG_FILES], [
                Makefile
                autoMakefile]
                config/Makefile
-               [Rules:build/Rules.in]
+               [Rules:config/Rules.in]
                AC_PACKAGE_TARNAME[.spec]
                AC_PACKAGE_TARNAME[-dkms.spec]
                ldiskfs/Makefile