Re: kbuild: Ctrl-C of parallel kernel build sometimes corrupts .o.cmd files permanently

From: Ingo Molnar
Date: Thu Jun 03 2021 - 08:40:28 EST



* Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:

> Hmm, I have not observed this.
>
> My expectation is, it should work like this:
>
> When scripts/basic/fixdep is interrupted (or fail due to any reason),
> partially written *.o.cmd is left over. So, having incomplete *.o.cmd
> files is expectation.
>
> When .DELETE_ON_ERROR is specified, GNU Make is supposed to
> automatically delete the target on any error.
> (If it is interrupted, it should exit with code 130)
>
> On the next invocation of Make, Kbuild will not include .*.o.cmd files
> whose corresponding *.o files do not exist.
>
>
>
>
>
> When you got the corrupted drivers/gpu/drm/.drm_blend.o.cmd,
> didn't you see the log
> Deleting file 'drivers/gpu/drm/drm_blend.o' ?
>
>
>
> If it works as I expect, the log should look like follows:
> (I marked the lines with '<---- Deleting')
>
>
>
> CC security/keys/keyctl_pkey.o
> CC kernel/sys.o
> CC arch/x86/power/hibernate_64.o
> ^Cmake[5]: *** Deleting file 'drivers/video/fbdev/core/fbcmap.o' <---- Deleting
> make[5]: *** [scripts/Makefile.build:272:
> drivers/video/fbdev/core/fbmon.o] Interrupt
> make[3]: *** [scripts/Makefile.build:272: security/selinux/nlmsgtab.o] Interrupt
> make[2]: *** [scripts/Makefile.build:272: arch/x86/power/cpu.o] Interrupt
> make[2]: *** [scripts/Makefile.build:272:

Interestingly I don't get *any* interruption messages at all:

CC drivers/dma/dw/acpi.o
CC sound/pci/ice1712/ice1712.o
CC drivers/char/ipmi/ipmi_watchdog.o
CC fs/overlayfs/export.o
CC fs/nls/nls_cp936.o
CC drivers/char/ipmi/ipmi_poweroff.o
^Ckepler:~/tip>

The '^C' there - it just stops, make never prints anything for me.

Weird ...

Thanks,

Ingo