linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [Bug Report] tools/testing/kunit/kunit.py run --build_dir='<foo>' fails on "unclean" trees
@ 2020-05-01 18:01 Vitor Massaru Iha
  0 siblings, 0 replies; only message in thread
From: Vitor Massaru Iha @ 2020-05-01 18:01 UTC (permalink / raw)
  To: linux-kernel-mentees; +Cc: Brendan Higgins

Hi,

1. https://bugzilla.kernel.org/show_bug.cgi?id=205219

At first I thought this bug was in KUnit, I changed the KUnit code to
change the ARCH environment variable inside python, as I had tried to
reproduce the bug using another architecture, in my case “arm64”,
instead of “um”, and the way I reproduced the bug, my patch fixed the
bug.

After Brendan reviewed my patch and reported that the bug still exists
and explained the step by step to reproduce the bug, I was able to
reproduce the bug even with my patch:

$ make ARCH=um defconfig && make ARCH=um -j8
  [snip]
$ make ARCH=um mrproper
  [snip]
$ make ARCH=um defconfig O=./build_um && make ARCH=um -j8 O=./build_um
  [snip]
  CC      scripts/mod/empty.o
In file included from ../include/linux/types.h:6,
                 from ../include/linux/mod_devicetable.h:12,
                 from ../scripts/mod/devicetable-offsets.c:3:
../include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such
file or directory
    5 | #include <asm/types.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [../scripts/Makefile.build:100: scripts/mod/devicetable-
offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/home/iha/sdb/opensource/lkmp/linux-
kselftest.git/Makefile:1140: prepare0] Error 2
make[1]: Leaving directory '/home/iha/sdb/opensource/lkmp/linux-
kselftest.git/build_um'
make: *** [Makefile:180: sub-make] Error 2
  
The cause of the error was because arch/$(SUBARCH)/include/generated
files weren't properly cleaned by `make ARCH=um mrproper`.
Then, analyzing the Makefile, and reproducing the bug, I noticed that a
directory was not cleaned by mrproper. I had a hunch that this bug
didn't exist before and I commented to Brendan about running git
bisect. And in fact the bug was introduced in the kernel, as verified
through git bisect. And through the commit I saw where I should fix the
bug.

In the process, I realized that I could have more quickly identified
files not deleted by mrproper just using git clean -idx.

The first solution was to remove the directory not cleaned by mrproper
in the main Makefile. But Masahiro Yamada, in the code review noted
that the problem should be fixed only in architecture “um”, it should
be solved within the Makefile of “um” and suggested another solution
using MRPROPER_DIRS += arch/$(SUBARCH)/include/generated in the
Makefile of “um”.

And with that my patch was accepted:
https://lkml.org/lkml/2020/4/21/1336


BR,
Vitor

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-01 18:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 18:01 [Linux-kernel-mentees] [Bug Report] tools/testing/kunit/kunit.py run --build_dir='<foo>' fails on "unclean" trees Vitor Massaru Iha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).