godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.3k stars 21.24k forks source link

[Buildsystem] Prevent cache check mangling access time #99501

Closed AThousandShips closed 14 hours ago

AThousandShips commented 21 hours ago

Checking for text files using open changes atime, which breaks cache access sorting, this ensures the cache access time is preserved.

From looking at the code (without testing) this seems to be a regression from:

So shouldn't affect older versions but haven't tested explicitly there for access time issues

AThousandShips commented 21 hours ago

This could be replaced by having another way to handle the checking for text files, but I'm not aware of one. Couldn't find any way to use open or similar without updating atime, if there is that would be more useful here

dustdfg commented 20 hours ago

This could be replaced by having another way to handle the checking for text files, but I'm not aware of one. Couldn't find any way to use open or similar without updating atime, if there is that would be more useful here

Myabe os.stat would work? You can then set atime with os.utime I've should look on changes before writing comment. sorry

dustdfg commented 20 hours ago

And another question. Maybe cache should rely on mtime? Not on atime?

AThousandShips commented 20 hours ago

~That's my solution? Or what do you mean? Please check the code~

It shouldn't rely on mtime because then it'll ignore older, but more recently used, cache entries, cache entries that were read but not written to

Repiteo commented 14 hours ago

Thanks!

AThousandShips commented 5 hours ago

Thank you!