Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (2)
...@@ -168,6 +168,8 @@ class FilterElement(Element): ...@@ -168,6 +168,8 @@ class FilterElement(Element):
self.include = self.node_get_member(node, list, 'include') self.include = self.node_get_member(node, list, 'include')
self.exclude = self.node_get_member(node, list, 'exclude') self.exclude = self.node_get_member(node, list, 'exclude')
self.include_orphans = self.node_get_member(node, bool, 'include-orphans') self.include_orphans = self.node_get_member(node, bool, 'include-orphans')
self.include_provenance = self.node_provenance(node, member_name='include')
self.exclude_provenance = self.node_provenance(node, member_name='exclude')
def preflight(self): def preflight(self):
# Exactly one build-depend is permitted # Exactly one build-depend is permitted
...@@ -207,6 +209,31 @@ class FilterElement(Element): ...@@ -207,6 +209,31 @@ class FilterElement(Element):
def assemble(self, sandbox): def assemble(self, sandbox):
with self.timed_activity("Staging artifact", silent_nested=True): with self.timed_activity("Staging artifact", silent_nested=True):
for dep in self.dependencies(Scope.BUILD, recurse=False): for dep in self.dependencies(Scope.BUILD, recurse=False):
# Check that all the included/excluded domains exist
pub_data = dep.get_public_data('bst')
split_rules = pub_data.get('split-rules', {})
unfound_includes = []
for domain in self.include:
if domain not in split_rules:
unfound_includes.append(domain)
unfound_excludes = []
for domain in self.exclude:
if domain not in split_rules:
unfound_excludes.append(domain)
detail = []
if unfound_includes:
detail.append("Unknown domains were used in {}".format(self.include_provenance))
detail.extend([' - {}'.format(domain) for domain in unfound_includes])
if unfound_excludes:
detail.append("Unknown domains were used in {}".format(self.exclude_provenance))
detail.extend([' - {}'.format(domain) for domain in unfound_excludes])
if detail:
detail = '\n'.join(detail)
raise ElementError("Unknown domains declared.", detail=detail)
dep.stage_artifact(sandbox, include=self.include, dep.stage_artifact(sandbox, include=self.include,
exclude=self.exclude, orphans=self.include_orphans) exclude=self.exclude, orphans=self.include_orphans)
return "" return ""
......
...@@ -6,9 +6,8 @@ config: ...@@ -6,9 +6,8 @@ config:
# they were defined as public data in the parent # they were defined as public data in the parent
# element's 'split-rules'. # element's 'split-rules'.
# #
# Since domains can be added, it is not an error to # If a domain is specified that does not exist, the
# specify domains which may not exist for all of the # filter element will fail to build.
# elements in this composition.
# #
# The default empty list indicates that all domains # The default empty list indicates that all domains
# of the parent's artifact should be included. # of the parent's artifact should be included.
......
...@@ -484,3 +484,14 @@ def test_filter_include_with_indirect_deps(datafiles, cli, tmpdir): ...@@ -484,3 +484,14 @@ def test_filter_include_with_indirect_deps(datafiles, cli, tmpdir):
# indirect dependencies shouldn't be staged and filtered # indirect dependencies shouldn't be staged and filtered
assert not os.path.exists(os.path.join(checkout, "foo")) assert not os.path.exists(os.path.join(checkout, "foo"))
assert not os.path.exists(os.path.join(checkout, "bar")) assert not os.path.exists(os.path.join(checkout, "bar"))
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'basic'))
def test_filter_fails_for_nonexisting_domain(datafiles, cli, tmpdir):
project = os.path.join(datafiles.dirname, datafiles.basename)
result = cli.run(project=project, args=['build', 'output-include-nonexistent-domain.bst'])
result.assert_main_error(ErrorDomain.STREAM, None)
error = "Unknown domains were used in output-include-nonexistent-domain.bst [line 7 column 2]"
assert error in result.stderr
assert '- unknown_file' in result.stderr
kind: filter kind: filter
depends: depends:
- filename: output-include.bst - filename: input.bst
type: build type: build
- filename: output-exclude.bst - filename: output-exclude.bst
type: runtime type: runtime
......
kind: filter
depends:
- filename: input.bst
type: build
config:
include:
- unknown_file