doc/INSTALL | 2 +- doc/NEWS | 5 +++++ doc/cmd/redo-ifchange | 2 ++ run.go | 3 +++ t/goredo-build-uuid-for-fdood.t | 3 +++ t/goredo-double-consideration.t | 5 ++++- t/redo-sh.tests/nothing_written_1/test | 10 ++++++++++ t/redo-sh.tests/nothing_written_2/test | 14 ++++++++++++++ t/redo-sh.tests/parallel_1/test | 1 + t/redosh-nothing_written_1.t | 1 + t/redosh-nothing_written_2.t | 1 + usage.go | 2 +- diff --git a/doc/INSTALL b/doc/INSTALL index 5d99941b3c134c991f0c01d6adbba8b2332d2cea8049f56e392cfa4aa07ae040..49d97e2cadabd55a9a856e1175bc31ad5c3e187955ab64c1b2effa8624a25385 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -11,7 +11,7 @@ => https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/go/goredo NixOS packages 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 650db08a7ded1e74fc5ea5f98b7d964df8ff09c7d1ed7e8f46539ee14e7db625..73ea890e71fdb02332596720e7c48a1e29a9ff2a3fe5904a8bbd7106aba35c1e 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 39ff90f4067546fa51bc5ab9cd6ecfff232716218e7d8271738a79a04f6d8b58..93094714fc8ef2e1472b9e7169aaaf546e1759c44672781e70b587e4d99aa2de 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 43ebcfefbfd8d60ccb54cd3451d5481b3518ca4281a0ff118d07e99bf2d71f57..8e8adb786c06537b34e0fc337e6928cac32217b88395c72d685ea8e1dbcde8bd 100644 --- a/run.go +++ b/run.go @@ -745,6 +745,9 @@ } // 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 166cb5e65ee9b5f3baf306c6fe2e0f98c04ebaded5402ce8890b2174b9bdbfd3..275f48e04bafa8b56236650df1c0257b91ed4f22988607ef01fa93f180a22ad4 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 <