Skip to content

Commit

Permalink
dependencies: fill in defaults from DEPENDENCY_KWS when generating key
Browse files Browse the repository at this point in the history
Otherwise we run into issues where the key doesn't match when some
values are empty and others are not.
  • Loading branch information
dcbaker committed Jan 28, 2025
1 parent d041031 commit 0af7113
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mesonbuild/dependencies/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ def __contains__(self, key: object) -> bool:

def get_dep_identifier(name: str, kwargs: T.Dict[str, T.Any]) -> 'TV_DepID':
identifier: 'TV_DepID' = (('name', name), )
from ..interpreter.type_checking import DEPENDENCY_KWS
nkwargs = {k.name: k.default for k in DEPENDENCY_KWS}
nkwargs.update(kwargs)

from ..interpreter import permitted_dependency_kwargs
assert len(permitted_dependency_kwargs) == 19, \
'Extra kwargs have been added to dependency(), please review if it makes sense to handle it here'
for key, value in kwargs.items():
for key, value in nkwargs.items():
# 'version' is irrelevant for caching; the caller must check version matches
# 'native' is handled above with `for_machine`
# 'required' is irrelevant for caching; the caller handles it separately
Expand Down

0 comments on commit 0af7113

Please sign in to comment.