diff options
Diffstat (limited to 'src/buildstream')
-rw-r--r-- | src/buildstream/storage/_casbaseddirectory.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py index a39bb65b3..a42a9f87c 100644 --- a/src/buildstream/storage/_casbaseddirectory.py +++ b/src/buildstream/storage/_casbaseddirectory.py @@ -140,6 +140,7 @@ class CasBasedDirectory(Directory): self.__digest = None self.index = {} self.parent = parent + self.__node_properties = [] self._reset(digest=digest) def _reset(self, *, digest=None): @@ -156,6 +157,8 @@ class CasBasedDirectory(Directory): except FileNotFoundError as e: raise VirtualDirectoryError("Directory not found in local cache: {}".format(e)) from e + self.__node_properties = list(pb2_directory.node_properties) + for entry in pb2_directory.directories: self.index[entry.name] = IndexEntry(entry.name, _FileType.DIRECTORY, digest=entry.digest) for entry in pb2_directory.files: @@ -759,6 +762,10 @@ class CasBasedDirectory(Directory): # Create updated Directory proto pb2_directory = remote_execution_pb2.Directory() + if self.__node_properties: + node_properties = sorted(self.__node_properties, key=lambda prop: prop.name) + pb2_directory.node_properties.extend(node_properties) + for name, entry in sorted(self.index.items()): if entry.type == _FileType.DIRECTORY: dirnode = pb2_directory.directories.add() |