Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/buildstream/_cas/cascache.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def checkout(self, dest, tree, *, can_link=False, _fetch=True):
fullpath = os.path.join(dest, symlinknode.name)
os.symlink(symlinknode.target, fullpath)

node_properties = directory.node_properties
if node_properties.HasField("mtime"):
mtime = utils._parse_protobuf_timestamp(node_properties.mtime)
utils._set_file_mtime(dest, mtime)

# ensure_tree():
#
# Make sure all blobs referenced by the given directory tree are available
Expand Down
6 changes: 6 additions & 0 deletions tests/internals/storage_vdir_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def generate_import_root(rootdir, filelist):
(dirnames, filename) = os.path.split(path)
os.makedirs(os.path.join(rootdir, dirnames), exist_ok=True)
os.symlink(content, os.path.join(rootdir, path))
# Set deterministic mtime for all directories
for (dirpath, _, _) in os.walk(rootdir):
_set_file_mtime(dirpath, MTIME)


def generate_random_root(rootno, directory):
Expand Down Expand Up @@ -116,6 +119,9 @@ def generate_random_root(rootno, directory):
relative_link = os.path.relpath(symlink_destination, start=location)
os.symlink(relative_link, target)
things.append(os.path.join(location, thingname))
# Set deterministic mtime for all directories
for (dirpath, _, _) in os.walk(rootdir):
_set_file_mtime(dirpath, MTIME)


def file_contents(path):
Expand Down
Loading