News for hackers. Stuff that matters.
Re:ninja: a small build system with a focus on speed by oftenwrong on Monday March 30, 2026 @05:23PM (#47579871)
I might be missing your sarcasm, but this is a common approach for large scale builds. Virtual filesystems are used to provide a pre-computed tree hash as a xattr. In a more typical case, you can read the git tree hash.
Re:ninja: a small build system with a focus on speed by actionfromafar on Tuesday March 31, 2026 @03:06AM (#47583758)
Not sure it was meant as sarcasm really. I just think so many build (and other) problems could have been avoided it a file hash was available on every file by default.
Re:ninja: a small build system with a focus on speed by sagarm on Tuesday March 31, 2026 @11:42AM (#47589048)
That hash would be expensive to maintain, and the end result would still be racy since the file could be modified after the hash was read .
Re:ninja: a small build system with a focus on speed by actionfromafar on Tuesday March 31, 2026 @12:39PM (#47589998)
In the current POSIX paradigm yes, it would be expensive. But if the hash was defined as the hash of fixed blocks, it wouldn't be expensive. The raciness depends, a lot, on the semantics we would define. (In the context of a build system, it's no different than that the file could get a new mtime after we read the mtime.)