From adeb784bb5c6b9629f2bd131e0061baa100a8bd2 Mon Sep 17 00:00:00 2001 From: malc Date: Wed, 30 May 2018 05:05:49 +0300 Subject: [PATCH] Cycle detection --- build.bash | 5 +++++ todo.org | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.bash b/build.bash index 8409f3b..aebe5a5 100755 --- a/build.bash +++ b/build.bash @@ -162,11 +162,13 @@ bocaml2() { } && vecho "fresh '$o'" } +cycle= bocaml() ( local o="$1" local n="$2" local wocmi="${o%.cmi}" local s + local cycle1=$cycle case ${wocmi#$outd/} in confstruct.cmo) s=$outd/confstruct.ml @@ -175,6 +177,8 @@ bocaml() ( test "$o" = "$wocmi" && s=$srcd/${o%.cmo}.ml || s=$srcd/$wocmi.mli o=$outd/$o;; esac + expr >/dev/null "$cycle" : ".*$o" && die cycle $o + cycle="$cycle$o" bocaml1 $n "$s" "$o" case $wocmi in wsi) s="$srcd/$wsid/wsi.ml";; @@ -186,6 +190,7 @@ bocaml() ( local s1=${s#$srcd/} bocaml1 $n "$s" "$outd/${s1%.ml}.cmo" "${o#$outd/}" } || true + cycle=$cycle1 ) bocamlc() { diff --git a/todo.org b/todo.org index d3543f6..ba47bb2 100644 --- a/todo.org +++ b/todo.org @@ -6,8 +6,6 @@ file names? exif? * TODO build.sh ** TODO Parallel builds -** TODO Avoid infinite recursion ** TODO Make isfresh work (properly) with multiple targets -** TODO Move wsi specific stuff out of link.c and into wsi/../xxx.[cm] ** TODO Removing .mlis leads to build errors Nuking everything (or just deleting .deps?) solves it though -- 2.11.4.GIT