_casbaseddirectory.py: Calculate directory digest lazily

This changes CasBasedDirectory to regenerate the directory proto and its digest when the digest is actually needed, instead of keeping them up-to-date. This avoids repeated directory digest recalculation on successive updates, which had a huge performance overhead when staging many dependencies using CAS-to-CAS import (i.e., for remote execution or with the WIP buildbox branch).

This also fixes the issue that the generated directory protos were not guaranteed to be in canonical form (sorted directory entries).

Edited by Jürg Billeter

Merge request reports

Loading