Subject: Re: Multiple calls to redo-* for same target results in multiple .rec entries

From: goredo <[email-masked]>
Date: Thu, 4 Nov 2021 15:35:15 +0000 (UTC)

Hi,

For several days, you had me convinced that dependency recording could be kept that simple, but now I've triggered a bug.

Write a default.do.do and create a foo/default.do from it. Try again and redo fails with
```
main.go:484: foo/default.do: Size missing
```

redo implicitly records an ifcreate dependency on default.do (as it was missing in foo/ the first time).

This can, of course, be remedied by not recording .do files as ifcreate dependencies that are the current target. Removing the ifcreate dependency from the rec file fixes the issue.

Still, this had me thinking what it means to have an ifcreate and ifchange dependency on a file, whether the order matters or should matter, and how other redo implementations behave in that case. Especially because redo provides no way to check or remove prior decisions. I'm leaning towards an approach that either records exactly one dependency per target, or where only the last dependency to a specific target is considered. (I.e. last writer wins semantics)

What do you think? goredo should treat dependencies the same as the other implementations, shouldn't it?

Regards,
–Michael