Skip to content

Commit 6473a72

Browse files
committed
dependencies: fill in defaults from DEPENDENCY_KWS when generating key
Otherwise we run into issues where the key doesn't match when some values are empty and others are not. These values can be empty when they come from `find_external_dependency`, but will be initialized to a default when they come from the `Interpreter`.
1 parent f0d121e commit 6473a72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mesonbuild/dependencies/detect.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ def __contains__(self, key: object) -> bool:
4040

4141
def get_dep_identifier(name: str, kwargs: T.Dict[str, T.Any]) -> 'TV_DepID':
4242
identifier: 'TV_DepID' = (('name', name), )
43+
from ..interpreter.type_checking import DEPENDENCY_KWS
44+
nkwargs = {k.name: k.default for k in DEPENDENCY_KWS}
45+
nkwargs.update(kwargs)
46+
4347
from ..interpreter import permitted_dependency_kwargs
4448
assert len(permitted_dependency_kwargs) == 19, \
4549
'Extra kwargs have been added to dependency(), please review if it makes sense to handle it here'
46-
for key, value in kwargs.items():
50+
for key, value in nkwargs.items():
4751
# 'version' is irrelevant for caching; the caller must check version matches
4852
# 'native' is handled above with `for_machine`
4953
# 'required' is irrelevant for caching; the caller handles it separately

0 commit comments

Comments
 (0)