Skip to content

Commit

Permalink
interpreter: Fix dependency(..., modules: x) fallback
Browse files Browse the repository at this point in the history
Where the subproject got registered without modules, but is later looked
up with modules specified.

We cannot do the filtering in get_dep_identifier(), as the list of
modules matters in case of external dependencies.
  • Loading branch information
oleavr committed Apr 19, 2024
1 parent 2493393 commit d9f4910
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mesonbuild/interpreter/dependencyfallbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def _get_cached_dep(self, name: str, kwargs: TYPE_nkwargs) -> T.Optional[Depende
wanted_vers = stringlistify(kwargs.get('version', []))

override = self.build.dependency_overrides[self.for_machine].get(identifier)
if not override and self.subproject_name:
identifier_without_modules = tuple([(k, v) for k, v in identifier if k not in {'modules', 'optional_modules'}])
if identifier_without_modules != identifier:
override = self.build.dependency_overrides[self.for_machine].get(identifier_without_modules)
if override:
info = [mlog.blue('(overridden)' if override.explicit else '(cached)')]
cached_dep = override.dep
Expand Down

0 comments on commit d9f4910

Please sign in to comment.