Re:When to use Bazel?
by vbezhenar on Tuesday September 13, 2022 @06:26PM
(#32830966)
Does it re-read every single source file to find out which were changed? Sounds like a terrible approach. Or it uses mtime first and checksum after that?
[ Parent
| on HN ]
Re:When to use Bazel?
by joshuamorton on Tuesday September 13, 2022 @07:06PM
(#32831286)
Mtime first is unreliable on modern (fast) machines, you can edit a file twice in a single second. I think bazel has a daemon watch for file changes, but I'm not certain of that.
ext4, btrfs, XFS all use nanosecond time resolution.
Think remote file system where a different node is providing the mtime, so it can have substantial diffs between nodes.
Re:When to use Bazel?
by oftenwrong on Wednesday September 14, 2022 @05:20AM
(#32834868)
Bazel has a stateful server component that caches information about the build graph and source files in memory. As you said, this allows it to check mtimes first to avoid re-computing hashes for source files.
Bazel can also read source file hashes from the filesystem if the filesystem supports it.