From: Sergey Matveev Date: Fri, 16 Jan 2026 12:12:18 +0000 (+0300) Subject: Warn if non-top target does not write anything X-Git-Tag: v2.9.0~1 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e42f5fc4b78400781b86bb421757d2820cbd6391;p=goredo.git Warn if non-top target does not write anything --- diff --git a/doc/INSTALL b/doc/INSTALL index 9b26ded..c488783 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -11,7 +11,7 @@ Possibly goredo package already exists for your distribution: Preferable way is to [Download] tarball with the signature from website: - $ v=2.8.0 + $ v=2.9.0 $ [fetch|wget] http://www.goredo.cypherpunks.su/download/goredo-$v.tar.zst $ [fetch|wget] http://www.goredo.cypherpunks.su/download/goredo-$v.tar.zst.{asc,sig,cm} [Integrity] verify diff --git a/doc/NEWS b/doc/NEWS index 9044072..e6015e1 100644 --- a/doc/NEWS +++ b/doc/NEWS @@ -1,3 +1,8 @@ +A 2.9.0 +2.9.0 + * Warn if non-top target did not write anything. + Idea was borrowed from redo-sh. + A 2.8.0 2.8.0 * Fix always-OOD .do-targets with nearby default.do. diff --git a/doc/cmd/redo-ifchange b/doc/cmd/redo-ifchange index 8976135..f907f92 100644 --- a/doc/cmd/redo-ifchange +++ b/doc/cmd/redo-ifchange @@ -8,6 +8,8 @@ Pay attention that redo-ifchange enables parallel builds of the given targets, but ordinary redo is not: it builds specified targets sequentially and stops when error happens. +It will warn if non-top target did not write anything. + A [Env] REDO_STOP_IF_MODIFIED If redo sees some target modified externally, then by default it warns user about that, does not build that target, but continues the build diff --git a/run.go b/run.go index 412e895..d043d1a 100644 --- a/run.go +++ b/run.go @@ -745,6 +745,9 @@ func runScript(tgt *Tgt, errs chan error, forced, traced bool) error { // Do we need to ifcreate it, or ifchange with renaming? if fd == nil { + if Level > 0 { + tracef(CWarn, "%s: nothing written to target", tgt) + } os.Remove(tgt.a) err = ifcreate(fdDepW, fdDep.Name(), tgtT) if err != nil { diff --git a/t/goredo-build-uuid-for-fdood.t b/t/goredo-build-uuid-for-fdood.t index 2930ef0..d0d7ba1 100755 --- a/t/goredo-build-uuid-for-fdood.t +++ b/t/goredo-build-uuid-for-fdood.t @@ -6,9 +6,12 @@ export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1 echo redo-ifchange l3 l2 >l1.do echo redo-ifchange l3 >l2.do +echo echo ok >>l1.do +echo echo ok >>l2.do cat >l3.do <all.do +cat >all.do <version.h.do <all.do printf 'redo-ifchange a +' + +>a.do : + +2>stderr redo +all.do printf 'redo-ifchange a +' + +>a.do printf 'redo-ifchange b +' + +>b.do : + +2>stderr redo +default.do cat <