Commit 76026166 authored by Tristan Maat's avatar Tristan Maat
Browse files

_pipeline.py: Add warning for unused workspaces

parent 81c448e1
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ class Pipeline():
        self.artifacts = ArtifactCache(self.context)
        self.session_elements = 0
        self.total_elements = 0
        self.unused_workspaces = []

        pluginbase = PluginBase(package='buildstream.plugins')
        self.element_factory = ElementFactory(pluginbase, project._plugin_element_paths)
@@ -160,6 +161,7 @@ class Pipeline():
            element = self.target.search(Scope.ALL, element_name)

            if element is None:
                self.unused_workspaces.append((element_name, source, workspace))
                continue

            # Usually few sources, performance should be fine
@@ -373,6 +375,10 @@ class Pipeline():
    #    track_first (bool): Track sources before fetching and building (implies build_all)
    #
    def build(self, scheduler, build_all, track_first):
        if len(self.unused_workspaces) > 0:
            self.message(self.target, MessageType.WARN, "Unused workspaces",
                         detail="\n".join([el + "-" + str(src) for el, src, _
                                           in self.unused_workspaces]))

        if build_all or track_first:
            plan = list(self.dependencies(Scope.ALL))