Skip to content

Commit

Permalink
Merge pull request AdaCore#546 from leocardao/VB28-011
Browse files Browse the repository at this point in the history
Fix issue where downloaded dependencies are not tracked
  • Loading branch information
enzbang authored Nov 29, 2022
2 parents 9da0c7c + 644b3d1 commit 674c67b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/e3/anod/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def compute_closure(self, spec: Anod, publish: bool) -> None:
for dep, dep_spec in list(self.context.dependencies[spec.uid].values()):

# Only consider build and install dependency (discard source deps)
if dep.kind in ("build", "install"):
if dep.kind in ("build", "install", "download"):
if dep_spec.kind == "install":
# An install dep should be expanded whenever
# expand_packages is defined or when there is no component
Expand Down
25 changes: 25 additions & 0 deletions tests/tests_e3/anod/source_closure_specs/spec6.anod
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from e3.anod.spec import Anod

class Spec6(Anod):
component = 'spec6'

@property
def build_source_list(self):
return [Anod.Source(name='spec6-src', publish=True, dest='a'),
Anod.Source(name='spec6-internal-src', publish=False, dest='b')]

@property
def build_deps(self):
return [Anod.Dependency(name='spec2', track=True,
require='download'),
Anod.Dependency(name='spec-tools', track=False,
require='download')]

@property
def source_pkg_build(self):
return [Anod.ThirdPartySourceBuilder(name='spec6-src'),
Anod.ThirdPartySourceBuilder(name='spec6-internal-src')]

@Anod.primitive()
def build(self):
pass
16 changes: 16 additions & 0 deletions tests/tests_e3/anod/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,19 @@ def test_recursive_source_closure_with_package(self):
assert len(published_sources) == 2
assert published_sources == ["spec2-package-src", "spec5-src"]
assert len(unpublished_sources) == 2

def test_recursive_source_closure_with_download(self):
sc = self.get_source_closure("spec6")

for key in sc.source_list:
sc.resolve_source(source_name=key.src_name, data=key.src_name)

sources = sc.get_source_list()
published_sources = [src for src, publish in sources if publish]
published_sources.sort()
unpublished_sources = [src for src, publish in sources if not publish]

assert len(sources) == 4
assert len(published_sources) == 2
assert published_sources == ["spec2-src", "spec6-src"]
assert len(unpublished_sources) == 2

0 comments on commit 674c67b

Please sign in to comment.