Fix some bugs in makefile work tracking.

Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
Keith Rothman 2020-02-19 06:19:26 -08:00
parent cf463419bf
commit fabae5eb64
3 changed files with 13 additions and 16 deletions

View File

@ -60,20 +60,6 @@ echo "----------------------------------------"
rm $tmp
exit $DATABASE_RET
fi
# Check there is nothing to do after running...
echo
if [ $(make --dry-run | grep -v 'Nothing to be done' | wc -l) -gt 0 ]; then
echo "The following targets need to still run!"
make --dry-run
echo "----------------------------------------"
echo "Debug output on why they still need to run"
make --dry-run --debug
echo "----------------------------------------"
exit 1
else
echo "All good, nothing more to do!"
fi
)
echo "----------------------------------------"

View File

@ -84,12 +84,12 @@ endif
ifeq ($(3),Y)
fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.$(XRAY_PART).ok fuzzer_ok
fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.$(XRAY_PART).ok | fuzzer_ok
touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok
else
fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.ok fuzzer_ok
fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.ok | fuzzer_ok
touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok
endif

View File

@ -466,6 +466,17 @@ def run_fuzzer(fuzzer_name, fuzzer_dir, fuzzer_logdir, logger, will_retry):
if not should_run_submake(make_flags):
return 0
fuzzer_runok = os.path.join(
fuzzer_dir, "run.{}.ok".format(os.environ['XRAY_PART']))
if os.path.exists(fuzzer_runok):
last_modified = datetime.fromtimestamp(os.stat(fuzzer_runok).st_mtime)
log(
"Skipping as run.{}.ok exists (updated @ {})",
os.environ['XRAY_PART'], last_modified.isoformat())
return 0
fuzzer_runok = os.path.join(fuzzer_dir, "run.ok")
if os.path.exists(fuzzer_runok):
last_modified = datetime.fromtimestamp(os.stat(fuzzer_runok).st_mtime)