Tiago Gomes pushed to branch tiagogomes/issue-520 at BuildStream / buildstream
Commits:
-
3782c15f
by Ed Baunton at 2018-08-04T08:54:58Z
-
f918205a
by Tristan Van Berkom at 2018-08-04T10:08:21Z
-
8d2a16a4
by Tiago Gomes at 2018-08-04T10:10:27Z
-
ac9d9f40
by Tiago Gomes at 2018-08-04T10:10:27Z
3 changed files:
- buildstream/_artifactcache/artifactcache.py
- buildstream/_artifactcache/cascache.py
- buildstream/element.py
Changes:
... | ... | @@ -475,6 +475,10 @@ class ArtifactCache(): |
475 | 475 |
#
|
476 | 476 |
# Implementations should also use this to update estimated_size.
|
477 | 477 |
#
|
478 |
+ # This function might be called when there is a cleaning operation in
|
|
479 |
+ # progress on the artifact cache. So implementations must be able to
|
|
480 |
+ # coupe with no longer existing filepaths.
|
|
481 |
+ #
|
|
478 | 482 |
# Returns:
|
479 | 483 |
#
|
480 | 484 |
# (int) The size of the artifact cache.
|
... | ... | @@ -472,9 +472,12 @@ class CASCache(ArtifactCache): |
472 | 472 |
raise ArtifactError("Attempt to access unavailable artifact: {}".format(e)) from e
|
473 | 473 |
|
474 | 474 |
def calculate_cache_size(self):
|
475 |
- if self.cache_size is None:
|
|
476 |
- self.cache_size = utils._get_dir_size(self.casdir)
|
|
477 |
- self.estimated_size = self.cache_size
|
|
475 |
+ while self.cache_size is None:
|
|
476 |
+ try:
|
|
477 |
+ self.cache_size = utils._get_dir_size(self.casdir)
|
|
478 |
+ self.estimated_size = self.cache_size
|
|
479 |
+ except FileNotFoundError:
|
|
480 |
+ pass
|
|
478 | 481 |
|
479 | 482 |
return self.cache_size
|
480 | 483 |
|
... | ... | @@ -369,8 +369,8 @@ class Element(Plugin): |
369 | 369 |
generated script is run:
|
370 | 370 |
|
371 | 371 |
- All element variables have been exported.
|
372 |
- - The cwd is `self.get_variable('build_root')/self.normal_name`.
|
|
373 |
- - $PREFIX is set to `self.get_variable('install_root')`.
|
|
372 |
+ - The cwd is `self.get_variable('build-root')/self.normal_name`.
|
|
373 |
+ - $PREFIX is set to `self.get_variable('install-root')`.
|
|
374 | 374 |
- The directory indicated by $PREFIX is an empty directory.
|
375 | 375 |
|
376 | 376 |
Files are expected to be installed to $PREFIX.
|