Bug? chained redo-stamp targets do not work as expected

22 views
Skip to first unread message

Tomáš Ebenlendr

unread,
Feb 19, 2021, 10:08:12 AM2/19/21
to redo
Consider following usecase:
all.do:
  redo-ifchange downloaded.file

downloaded.file.do:
  redo-ifchange downloaded.file.sha256
  wget http://upstream.server/"$1" -O "$3"

downloaded.file.sha256.do:
  redo-ifchange stamp.every-hour.do
  wget http://upstream.server/"$1" -O "$3"
  redo-stamp <"$3"

stamp.every.hour.do:
  redo-always
  date +"%F %H" > "$3"
  redo-stamp <"$3"

Actual behaviour:
  downloaded.file.sha256 is downloaded at most once in a hour (this works)
  downloaded.file is downloaded every time downloaded.file.sha256 is downloaded
Expected behaviour:
  downloaded.file is downloaded only if downloaded.file.sha256 contents is changed

Generaly speaking: T->A->B(stamp)->C(stamp)
"A" is rebuild whenever content of "C" is changed, even if content of "B" is not changed by rebuild. Expected behaviour is that "C" changed invokes rebuild of "B", but if result of "B" does not change, then "A" is not rebuilt.

Tomáš Ebenlendr

unread,
Feb 19, 2021, 1:59:34 PM2/19/21
to redo
In fact it is not importat if C marked by redo-stamp or not:
all->A->B(redo-stamp)->C(any)
If C is rebuild for any reason, then A is rebuild no matter if stamp of B has actually changed. But there is no direct dependency of A on C.
Current implementation of redo-stamp makes sence only only on targets that do not depend on another target. But this is not mentioned in documentation.

Dne pátek 19. února 2021 v 16:08:12 UTC+1 uživatel Tomáš Ebenlendr napsal:
Reply all
Reply to author
Forward
0 new messages