summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-07-09 21:16:05 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-09 21:16:05 +0000
commitd1a9a920812ee832d4e4c34a24e8d84c3c9665ca (patch)
treef0e605167c3b99ce6e60da6498ded10b2623d637 /src
parente274b648ccbf0149b46ffdee51316bdd4fac7a2e (diff)
parent5781dd9ebcb924ba64f73d746a78402f7e44c7e5 (diff)
downloadbuildstream-d1a9a920812ee832d4e4c34a24e8d84c3c9665ca.tar.gz
Merge branch 'aevri/vulture' into 'master'
Remove some unused code See merge request BuildStream/buildstream!1455
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_cas/cascache.py15
-rw-r--r--src/buildstream/_exceptions.py17
-rw-r--r--src/buildstream/_frontend/status.py2
-rw-r--r--src/buildstream/_frontend/widget.py8
-rw-r--r--src/buildstream/_loader/loadelement.py1
-rw-r--r--src/buildstream/_options/option.py7
-rw-r--r--src/buildstream/_plugincontext.py13
-rw-r--r--src/buildstream/_scheduler/scheduler.py9
-rw-r--r--src/buildstream/_sourcecache.py12
-rw-r--r--src/buildstream/_stream.py11
-rw-r--r--src/buildstream/element.py2
-rw-r--r--src/buildstream/source.py6
-rw-r--r--src/buildstream/storage/_casbaseddirectory.py57
13 files changed, 21 insertions, 139 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 771e31208..49a5e8837 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -272,19 +272,6 @@ class CASCache():
return None
- # link_ref():
- #
- # Add an alias for an existing ref.
- #
- # Args:
- # oldref (str): An existing ref
- # newref (str): A new ref for the same directory
- #
- def link_ref(self, oldref, newref):
- tree = self.resolve_ref(oldref)
-
- self.set_ref(newref, tree)
-
# push():
#
# Push committed refs to remote repository.
@@ -1050,7 +1037,6 @@ class CASQuota:
self._cache_quota_original = None # The cache quota as specified by the user, in bytes
self._cache_quota_headroom = None # The headroom in bytes before reaching the quota or full disk
self._cache_lower_threshold = None # The target cache size for a cleanup
- self.available_space = None
self._message = context.messenger.message
@@ -1225,7 +1211,6 @@ class CASQuota:
total_size, available_space = self._get_cache_volume_size()
cache_size = self.get_cache_size()
- self.available_space = available_space
# Ensure system has enough storage for the cache_quota
#
diff --git a/src/buildstream/_exceptions.py b/src/buildstream/_exceptions.py
index f57e4b34a..82f1fe8ed 100644
--- a/src/buildstream/_exceptions.py
+++ b/src/buildstream/_exceptions.py
@@ -88,15 +88,14 @@ class ErrorDomain(Enum):
SANDBOX = 5
ARTIFACT = 6
PIPELINE = 7
- OSTREE = 8
- UTIL = 9
- SOURCE = 10
- ELEMENT = 11
- APP = 12
- STREAM = 13
- VIRTUAL_FS = 14
- CAS = 15
- PROG_NOT_FOUND = 16
+ UTIL = 8
+ SOURCE = 9
+ ELEMENT = 10
+ APP = 11
+ STREAM = 12
+ VIRTUAL_FS = 13
+ CAS = 14
+ PROG_NOT_FOUND = 15
# BstError is an internal base exception class for BuildSream
diff --git a/src/buildstream/_frontend/status.py b/src/buildstream/_frontend/status.py
index f0fb22639..32fda1147 100644
--- a/src/buildstream/_frontend/status.py
+++ b/src/buildstream/_frontend/status.py
@@ -76,7 +76,6 @@ class Status():
self._term_width, _ = click.get_terminal_size()
self._alloc_lines = 0
self._alloc_columns = None
- self._line_length = 0
self._need_alloc = True
self._term_caps = self._init_terminal()
@@ -258,7 +257,6 @@ class Status():
self._alloc_lines = alloc_lines
self._alloc_columns = alloc_columns
- self._line_length = line_length
self._need_alloc = False
def _job_lines(self, columns):
diff --git a/src/buildstream/_frontend/widget.py b/src/buildstream/_frontend/widget.py
index 769c95e75..bc49e2927 100644
--- a/src/buildstream/_frontend/widget.py
+++ b/src/buildstream/_frontend/widget.py
@@ -74,13 +74,6 @@ class Widget():
raise ImplError("{} does not implement render()".format(type(self).__name__))
-# Used to add spacing between columns
-class Space(Widget):
-
- def render(self, message):
- return ' '
-
-
# Used to add fixed text between columns
class FixedText(Widget):
@@ -330,7 +323,6 @@ class LogLine(Widget):
self._resolved_keys = None
self._state = state
- self._space_widget = Space(context, content_profile, format_profile)
self._logfile_widget = LogFile(context, content_profile, format_profile, err_profile)
if context.log_debug:
diff --git a/src/buildstream/_loader/loadelement.py b/src/buildstream/_loader/loadelement.py
index 850b41a67..673bc50ee 100644
--- a/src/buildstream/_loader/loadelement.py
+++ b/src/buildstream/_loader/loadelement.py
@@ -61,7 +61,6 @@ class LoadElement():
self.node = node # The YAML node
self.name = filename # The element name
self.full_name = None # The element full name (with associated junction)
- self.deps = None # The list of Dependency objects
self.meta_done = False # If the MetaElement for this LoadElement is done
self.node_id = next(self._counter)
diff --git a/src/buildstream/_options/option.py b/src/buildstream/_options/option.py
index ffdb4d272..511678749 100644
--- a/src/buildstream/_options/option.py
+++ b/src/buildstream/_options/option.py
@@ -45,7 +45,6 @@ class Option():
def __init__(self, name, definition, pool):
self.name = name
- self.description = None
self.variable = None
self.value = None
self.pool = pool
@@ -60,7 +59,11 @@ class Option():
# node (dict): The loaded YAML dictionary describing
# the option
def load(self, node):
- self.description = _yaml.node_get(node, str, 'description')
+
+ # We don't use the description, but we do require that options have a
+ # description.
+ _yaml.node_get(node, str, 'description')
+
self.variable = _yaml.node_get(node, str, 'variable', default_value=None)
# Assert valid symbol name for variable name
diff --git a/src/buildstream/_plugincontext.py b/src/buildstream/_plugincontext.py
index 7a5407cf6..7fef9b9f4 100644
--- a/src/buildstream/_plugincontext.py
+++ b/src/buildstream/_plugincontext.py
@@ -32,6 +32,8 @@ from . import _yaml
# base_type (type): A base object type for this context
# site_plugin_path (str): Path to where buildstream keeps plugins
# plugin_origins (list): Data used to search for plugins
+# format_versions (dict): A dict of meta.kind to the integer minimum
+# version number for each plugin to be loaded
#
# Since multiple pipelines can be processed recursively
# within the same interpretor, it's important that we have
@@ -43,8 +45,7 @@ from . import _yaml
class PluginContext():
def __init__(self, plugin_base, base_type, site_plugin_path, *,
- plugin_origins=None, dependencies=None,
- format_versions={}):
+ plugin_origins=None, format_versions={}):
# The plugin kinds which were loaded
self.loaded_dependencies = []
@@ -52,7 +53,6 @@ class PluginContext():
#
# Private members
#
- self._dependencies = dependencies
self._base_type = base_type # The base class plugins derive from
self._types = {} # Plugin type lookup table by kind
self._plugin_origins = plugin_origins or []
@@ -217,9 +217,10 @@ class PluginContext():
# Now assert BuildStream version
bst_major, bst_minor = utils.get_bst_version()
- if bst_major < plugin_type.BST_REQUIRED_VERSION_MAJOR or \
- (bst_major == plugin_type.BST_REQUIRED_VERSION_MAJOR and
- bst_minor < plugin_type.BST_REQUIRED_VERSION_MINOR):
+ req_major = plugin_type.BST_REQUIRED_VERSION_MAJOR
+ req_minor = plugin_type.BST_REQUIRED_VERSION_MINOR
+
+ if (bst_major, bst_minor) < (req_major, req_minor):
raise PluginError("BuildStream {}.{} is too old for {} plugin '{}' (requires {}.{})"
.format(
bst_major, bst_minor,
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index d2ea2741e..00d61140e 100644
--- a/src/buildstream/_scheduler/scheduler.py
+++ b/src/buildstream/_scheduler/scheduler.py
@@ -103,15 +103,6 @@ class Scheduler():
self._interrupt_callback = interrupt_callback
self._ticker_callback = ticker_callback
- # Whether our exclusive jobs, like 'cleanup' are currently already
- # waiting or active.
- #
- # This is just a bit quicker than scanning the wait queue and active
- # queue and comparing job action names.
- #
- self._exclusive_waiting = set()
- self._exclusive_active = set()
-
self.resources = Resources(context.sched_builders,
context.sched_fetchers,
context.sched_pushers)
diff --git a/src/buildstream/_sourcecache.py b/src/buildstream/_sourcecache.py
index fdfe00901..b39874b20 100644
--- a/src/buildstream/_sourcecache.py
+++ b/src/buildstream/_sourcecache.py
@@ -126,18 +126,6 @@ class SourceCache(BaseCache):
except SourceCacheError:
pass
- # required_sources()
- #
- # Yields the keys of all sources marked as required by the current build
- # plan
- #
- # Returns:
- # iterable (str): iterable over the required source refs
- #
- def required_sources(self):
- for source in self._required_sources:
- yield source._get_source_name()
-
# unrequired_sources()
#
# Yields the refs of all sources not required by the current build plan
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 2ad1a4fee..7e68f1afd 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -1451,17 +1451,6 @@ class Stream():
os.chmod(script_path, stat.S_IEXEC | stat.S_IREAD)
- # Collect the sources in the given sandbox into a tarfile
- def _collect_sources(self, directory, tar_name, element_name, compression):
- with self._context.messenger.timed_activity("Creating tarball {}".format(tar_name)):
- if compression == "none":
- permissions = "w:"
- else:
- permissions = "w:" + compression
-
- with tarfile.open(tar_name, permissions) as tar:
- tar.add(directory, arcname=element_name)
-
# _get_element_dirname()
#
# Get path to directory for an element based on its normal name.
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index fa4f63bff..758a0b97d 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -221,7 +221,6 @@ class Element(Plugin):
self.__assemble_scheduled = False # Element is scheduled to be assembled
self.__assemble_done = False # Element is assembled
self.__tracking_scheduled = False # Sources are scheduled to be tracked
- self.__tracking_done = False # Sources have been tracked
self.__pull_done = False # Whether pull was attempted
self.__splits = None # Resolved regex objects for computing split domains
self.__whitelist_regex = None # Resolved regex object to check if file is allowed to overlap
@@ -1337,7 +1336,6 @@ class Element(Plugin):
assert self.__tracking_scheduled
self.__tracking_scheduled = False
- self.__tracking_done = True
self.__update_state_recursively()
diff --git a/src/buildstream/source.py b/src/buildstream/source.py
index 76c56fd1d..f8b5d3f88 100644
--- a/src/buildstream/source.py
+++ b/src/buildstream/source.py
@@ -312,8 +312,6 @@ class Source(Plugin):
super().__init__("{}-{}".format(meta.element_name, meta.element_index),
context, project, provenance, "source", unique_id=unique_id)
- self.__source_cache = context.sourcecache
-
self.__element_name = meta.element_name # The name of the element owning this source
self.__element_index = meta.element_index # The index of the source in the owning element's source list
self.__element_kind = meta.element_kind # The kind of the element owning this source
@@ -726,10 +724,6 @@ class Source(Plugin):
else:
self.__do_fetch()
- def _cache(self, previous_sources):
- # stage the source into the source cache
- self.__source_cache.commit(self, previous_sources)
-
# Wrapper for stage() api which gives the source
# plugin a fully constructed path considering the
# 'directory' option
diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py
index a93f16d90..2c5d751e4 100644
--- a/src/buildstream/storage/_casbaseddirectory.py
+++ b/src/buildstream/storage/_casbaseddirectory.py
@@ -62,35 +62,6 @@ class IndexEntry():
return self.buildstream_object._get_digest()
-class ResolutionException(VirtualDirectoryError):
- """ Superclass of all exceptions that can be raised by
- CasBasedDirectory._resolve. Should not be used outside this module. """
-
-
-class InfiniteSymlinkException(ResolutionException):
- """ Raised when an infinite symlink loop is found. """
-
-
-class AbsoluteSymlinkException(ResolutionException):
- """Raised if we try to follow an absolute symlink (i.e. one whose
- target starts with the path separator) and we have disallowed
- following such symlinks.
- """
-
-
-class UnexpectedFileException(ResolutionException):
- """Raised if we were found a file where a directory or symlink was
- expected, for example we try to resolve a symlink pointing to
- /a/b/c but /a/b is a file.
- """
- def __init__(self, message=""):
- """Allow constructor with no arguments, since this can be raised in
- places where there isn't sufficient information to write the
- message.
- """
- super().__init__(message)
-
-
# CasBasedDirectory intentionally doesn't call its superclass constuctor,
# which is meant to be unimplemented.
# pylint: disable=super-init-not-called
@@ -439,7 +410,7 @@ class CasBasedDirectory(Directory):
def export_to_tar(self, tarfile, destination_dir, mtime=BST_ARBITRARY_TIMESTAMP):
raise NotImplementedError()
- def mark_changed(self):
+ def _mark_changed(self):
""" It should not be possible to externally modify a CAS-based
directory at the moment."""
raise NotImplementedError()
@@ -613,32 +584,6 @@ class CasBasedDirectory(Directory):
return self.__digest
- def _get_child_digest(self, *path):
- subdir = self.descend(*path[:-1])
- entry = subdir.index[path[-1]]
- if entry.type == _FileType.DIRECTORY:
- subdir = entry.buildstream_object
- if subdir:
- return subdir._get_digest()
- else:
- return entry.digest
- elif entry.type == _FileType.REGULAR_FILE:
- return entry.digest
- else:
- raise VirtualDirectoryError("Directory entry has no digest: {}".format(os.path.join(*path)))
-
- def _objpath(self, *path):
- subdir = self.descend(*path[:-1])
- entry = subdir.index[path[-1]]
- return self.cas_cache.objpath(entry.digest)
-
- def _exists(self, *path):
- try:
- subdir = self.descend(*path[:-1])
- return path[-1] in subdir.index
- except VirtualDirectoryError:
- return False
-
def __invalidate_digest(self):
if self.__digest:
self.__digest = None