Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4070588ybl; Mon, 27 Jan 2020 16:04:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwdAXbkTGV/vDDcMUCwq3nU9ds99lf+9LGR1/90rEHQMmDZmAV14TmjlBlJsi18am04qIjw X-Received: by 2002:a05:6808:251:: with SMTP id m17mr1157927oie.15.1580169880743; Mon, 27 Jan 2020 16:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580169880; cv=none; d=google.com; s=arc-20160816; b=CXSMtGpzjeIrdFmtDsGNck1vw/1PF6sDsOJ+AgF8FdSdtvVY0Dw7DmICok/8/ocQfm o2uyCO/rLiu9cJsvhhXzjddXf7qr676ZqVKbPpJ2fwfr3Xy1jlansrCR50+DCotWfr5F +YrtlhAqD8lV2jgFHmPxQqF7ygr+RZUWNSa6HD3Oe09wXLJwDOdRoTBIjSZVjZYo7hfE XM9rqgzuVKRsbezlqfULf/KByXyq9ZfiiO9fxyD2D3o/NCzKRwRVkXOsiUPenG9T2eg3 7LvLZRaadXMpAViLRZm7em9sc4NQhs2oyFNlerxcWdvgIYgvwWITVd82l93/WO64GDkr w20w== 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=l/+22tuCgv/c7pzmNa8hMOqSD4cnYp/OANcRNx6S0OE=; b=v89dMPeFSxpmJlYt7ZVo2mWAG4IkouUuTtk/xf2wqTjj2gISzz1bZro5LOAeJr//RL sppPXHZoN6Is1jiHEjrOTpjqYDJViKD6J9qCsUvmISkdD58jydWP0xgMSyvmT6AjBw/q vUjr49REelt8RdCaSJKJ2wjKWO87L/inkzVDHKHX4V4UA1ZZYrGYW2aN8yvNggzPOpjN cfroLmxbACd6d53QK7LshsWAntIrfBOzvNnutYRZWC3xF1OzEPpe7sv4IG+LTVe8o5yU ZA3jocCTLEW6zsgxhoSsZvsFAGGwGVWRcZPHk3YCNMJvycBPKz5yhdv9ZsQRxPQtkOa/ hEIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gfeoTWee; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si4073082oij.136.2020.01.27.16.04.21; Mon, 27 Jan 2020 16:04:40 -0800 (PST) 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=@google.com header.s=20161025 header.b=gfeoTWee; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726210AbgA1ADB (ORCPT + 99 others); Mon, 27 Jan 2020 19:03:01 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41094 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgA1ADB (ORCPT ); Mon, 27 Jan 2020 19:03:01 -0500 Received: by mail-pf1-f193.google.com with SMTP id w62so5677356pfw.8 for ; Mon, 27 Jan 2020 16:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l/+22tuCgv/c7pzmNa8hMOqSD4cnYp/OANcRNx6S0OE=; b=gfeoTWeeEpelq2VhnCxceWKTgALWOfvaDYWNXG3I3R+mR60voLJm2xVMRyEQ61FmMG /zmvCPAW3FXmZlOCpzGJmlT3H8XVJ1HNtAq7EJ+7cfVI/4/EvouJfNllrUiqfWodaVAJ eoo/iwDocujDURl/NjLnM9iRzs+gDxRmV5Zxa8fEoyx+H4/wN97Jh5xDq1TdNwajO7yC HyhNSs6EJ/MQlXYgYuyJ5DzA6F9gOLwQBlbSVH/56G+ERq0eF3AnCdtwZUvaHzEfHmA+ FvlQA0K9iI4aJBPKMxLfbGZtGcUAMKt3+R8gzNeDFGXU2HZHfLkio7yyG59acg1Q41Sw n/Qg== 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=l/+22tuCgv/c7pzmNa8hMOqSD4cnYp/OANcRNx6S0OE=; b=C0DAE8n41f7D1Kg94Jm61ZpRTuzPfCRGAhVsNBJRPfyUHzoK17zB7y3e+c7erlNgTO p/XubULRYw2CZ6pUguxHlbysTPK73p2AudpID7VysrRJFH6YDllip3set+FIh7qDeFDE e8rnDdzRCu+NaVAuvTgVeHk2D8X4HLNRfbRboOKe5EAh+ZwiS2mQ3JuOCWVZslBkLeDH AQ2sr0KI5P1GXE/7irFHfMy67HMmnjTsKdhBo8BYkZuQQjxsnqxuc74jxpT/hN79RWzS rKe8BOe8I/Yev/dgdXWfg4p9hJH5otGrBE9bjcts/gazz4kEHJJwURCKiPbFL8SSS93+ yb7A== X-Gm-Message-State: APjAAAWcr8oGlEEmHTzYrM/YLnF8/4WUB/ukWM517FvEMSigx/bcesFd CB9dHdUBICAo79xxoXMXbh1RwfWc8k09PjMZX2ygXA== X-Received: by 2002:aa7:961b:: with SMTP id q27mr1155291pfg.23.1580169780179; Mon, 27 Jan 2020 16:03:00 -0800 (PST) MIME-Version: 1.0 References: <20200126015924.4198-1-sj38.park@gmail.com> In-Reply-To: <20200126015924.4198-1-sj38.park@gmail.com> From: Brendan Higgins Date: Mon, 27 Jan 2020 16:02:48 -0800 Message-ID: Subject: Re: [PATCH] kunit/kunit_kernel: Rebuild .config if .kunitconfig is modified To: SeongJae Park Cc: "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , SeongJae Park 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 On Sat, Jan 25, 2020 at 5:59 PM wrote: > > From: SeongJae Park > > Deletions of configs in the '.kunitconfig' is not applied because kunit > rebuilds '.config' only if the '.config' is not a subset of the > '.kunitconfig'. To allow the deletions to applied, this commit modifies > the '.config' rebuild condition to addtionally check the modified times > of those files. The reason it only checks that .kunitconfig is a subset of .config is because we don't want the .kunitconfig to remove options just because it doesn't recognize them. It runs `make ARCH=um olddefconfig` on the .config that it generates from the .kunitconfig, and most of the time that means you will get a .config with lots of things in it that aren't in the .kunitconfig. Consequently, nothing should ever be deleted from the .config just because it was deleted in the .kunitconfig (unless, of course, you change a =y to a =n or # ... is not set), so I don't see what this change would do. Can you maybe provide an example? > Signed-off-by: SeongJae Park > --- > tools/testing/kunit/kunit_kernel.py | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py > index cc5d844ecca1..a3a5d6c7e66d 100644 > --- a/tools/testing/kunit/kunit_kernel.py > +++ b/tools/testing/kunit/kunit_kernel.py > @@ -111,17 +111,22 @@ class LinuxSourceTree(object): > return True > > def build_reconfig(self, build_dir): > - """Creates a new .config if it is not a subset of the .kunitconfig.""" > + """Creates a new .config if it is not a subset of, or older than the .kunitconfig.""" > kconfig_path = get_kconfig_path(build_dir) > if os.path.exists(kconfig_path): > existing_kconfig = kunit_config.Kconfig() > existing_kconfig.read_from_file(kconfig_path) > - if not self._kconfig.is_subset_of(existing_kconfig): > - print('Regenerating .config ...') > - os.remove(kconfig_path) > - return self.build_config(build_dir) > - else: > + subset = self._kconfig.is_subset_of(existing_kconfig) > + > + kunitconfig_mtime = os.path.getmtime(kunitconfig_path) > + kconfig_mtime = os.path.getmtime(kconfig_path) > + older = kconfig_mtime < kunitconfig_mtime > + > + if subset and not older: > return True > + print('Regenerating .config ...') > + os.remove(kconfig_path) > + return self.build_config(build_dir) > else: > print('Generating .config ...') > return self.build_config(build_dir) > -- > 2.17.1 >