[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/92] ninjatool: rebuild multi-output targets if outputs are miss
From: |
Paolo Bonzini |
Subject: |
[PULL 03/92] ninjatool: rebuild multi-output targets if outputs are missing |
Date: |
Thu, 24 Sep 2020 05:21:45 -0400 |
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 <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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 = '%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,
inputs, orderonly))
self.rule_targets[rule].append(stamp)
self.stamp_targets[rule].append(stamp)
--
2.26.2
- [PULL 00/92] Misc patches for 2020-09-24, Paolo Bonzini, 2020/09/24
- [PULL 02/92] meson: clean up build_by_default, Paolo Bonzini, 2020/09/24
- [PULL 03/92] ninjatool: rebuild multi-output targets if outputs are missing,
Paolo Bonzini <=
- [PULL 01/92] tests: add missing genh dependency, Paolo Bonzini, 2020/09/24
- [PULL 05/92] meson: error out if qemu_suffix starts with /, Paolo Bonzini, 2020/09/24
- [PULL 04/92] meson: fix MSI rule, Paolo Bonzini, 2020/09/24
- [PULL 07/92] configure: Do not intent to build WHPX on 32-bit host, Paolo Bonzini, 2020/09/24
- [PULL 06/92] WHPX: vmware cpuid leaf for tsc and apic frequency, Paolo Bonzini, 2020/09/24
- [PULL 08/92] MAINTAINERS: add Paolo Bonzini as RCU maintainer, Paolo Bonzini, 2020/09/24
- [PULL 09/92] target/i386: support KVM_FEATURE_ASYNC_PF_INT, Paolo Bonzini, 2020/09/24
- [PULL 10/92] memory: Convert IOMMUMemoryRegionClass doc comment to kernel-doc, Paolo Bonzini, 2020/09/24
- [PULL 15/92] numa: remove fixup numa_state->num_nodes to MAX_NODES, Paolo Bonzini, 2020/09/24
- [PULL 12/92] acpi: i386: Move VMBus DSDT entry to SB, Paolo Bonzini, 2020/09/24