Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3821203ybb; Tue, 31 Mar 2020 12:39:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv8uCx5fnCclQ8sJaq5FRNyZItY1qIw+SmbIuKcThgdtnkCDdi7oquAqL+PxQm6dP/EJKoE X-Received: by 2002:a05:6830:1dfa:: with SMTP id b26mr13591925otj.13.1585683585728; Tue, 31 Mar 2020 12:39:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585683585; cv=none; d=google.com; s=arc-20160816; b=m/gwZ6jWteLhwApx9MMVwlMGwj2mgPZAqcgt0Z20jLRtHr5GnYQvZ6YQeFxOrBLBnv 3qap6L6ojdI/x/bGAraULoL8aZYldnmOGPRmKaRqYgUObzODuKhjbVo0agfOfE6yPMOq yg3n71SdaxVjNffOjmn2MlaurMPQJca+HXb1dZhW8KmXm7TQ1xWhYMKZIMXjj/HAczU9 5+KW8qnufHXex3wu298nt6ZSVMmp3sGD2nsXB72cwsqgcnn58A8w2aqkni8dAbb7ntoH KJFAi21QJP4tPLB1pc2sEj2dFYXzPb4gCGWYGc55JhiMfrgLnYObcoHKhSxuEtGQ5jP7 hH/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CmyCyWagylfuKeKB4BO2p4EHeCrzlGpSPlijLTrzQrE=; b=eJoUS1KaMUmkGV3Zvom9XfGGbKF+IMOZ45h3UpN5JVuWz/yrpKBmR5oPBDu4XI/MTv QY0ElzWS9Q2/ich5IBM+T8RARX/RCxceax8CvBiaWP+ihDMofy1WD88LxHk5k49KJzg4 XNEVQ/207eNnOKey6rLOEyr8cYyWxsyaNKncgdEWy4cm4P37/6XCWcu7OQFcDcGYfCxS BQz0TPr10n2UzLei8qG7Msmj/kyDjOtYFGXJE9ENWw0u3iyVPxkxyuVCYPC/xe2+qz4R 0agBX4lnk4s2Ss4jVro5N3PRQElfi78hhCZxMAXGvGQz4JDH/f2pf/w0fjqMVf1XN5F5 +7YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@massaru-org.20150623.gappssmtp.com header.s=20150623 header.b=i3NpJnHq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l63si7990041oif.161.2020.03.31.12.39.32; Tue, 31 Mar 2020 12:39:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@massaru-org.20150623.gappssmtp.com header.s=20150623 header.b=i3NpJnHq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbgCaTjJ (ORCPT + 99 others); Tue, 31 Mar 2020 15:39:09 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:40404 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgCaTjI (ORCPT ); Tue, 31 Mar 2020 15:39:08 -0400 Received: by mail-yb1-f195.google.com with SMTP id a5so8283229ybo.7 for ; Tue, 31 Mar 2020 12:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=massaru-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CmyCyWagylfuKeKB4BO2p4EHeCrzlGpSPlijLTrzQrE=; b=i3NpJnHq4kSwxmmk+3rXgxdW8Wt5LW4Edf8xpVA/myZ6FFGqWy/Sa+cGk5maohkOQg y8WPF8b84LcU2zQHXVM70zuqSL6ixG4qKmAdHZshTqzvgvpH3/x4nny6bJrgYirLw/Xt e+VOU9zfivBrm990mM3EWL29oUt2b6LNVZQEWsmCGkYJhexuUp9A0JbWWyxZM/vQkx03 tzyBPfueZyGMUmSjzf8LtNpzxWmqXsIIpiCLUk7f/1CEBepL5tBomiR3cob+FkM33OPo RQSd9hB1ceYDCHxgX2JI6Y03S00SeRYbcs6RihoC5/E9NC8F49Un2sMHlO+AzuTxlQUa PcPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CmyCyWagylfuKeKB4BO2p4EHeCrzlGpSPlijLTrzQrE=; b=oykf0gKH18iO3XVlh53MBM7G/x5V+5ctjHuQtrwUngh02ZRTy72tR3eaaaAb7cw6kx vkMuTZEnqhYOwH4+iYHtjMI/NubnPY1L14rPcV05K1iJTmqKT4GX2eqv3KqjDsTNdjna m2Rsqv3Za3UIO2F0Kw8aii1ejJxV4XMHX4+s8OzbhxJUeevFkUOr8aG8RJiL3QB24bud 7oWYaXkyFpZdwjRVgaEPlRKvHyqhCfcU2QnwKGG8eooi8oLi93whxcSM1LvrAFxI6Pg3 JrjTocIFdcgglA56L0hrQPDUNBuG/hB0vhXd+3Wga48i8TOJyJDeSFVVxTZHtBAxbdhv sUkQ== X-Gm-Message-State: ANhLgQ1eGKWa6jjlpWYvzPBXSRx1vvaS5G9Y+jO4PEuIjD2z3IOSjn4H irZ5s+6AdLVQe8LYlRVf+JoDtdfaahwRyAGwM04l2w== X-Received: by 2002:a25:c482:: with SMTP id u124mr31079143ybf.286.1585683547417; Tue, 31 Mar 2020 12:39:07 -0700 (PDT) MIME-Version: 1.0 References: <20200330230256.28323-1-vitor@massaru.org> In-Reply-To: From: Vitor Massaru Iha Date: Tue, 31 Mar 2020 16:38:30 -0300 Message-ID: Subject: Re: [PATCH] kunit: Fix kunit.py run --build_dir='' fails on "unclean" trees To: Brendan Higgins Cc: KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Brendan, On Tue, Mar 31, 2020 at 3:27 PM 'Brendan Higgins' via KUnit Development wrote: > > On Mon, Mar 30, 2020 at 4:03 PM Vitor Massaru Iha wrote: > > > > Fix this bug: https://bugzilla.kernel.org/show_bug.cgi?id=205219 > > > > For some reason, the environment variable ARCH is used instead of ARCH > > passed as an argument, this patch uses a copy of the env, but using > > ARCH=um and CROSS_COMPILER='' to avoid this problem. > > > > This patch doesn't change the user's environment variables, avoiding > > side effects. > > Seems reasonable to me. There are other problems here, I'll fix it. > > > Signed-off-by: Vitor Massaru Iha > > I cannot test this as your patch doesn't apply to our for-next branch > (kselftest/kunit). You can find it here: > > https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=kunit > > > --- > > tools/testing/kunit/kunit_kernel.py | 12 +++++++----- > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py > > index d99ae75ef72f..0cb1f81ac8f2 100644 > > --- a/tools/testing/kunit/kunit_kernel.py > > +++ b/tools/testing/kunit/kunit_kernel.py > > @@ -15,6 +15,7 @@ import kunit_config > > > > KCONFIG_PATH = '.config' > > kunitconfig_path = '.kunitconfig' > > +env = dict(os.environ.copy(), ARCH='um', CROSS_COMPILE='') > > > > class ConfigError(Exception): > > """Represents an error trying to configure the Linux kernel.""" > > @@ -36,22 +37,22 @@ class LinuxSourceTreeOperations(object): > > raise ConfigError(e.output) > > > > def make_olddefconfig(self, build_dir): > > - command = ['make', 'ARCH=um', 'olddefconfig'] > > + command = ['make', 'olddefconfig'] > > if build_dir: > > command += ['O=' + build_dir] > > try: > > - subprocess.check_output(command) > > + subprocess.check_output(command, env=env) > > except OSError as e: > > raise ConfigError('Could not call make command: ' + e) > > except subprocess.CalledProcessError as e: > > raise ConfigError(e.output) > > > > def make(self, jobs, build_dir): > > - command = ['make', 'ARCH=um', '--jobs=' + str(jobs)] > > + command = ['make', '--jobs=' + str(jobs)] > > if build_dir: > > command += ['O=' + build_dir] > > try: > > - subprocess.check_output(command) > > + subprocess.check_output(command, env=env) > > except OSError as e: > > raise BuildError('Could not call execute make: ' + e) > > except subprocess.CalledProcessError as e: > > @@ -66,7 +67,8 @@ class LinuxSourceTreeOperations(object): > > [linux_bin] + params, > > stdin=subprocess.PIPE, > > stdout=subprocess.PIPE, > > - stderr=subprocess.PIPE) > > + stderr=subprocess.PIPE, > > + env=env) > > process.wait(timeout=timeout) > > return process > > > > -- > > 2.21.1 > > > > -- > You received this message because you are subscribed to the Google Groups "KUnit Development" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/CAFd5g47hiPf7Xy0f4YER%2BHzHHXyUV0dhiQ%3D2ZXfezEHBcrTuEQ%40mail.gmail.com.