summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-03-15 10:43:07 +0100
committerJürg Billeter <j@bitron.ch>2018-05-14 11:47:17 +0200
commitfcebb88008baa0d6319476fdfa0cd06a216fd584 (patch)
treec7d54fb5798006a5984337c508113236d3baaf0e
parent7ca974b0de7c8023a9d2ffd8fbf9d42b9b760afb (diff)
downloadbuildstream-fcebb88008baa0d6319476fdfa0cd06a216fd584.tar.gz
_platform: Use GoogleCAS artifact cache
-rw-r--r--buildstream/_platform/linux.py4
-rw-r--r--buildstream/_platform/unix.py4
-rw-r--r--tests/testutils/runcli.py7
3 files changed, 5 insertions, 10 deletions
diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py
index 26dafb995..9f8b5f4ce 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.googlecas import GoogleCASCache
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 = GoogleCASCache(context, enable_push=self._user_ns_available)
@property
def artifactcache(self):
diff --git a/buildstream/_platform/unix.py b/buildstream/_platform/unix.py
index 6d7b46374..38ab401d1 100644
--- a/buildstream/_platform/unix.py
+++ b/buildstream/_platform/unix.py
@@ -20,7 +20,7 @@
import os
-from .._artifactcache.tarcache import TarCache
+from .._artifactcache.googlecas import GoogleCASCache
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 = GoogleCASCache(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 658e38874..4fd412300 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, 'googlecas', 'refs', 'heads')
cache_dir = os.path.splitext(os.path.join(cache_dir, 'test', element_name))[0]
shutil.rmtree(cache_dir)