Closed kkimdev closed 6 years ago
nvm it seems like -a
already includes -t
.
OK, the real issue was more nuanced than I thought. Using drone-volume-cache made my Makefile rebuild certain steps unnecessarily. So I thought last modified timestamp for files is re-written. Actually it was opposite, some files' last modified timestamp weren't updated.
For example,
Right after Makefile build:
after rebuilding and restore:
Noticed that generated.h's timestamp went backward. I suspect that what's happening here is that, generated.h's timestamp changed after Makefile build, but the content isn't changed. And when drone-volume-cache plugin caches by rsync, rsync figured out that it didn't need to resync generated.h since the content is the same, so generate.h's timestamp is not updated.
OK please hold on let me investigate a bit, sorry for adding contradicting messages.
OK, the issue for me was that git clone step does not preserve last modified timestamp, not drone-volume-cache plugin. Since git doesn't store timestamp.
rsync -t
https://unix.stackexchange.com/questions/61586/how-to-tell-rsync-to-preserve-time-stamp-on-files-when-source-tree-has-a-mounted
This will make caching for timestamp based buildsystem more reliable, e.g., make.