diff options
-rw-r--r-- | buildstream/sandbox/_sandboxbwrap.py | 1 | ||||
-rw-r--r-- | buildstream/sandbox/_sandboxchroot.py | 1 | ||||
-rw-r--r-- | buildstream/storage/_filebaseddirectory.py | 4 | ||||
-rw-r--r-- | buildstream/storage/directory.py | 10 |
4 files changed, 16 insertions, 0 deletions
diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py index efec3748d..ea7254c1b 100644 --- a/buildstream/sandbox/_sandboxbwrap.py +++ b/buildstream/sandbox/_sandboxbwrap.py @@ -248,6 +248,7 @@ class SandboxBwrap(Sandbox): # a bug, bwrap mounted a tempfs here and when it exits, that better be empty. pass + self._vdir._mark_changed() return exit_code def run_bwrap(self, argv, stdin, stdout, stderr, interactive): diff --git a/buildstream/sandbox/_sandboxchroot.py b/buildstream/sandbox/_sandboxchroot.py index de4eb46e2..a902f22ad 100644 --- a/buildstream/sandbox/_sandboxchroot.py +++ b/buildstream/sandbox/_sandboxchroot.py @@ -106,6 +106,7 @@ class SandboxChroot(Sandbox): status = self.chroot(rootfs, command, stdin, stdout, stderr, cwd, env, flags) + self._vdir._mark_changed() return status # chroot() diff --git a/buildstream/storage/_filebaseddirectory.py b/buildstream/storage/_filebaseddirectory.py index 17144bc5f..8956d303a 100644 --- a/buildstream/storage/_filebaseddirectory.py +++ b/buildstream/storage/_filebaseddirectory.py @@ -121,8 +121,12 @@ class FileBasedDirectory(Directory): for f in import_result.files_written: os.utime(os.path.join(self.external_directory, f), times=(cur_time, cur_time)) + self._mark_changed() return import_result + def _mark_changed(self): + self._directory_read = False + def set_deterministic_mtime(self): _set_deterministic_mtime(self.external_directory) diff --git a/buildstream/storage/directory.py b/buildstream/storage/directory.py index 984a7f0dd..838741231 100644 --- a/buildstream/storage/directory.py +++ b/buildstream/storage/directory.py @@ -166,3 +166,13 @@ class Directory(): """ raise NotImplementedError() + + def _mark_changed(self): + """Internal function to mark this directory as having been changed + outside this API. This normally can only happen by calling the + Sandbox's `run` method. This does *not* mark everything as modified + (i.e. list_modified_paths will not necessarily return the same results + as list_relative_paths after calling this.) + + """ + raise NotImplementedError() |