summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-10-02 11:17:00 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-10-02 11:17:00 +0000
commitdbc8f59f3e480610ca054eca07a823a2d9d5dc58 (patch)
treed5827d4317867f4a7c21478bd79553b3c34b2072
parent7d050faca8a9c4bd70afd26121d1800de74f119b (diff)
parent9cb1ad2bf413c46ad25a86534a4c4686d116c179 (diff)
downloadbuildstream-dbc8f59f3e480610ca054eca07a823a2d9d5dc58.tar.gz
Merge branch 'tlater/fix-casdless-completion' into 'master'
Do not check for casd in bash completion Closes #1149 See merge request BuildStream/buildstream!1615
-rw-r--r--src/buildstream/_context.py10
-rw-r--r--src/buildstream/_frontend/cli.py2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index 74833e932..52dcfbdcd 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -48,7 +48,7 @@ from .sandbox import SandboxRemote
#
class Context():
- def __init__(self):
+ def __init__(self, *, use_casd=True):
# Whether we are running as part of a test suite. This is only relevant
# for developing BuildStream itself.
@@ -72,6 +72,10 @@ class Context():
# The directory for CAS
self.casdir = None
+ # Whether to use casd - meant for interfaces such as
+ # completion where casd is not required
+ self.use_casd = use_casd
+
# The directory for artifact protos
self.artifactdir = None
@@ -509,7 +513,9 @@ class Context():
def get_cascache(self):
if self._cascache is None:
- self._cascache = CASCache(self.cachedir, cache_quota=self.config_cache_quota)
+ self._cascache = CASCache(self.cachedir,
+ casd=self.use_casd,
+ cache_quota=self.config_cache_quota)
return self._cascache
# is_fork_allowed():
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 931f531aa..9abab6473 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -133,7 +133,7 @@ def complete_target(args, incomplete):
def complete_artifact(orig_args, args, incomplete):
from .._context import Context
- with Context() as ctx:
+ with Context(use_casd=False) as ctx:
config = None
if orig_args: