You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:07:08 UTC

[buildstream] 32/41: _platform: Use CAS artifact cache

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch jmac/googlecas_and_virtual_directories_1
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit ef1ad2ac45435770dcb6631954bb6b3d074802c9
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Thu Mar 15 10:43:07 2018 +0100

    _platform: Use CAS artifact cache
---
 buildstream/_platform/linux.py | 4 ++--
 buildstream/_platform/unix.py  | 4 ++--
 tests/testutils/runcli.py      | 7 +------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py
index 26dafb9..f620f25 100644
--- a/buildstream/_platform/linux.py
+++ b/buildstream/_platform/linux.py
@@ -22,7 +22,7 @@ import subprocess
 
 from .. import _site
 from .. import utils
-from .._artifactcache.ostreecache import OSTreeCache
+from .._artifactcache.cascache import CASCache
 from .._message import Message, MessageType
 from ..sandbox import SandboxBwrap
 
@@ -37,7 +37,7 @@ class Linux(Platform):
 
         self._die_with_parent_available = _site.check_bwrap_version(0, 1, 8)
         self._user_ns_available = self._check_user_ns_available(context)
-        self._artifact_cache = OSTreeCache(context, enable_push=self._user_ns_available)
+        self._artifact_cache = CASCache(context, enable_push=self._user_ns_available)
 
     @property
     def artifactcache(self):
diff --git a/buildstream/_platform/unix.py b/buildstream/_platform/unix.py
index 6d7b463..e9c62a4 100644
--- a/buildstream/_platform/unix.py
+++ b/buildstream/_platform/unix.py
@@ -20,7 +20,7 @@
 
 import os
 
-from .._artifactcache.tarcache import TarCache
+from .._artifactcache.cascache import CASCache
 from .._exceptions import PlatformError
 from ..sandbox import SandboxChroot
 
@@ -32,7 +32,7 @@ class Unix(Platform):
     def __init__(self, context, project):
 
         super().__init__(context, project)
-        self._artifact_cache = TarCache(context)
+        self._artifact_cache = CASCache(context)
 
         # Not necessarily 100% reliable, but we want to fail early.
         if os.geteuid() != 0:
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index 658e388..96d4ea4 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -19,8 +19,6 @@ import pytest
 #
 from _pytest.capture import MultiCapture, FDCapture
 
-from tests.testutils.site import IS_LINUX
-
 # Import the main cli entrypoint
 from buildstream._frontend import cli as bst_cli
 from buildstream import _yaml
@@ -203,10 +201,7 @@ class Cli():
     def remove_artifact_from_cache(self, project, element_name):
         cache_dir = os.path.join(project, 'cache', 'artifacts')
 
-        if IS_LINUX:
-            cache_dir = os.path.join(cache_dir, 'ostree', 'refs', 'heads')
-        else:
-            cache_dir = os.path.join(cache_dir, 'tar')
+        cache_dir = os.path.join(cache_dir, 'cas', 'refs', 'heads')
 
         cache_dir = os.path.splitext(os.path.join(cache_dir, 'test', element_name))[0]
         shutil.rmtree(cache_dir)