From nobody Tue May 7 14:20:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599831825; cv=none; d=zohomail.com; s=zohoarc; b=F7/WnbkVkhe9juggzOZu37NxTzqFpp3pwJMVpbdWO5wS6x1GlQDXgKh4fJyLsot3yxdaqyM/ZZPYY4NiC4B3loo1lA9PV9Z9FSx23DlzlSdaAojjJGoMCKGIMBFh5bKBGUhoJBk7WCCwRbyWzISjcn++V4ByZ+8TeP3XUjWel+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599831825; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=GkKR887fLWOo4DC15+qJV+odLhc3rljp4gn44gOfM4I=; b=P+h6OUG9GETkAHCtVQaf/6IPmZANZTj2kB48MulH86fnSsiTA/0Mv5vtVOkJSj1bL14PUHQwCOh073JvMH6I/hNdSbVMh8lyDGvLLxq0S6V950CcYfH8WT7bPk//zIyLN5Y9R3fYvL1dfX4N8Xrx7KsZnbhHBlxNSWIjYLuTAIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599831825585813.7530619749789; Fri, 11 Sep 2020 06:43:45 -0700 (PDT) Received: from localhost ([::1]:42716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGjL4-0000hT-3X for importer@patchew.org; Fri, 11 Sep 2020 09:43:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGjJr-0007gL-5p for qemu-devel@nongnu.org; Fri, 11 Sep 2020 09:42:27 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:38659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGjJp-0002mA-K4 for qemu-devel@nongnu.org; Fri, 11 Sep 2020 09:42:26 -0400 Received: by mail-ed1-x542.google.com with SMTP id c8so9995631edv.5 for ; Fri, 11 Sep 2020 06:42:23 -0700 (PDT) Received: from donizetti.lan ([2001:b07:6468:f312:5568:7f99:4893:a5b6]) by smtp.gmail.com with ESMTPSA id i35sm1757165edi.41.2020.09.11.06.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 06:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GkKR887fLWOo4DC15+qJV+odLhc3rljp4gn44gOfM4I=; b=AjIVIHJOZ55sDAN+PJovqaHhO5Mgw9YfeOAVRE0u1Q3oc1G4TxH/BN38HgTwVfiK9P FDtGlKFAte/Udrv7a+Krcl00DSD4qL6FC+gAOU/Yc2s7ggTHb2zhSWmPwiLHEkBHzt8E 5uiJYXsWkZlcOmP5I3VM95hxrBr/dqFH6S5Dw6ZquZ6x2kjstgVG+Bt8x0Lr8kyn/pIg xIO0vHmvgOtMM4FvBCS2zy4q/1SSbwtVYohJsrJ7OlwDCdRcR8R6nxaYOidaZteriqMv cojiuAwqXYzgVJ0ZIoBV/S3gzKxCjPJ/MTthCx9EuVrnnpWftvjwTp84eW/1GjrpL+kc qUqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=GkKR887fLWOo4DC15+qJV+odLhc3rljp4gn44gOfM4I=; b=YRwRJiMP9GjVWUCQ1k2oFt3R466B0jfh943wHIpai3FriltACeFihLiV36dOrqZ0Gk d8m1pc988mtrmZzeQq3TGE+EWwZtuETbe6CQ3/3OnzW00qjh6x0SHSg3RiW4RVRNGhXG Mm+KfeMpYT9F9oyBpzM8+Qp6AVE8sa0jHbYQHBZsl9uerKYmoz7DYuhXwY5HF0dqTFA+ FQGxegzq1dganXw+Rh8aIdtq+mVmnSeBieril4l2cKX3s106rSEFCZjMqVr+3t2nFNfH 3o65N5JDw8+Lp8GT3l5hOmOR1QsXOtNEfWv29DpJSkR61Fcovdy4ZL5SQNiOQYY0WdQw w0uQ== X-Gm-Message-State: AOAM530reBNJWvCGmOM6yZb+cGsFHUabjeGTcbyckIWOP76A+Grj9JQw VdMzg8/QZXwpH2gxrnjuy8Nd/+3Ct+I= X-Google-Smtp-Source: ABdhPJy+c11jtdNBM8j8qwlmY1Ul3ZO4izmh2bC1Y2/LtURfoctxYJT4zCVL5fOXzzdTHnAC123Baw== X-Received: by 2002:a50:875c:: with SMTP id 28mr2060098edv.20.1599831742273; Fri, 11 Sep 2020 06:42:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] ninjatool: rebuild multi-output targets if outputs are missing Date: Fri, 11 Sep 2020 15:42:20 +0200 Message-Id: <20200911134221.46636-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::542; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The "stamp file trick" used to group targets of a single multi-output rule prevents the user from deleting one such target in order to force its rebuild. Doing so will not touch the stamp file, and therefore only the dummy ":" command will be executed. With this patch, ninjatool writes rules that force-rebuild the stamp file if any of its outputs are missing. Rebuilding the missing target therefore causes the stamp file to be rebuilt too. Reported-by: Markus Armbruster Signed-off-by: Paolo Bonzini --- scripts/ninjatool.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py index 627a1cab45..6f0e35c727 100755 --- a/scripts/ninjatool.py +++ b/scripts/ninjatool.py @@ -908,6 +908,9 @@ class Ninja2Make(NinjaParserEventsWithVars): else: stamp =3D '%s@%s.stamp' % (rule, sha1_text(targets)[0:11]) self.print('%s: %s; @:' % (targets, stamp)) + self.print('ifneq (%s, $(wildcard %s))' % (targets, targets)) + self.print('.PHONY: %s' % (stamp, )) + self.print('endif') self.print('%s: %s | %s; ${ninja-command-restat}' % (stamp, in= puts, orderonly)) self.rule_targets[rule].append(stamp) self.stamp_targets[rule].append(stamp) --=20 2.26.2