Skip to content

Commit 449776d

Browse files
committed
interpreter/type_checking: fix link_with and link_whole with empty string values
This was reported as breaking pandas. Just like the `link_args` behavior, this wasn't intended, but is a result of a leaky Python abstraction ('' is falsy, and thus being caught in a falsy comparison, such as `if not value: ...`). This marks link_with and link_whole as being broken in the same way. I have only marked this for build_targets, as I don't think it applies elsewhere.
1 parent dc96996 commit 449776d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mesonbuild/interpreter/type_checking.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def link_whole_validator(values: T.List[T.Union[StaticLibrary, CustomTarget, Cus
473473
listify=True,
474474
default=[],
475475
validator=link_whole_validator,
476-
extra_types={Dependency: lambda _: _LINK_WITH_ERROR}
476+
extra_types={Dependency: lambda _: _LINK_WITH_ERROR},
477477
)
478478

479479
DEPENDENCY_SOURCES_KW: KwargInfo[T.List[T.Union[str, File, GeneratedTypes]]] = KwargInfo(
@@ -748,8 +748,12 @@ def _pch_convertor(args: T.List[str]) -> T.Optional[T.Tuple[str, T.Optional[str]
748748
DEPENDENCIES_KW,
749749
INCLUDE_DIRECTORIES.evolve(name='d_import_dirs'),
750750
LINK_ARGS_KW,
751-
LINK_WHOLE_KW,
752-
LINK_WITH_KW,
751+
LINK_WHOLE_KW.evolve(
752+
as_default={'': ('1.11.0', "Replace an empty string with an empty array: `link_whole : ''` -> `link_whole : []`")},
753+
),
754+
LINK_WITH_KW.evolve(
755+
as_default={'': ('1.11.0', "Replace an empty string with an empty array: `link_with : ''` -> `link_with : []`")},
756+
),
753757
_NAME_PREFIX_KW,
754758
_NAME_PREFIX_KW.evolve(name='name_suffix', validator=_name_suffix_validator),
755759
RUST_CRATE_TYPE_KW,

0 commit comments

Comments
 (0)