revng / revng-orchestra

rev.ng's package manager
4 stars 6 forks source link

Preserve tmproot timestamps from post-install scripts #47

Closed fcremo closed 2 years ago

fcremo commented 2 years ago

This patch ensures that the postinstall steps that replace NDEBUG and ASAN defines in headers do not affect the files mtime

aleclearmind commented 2 years ago

Nice! Can you please test that, in the following, revng-c is now installed super quickly the second time (i.e., without recompiling anything)?

orc install revng-c
orc install revng
orc install revng-c
aleclearmind commented 2 years ago

OK, now we no longer need to recompile, but we still relink. We have a similar issue to the one of the headers with ELFs due to fixing rpaths _fix_rpath. I'm thinking, before all these fixes, in Python, we should recursively save the mtime of all the files, apply the various fixes and then restore the dates. Otherwise, for each fix we'll need to do something ad-hoc and we're very highly likely to forget/get it wrong.

fcremo commented 2 years ago

Now I read all the mtimes for the files in the tmproot before the post-install phase and restore them afterwards. I also read and restore the atimes, since utime takes a tuple with both of them.

aleclearmind commented 2 years ago

Works great!

aleclearmind commented 2 years ago

Merged, thanks!