Every ninja call causes a relink
Ninja doesn't try to check the freshness of artifacts itself, but defers this work to cargo, due to the fact that there's plenty of dynamic dependencies there that don't make sense to enumerate.
Cargo seems to update the librs.a binary even when nothing has changed, and ninja cannot recognize the cases when it was not updated, so it treats it as fresh, and relinks again. This slows down the build.
Depending on what is actually happening, this could be solved either by some combination of:
- having Cargo not rebuild things when nothing changed
- having cargo build reproducibly
- having ninja compare hashes instead of timestamps