[5/5] selftests/nolibc: generate config automatically

Message ID 20231010-nolibc-out-of-tree-v1-5-b6a263859596@weissschuh.net
State New
Headers
Series selftests/nolibc: various build improvements |

Commit Message

Thomas Weißschuh Oct. 10, 2023, 12:34 p.m. UTC
  This new target generates a .config if none exists yet.

Also drop the defconfig target with its hidden call to 'mrproper' which
is fairly invasive.
If users want to overwrite their kernel existing kernel configuration
they can do so easily from the toplevel directory.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/testing/selftests/nolibc/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Willy Tarreau Oct. 22, 2023, 9:36 a.m. UTC | #1
On Tue, Oct 10, 2023 at 02:34:00PM +0200, Thomas Weißschuh wrote:
> This new target generates a .config if none exists yet.
> 
> Also drop the defconfig target with its hidden call to 'mrproper' which
> is fairly invasive.
> If users want to overwrite their kernel existing kernel configuration
> they can do so easily from the toplevel directory.

Hmmm I'm not sure about that one, I pretty much remember seeing failing
arm64 builds when mrproper and prepare were missing.

I would argue that someone starting "make defconfig" does expect the
config to be dropped, hence mrproper to be called as well.

What specific issue did you face with it ? Maybe we can restrict it to
only a few cases ?

Willy
  
Thomas Weißschuh Oct. 24, 2023, 4:17 p.m. UTC | #2
Oct 22, 2023 11:37:05 Willy Tarreau <w@1wt.eu>:

> On Tue, Oct 10, 2023 at 02:34:00PM +0200, Thomas Weißschuh wrote:
>> This new target generates a .config if none exists yet.
>>
>> Also drop the defconfig target with its hidden call to 'mrproper' which
>> is fairly invasive.
>> If users want to overwrite their kernel existing kernel configuration
>> they can do so easily from the toplevel directory.
>
> Hmmm I'm not sure about that one, I pretty much remember seeing failing
> arm64 builds when mrproper and prepare were missing.
>
> I would argue that someone starting "make defconfig" does expect the
> config to be dropped, hence mrproper to be called as well.
>
> What specific issue did you face with it ? Maybe we can restrict it to
> only a few cases ?

It was mostly a quality improvement for my testscript, where the config was generated
automatically.

And then I dropped the combined defconfig target
because it seemed unnecessary.

Let's drop this patch.

Thomas
  

Patch

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 21e3f7da2ecf..5a3623680f1a 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -173,7 +173,7 @@  all: run
 
 sysroot: sysroot/$(ARCH)/include
 
-sysroot/$(ARCH)/include:
+sysroot/$(ARCH)/include: $(objtree)/.config
 	$(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot
 	$(QUIET_MKDIR)mkdir -p sysroot
 	$(Q)$(MAKE) -C $(srctree) outputmakefile
@@ -216,13 +216,13 @@  initramfs: nolibc-test
 	$(call QUIET_INSTALL, initramfs/init)
 	$(Q)cp nolibc-test initramfs/init
 
-defconfig:
-	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
+$(objtree)/.config:
+	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG)
 
-kernel:
+kernel: $(objtree)/.config
 	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME)
 
-kernel-standalone: initramfs
+kernel-standalone: $(objtree)/.config initramfs
 	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs
 
 # run the tests after building the kernel