linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
From: Vitor Massaru Iha <vitor@massaru.org>
To: "linux-kernel-mentees@lists.linuxfoundation.org"
	<linux-kernel-mentees@lists.linuxfoundation.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Subject: [Linux-kernel-mentees] [Bug Report] tools/testing/kunit/kunit.py run --build_dir='<foo>' fails on "unclean" trees
Date: Fri, 01 May 2020 15:01:24 -0300	[thread overview]
Message-ID: <0d669c930e4a7c8e91ce85504541a4522bf63770.camel@massaru.org> (raw)

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

                 reply	other threads:[~2020-05-01 18:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d669c930e4a7c8e91ce85504541a4522bf63770.camel@massaru.org \
    --to=vitor@massaru.org \
    --cc=brendanhiggins@google.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).