Equivalent of DELETE_ON_ERROR
Does pydoit provide a facility similar to the DELETE_ON_ERROR option for GNU make? According to the documentation from the official website:
.DELETE_ON_ERROR
If .DELETE_ON_ERROR is mentioned as a target anywhere in the makefile, then make will delete the target of a rule if it has changed and its recipe exits with a nonzero exit status, just as it does when it receives a signal. See Errors in Recipes.
When a long running task is interrupted with Ctrl+C, then this usually results in a corrupted target file that should not be used for further processing steps. With the current default behavior, however, the file remains, and pydoit may try to use it for other targets that depend on it. How can one avoid this?
Does pydoit provide a facility similar to the DELETE_ON_ERROR option for GNU make?
No
With the current default behavior, however, the file remains, and pydoit may try to use it for other targets that depend on it. How can one avoid this?
I doubt this would happen, even with the --continue option tasks that depend on target from task that was not completed will not be executed. If this is really happening to you, please provide an example and open another issue.
On a single invocation of doit, they would not be executed, but any subsequent invocation has no memory of whether the dependent task was completed successfully (as far as I understand).
In my case, I am basically generating large files that contain a lot of data, and then I have a second task for generating some plots from that data. If I press Ctrl+C during the file generation period, then the data files are incomplete, and any subsequent runs of doit should not be using them as input. It would be really nice to be able to tell a task to delete its target on error or if an interrupt signal is sent so that any subsequent run would generate them from scratch.
For long running tasks, I always have the tool write to a temporary file and only upon successful completion, mv it to the correct task target. That way, if I ctrl-C the job, the data file doesn't exist. -Tom
On Sat, Aug 26, 2017 at 2:05 AM, Dzhelil Rufat [email protected] wrote:
On a single invocation of doit, they would not be executed, but any subsequent invocation has no memory of whether the dependent task was completed successfully (as far as I understand).
In my case, I am basically generating large files that contain a lot of date, and then I have a second task for generating some plots from that data. If I press Ctrl+C during the file generation period, then the data files are incomplete, and any subsequent runs of doit should not be using them as input. It would be really nice to be able to tell a task to delete its target on error or if an interrupt signal is sent.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pydoit/doit/issues/191#issuecomment-325091556, or mute the thread https://github.com/notifications/unsubscribe-auth/AJn3Axb9Bu7vePfGgh8h3_nfn99-A4BLks5sb7W7gaJpZM4PDXEK .