Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3392817pxy; Mon, 26 Apr 2021 00:09:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn8HbE9TcB1pV+DVCFJeVKbt39zyqWg2ybsF94uRinz0W0iniiUO28vnQjcEu5/K/AfeGr X-Received: by 2002:a05:6a00:212b:b029:259:73ac:7217 with SMTP id n11-20020a056a00212bb029025973ac7217mr17053741pfj.20.1619420946122; Mon, 26 Apr 2021 00:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619420946; cv=none; d=google.com; s=arc-20160816; b=fQw7JegNRk7n2ddxMDq7oAoVW6DqseiIe5i6258zbHN2Zg17eS7Rn/K/pNqfF5lcr7 NlCq8ZJc82a9xX5CJeofFeVKyRqta17ute3XfrNAaY+Y66UfiCm6/TEO9PgX6sRkaSwD rt9/kW8Hd0JYiP8AffNpg+hsgrJuwb2ueqs47aoBNqZSh3rf+z76iAIJP3fcjDk7jTKx jUrUPqLtJfnK65i/4r5HY1D7jPm0rV6Y1oLyiixFyCL4p5W/aE1vnG27vXshhi2p3vIs W6w068CjSuVBgGNaTBsCIbYnyeNOx1zXKqc4s1CqiGglMthgUpnuiwmb7zsnZ9Z5bM6X KmXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=TQwmFx5qYzKQCr2bCLGzTGQ0ErVGGivC1LugG10SO70=; b=I1Dt9fCNZfk4aCntbfV43B+B7e3XRtpa3UX1lOWDnCjmGeW4uV23utz9mRZUPXTckr syn4eLZt+YGdck9ZD7aSmYcS7aIOfU2avTuJZxU/KfihCPoaQWgD1rEaeNcVf3RxgOYJ BMhaTsNcXcOK0LG+4tftA40JZeP16KgPnL43O870bA4DtyXL+SUXH9AkKaONcohZx8BC QM1Zn41+fA6/0NfsPYKKpIXPxJn5z8alXJ/36oAXwucYmYk5KqTWKLkTgoxf25BSgMtY yUA6Jub+gidfkhJvAvdag6Ke8IqJAFSmTGlSXDHELK7pUCN6VKLrPom3Dt2bbHRgdZsc VhXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Px1iLyXh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si15677687pjq.168.2021.04.26.00.08.53; Mon, 26 Apr 2021 00:09:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Px1iLyXh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232119AbhDZHHd (ORCPT + 99 others); Mon, 26 Apr 2021 03:07:33 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:17394 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232114AbhDZHH3 (ORCPT ); Mon, 26 Apr 2021 03:07:29 -0400 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 13Q76IZo017712; Mon, 26 Apr 2021 16:06:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 13Q76IZo017712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1619420779; bh=TQwmFx5qYzKQCr2bCLGzTGQ0ErVGGivC1LugG10SO70=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Px1iLyXhYx+tyTEyy/GWZ04rwR9kUXnBybL//ouGmPX0MAlcjfLSrYf31hy2gP9fn QpFoMPDSQeqizb9ccBxUBU2smPOFlCh18D0LHKTulvOVhVPjl69l2HVAgz2mbIuIxN T6nfpzRs6QBKAjGY/zevEK0iu6Hi1LjBm4EdSeB+O9HzkTdZrs/zuc6RwDuks0PyPr eoba9j37aNtTOfnBiYzN8fsxWVAWo1LZ4UGlYDH1xp1VP6jgQU2OHCNTjBer76V9u9 M0MoP89hP4N9IfKlqneAEpT785PP7rSgAgDXi7EIXK2hzmrIPMok+BZ82WOWK88hUe qZvovOE6WIETg== X-Nifty-SrcIP: [209.85.215.177] Received: by mail-pg1-f177.google.com with SMTP id p12so39455414pgj.10; Mon, 26 Apr 2021 00:06:19 -0700 (PDT) X-Gm-Message-State: AOAM531p8s36x2SN9wpS57O4BG+2ENSN1i7gwtcV4uLy2n00q2vscnfB PbkyhdJA6CZJKKzdt9Dq5zGnFSIQAtogFu0WTmo= X-Received: by 2002:a05:6a00:b4b:b029:276:6388:a3ac with SMTP id p11-20020a056a000b4bb02902766388a3acmr4043608pfo.80.1619420778334; Mon, 26 Apr 2021 00:06:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Mon, 26 Apr 2021 16:05:41 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Running kunit_tool on unclean trees To: Marcelo Schmitt Cc: kunit-dev@googlegroups.com, "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , andersonreisrosa@gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 25, 2021 at 4:05 AM Marcelo Schmitt wrote: > > Hi, a friend and I were chasing bug 205219 [1] listed in Bugzilla. > We step into something a little bit different when trying to reproduce > the buggy behavior. In our try, compilation failed with a message form > make asking us to clean the source tree. We couldn't run kunit_tool > after compiling the kernel for x86, as described by Ted in the > discussion pointed out by the bug report. > > Steps to reproduce: > > 0) Run kunit_tool > $ ./tools/testing/kunit/kunit.py run > Works fine with a clean tree. > > 1) Compile the kernel for some architecture (we did it for x86_64). > > 2) Run kunit_tool again > $ ./tools/testing/kunit/kunit.py run > Fails with a message form make asking us to clean the source tree. This is probably because tools/testing/kunit/kunit_kernel.py runs make with O= option. > Removing the clean source tree check from the top-level Makefile gives > us a similar error to what was described in the bug report. We see that > after running `git clean -fdx` kunit_tool runs nicely again. However, > this is not a real solution since some kernel binaries are erased by git. > > We also had a look into the commit messages of Masahiro Yamada but > couldn't quite grasp why the check for the tree to be clean was added. > We could invest more time in this issue but actually don't know how to > proceed. We'd be glad to receive any comment about it. We could also try > something else if it's a too hard issue for beginners. I think you are talking about the following error message. *** *** The source tree is not clean, please run 'make mrproper' *** in /home/masahiro/ref/linux *** Kbuild checks if the source tree is clean before starting the out-of-tree build because the out-of-tree build relies on VPATH. This check has existed for a long time. (at least more than a decade) If Kbuild started the O= build with a dirty source tree, some stale generated source files would have been remaining. (some *.c and *.h are generated by scripts) Then, Kbuild would wrongly use stale source files in srctree instead of generating new ones in objtree. > [1]: https://bugzilla.kernel.org/show_bug.cgi?id=205219 > > > Best Regards, > > Marcelo -- Best Regards Masahiro Yamada